Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Side by Side Diff: owners.py

Issue 6657028: Actually check Rietveld for LGTMs in CheckOwners() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: rename is_tbr to tbr, remove optional email_regexp param from CheckOwners() Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « PRESUBMIT.py ('k') | presubmit_canned_checks.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """A database of OWNERS files.""" 5 """A database of OWNERS files."""
6 6
7 import re 7 import re
8 8
9 9
10 # If this is present by itself on a line, this means that everyone can review. 10 # If this is present by itself on a line, this means that everyone can review.
(...skipping 26 matching lines...) Expand all
37 """Args: 37 """Args:
38 root: the path to the root of the Repository 38 root: the path to the root of the Repository
39 open: function callback to open a text file for reading 39 open: function callback to open a text file for reading
40 os_path: module/object callback with fields for 'abspath', 'dirname', 40 os_path: module/object callback with fields for 'abspath', 'dirname',
41 'exists', and 'join' 41 'exists', and 'join'
42 """ 42 """
43 self.root = root 43 self.root = root
44 self.fopen = fopen 44 self.fopen = fopen
45 self.os_path = os_path 45 self.os_path = os_path
46 46
47 # TODO: Figure out how to share the owners email addr format w/ 47 # Pick a default email regexp to use; callers can override as desired.
48 # tools/commit-queue/projects.py, especially for per-repo whitelists.
49 self.email_regexp = re.compile(BASIC_EMAIL_REGEXP) 48 self.email_regexp = re.compile(BASIC_EMAIL_REGEXP)
50 49
51 # Mapping of owners to the paths they own. 50 # Mapping of owners to the paths they own.
52 self.owned_by = {EVERYONE: set()} 51 self.owned_by = {EVERYONE: set()}
53 52
54 # Mapping of paths to authorized owners. 53 # Mapping of paths to authorized owners.
55 self.owners_for = {} 54 self.owners_for = {}
56 55
57 # Set of paths that stop us from looking above them for owners. 56 # Set of paths that stop us from looking above them for owners.
58 # (This is implicitly true for the root directory). 57 # (This is implicitly true for the root directory).
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 # short combinations of owners. 154 # short combinations of owners.
156 every_owner = set() 155 every_owner = set()
157 for f in files: 156 for f in files:
158 dirname = self.os_path.dirname(f) 157 dirname = self.os_path.dirname(f)
159 while dirname in self.owners_for: 158 while dirname in self.owners_for:
160 every_owner |= self.owners_for[dirname] 159 every_owner |= self.owners_for[dirname]
161 if self._stop_looking(dirname): 160 if self._stop_looking(dirname):
162 break 161 break
163 dirname = self.os_path.dirname(dirname) 162 dirname = self.os_path.dirname(dirname)
164 return every_owner 163 return every_owner
OLDNEW
« no previous file with comments | « PRESUBMIT.py ('k') | presubmit_canned_checks.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698