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

Unified Diff: owners_finder.py

Issue 2148153002: Fix per-file owners check for deleted files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Rebase! Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « owners.py ('k') | presubmit_support.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: owners_finder.py
diff --git a/owners_finder.py b/owners_finder.py
index a0d50304db7d0084e5205545338aa1f562222b16..baca18eeda74ffdda9c9a2cc0641d24d1a8168c4 100644
--- a/owners_finder.py
+++ b/owners_finder.py
@@ -23,7 +23,7 @@ class OwnersFinder(object):
indentation = 0
def __init__(self, files, local_root, author,
- fopen, os_path, glob,
+ fopen, os_path,
email_postfix='@chromium.org',
disable_color=False):
self.email_postfix = email_postfix
@@ -34,7 +34,7 @@ class OwnersFinder(object):
self.COLOR_GREY = ''
self.COLOR_RESET = ''
- self.db = owners_module.Database(local_root, fopen, os_path, glob)
+ self.db = owners_module.Database(local_root, fopen, os_path)
self.db.load_data_needed_for(files)
self.os_path = os_path
@@ -43,28 +43,15 @@ class OwnersFinder(object):
filtered_files = files
- # Eliminate files that author himself can review.
- if author:
- if author in self.db.owned_by:
- for dir_name in self.db.owned_by[author]:
- filtered_files = [
- file_name for file_name in filtered_files
- if not file_name.startswith(dir_name)]
-
- filtered_files = list(filtered_files)
-
- # Eliminate files that everyone can review.
- if owners_module.EVERYONE in self.db.owned_by:
- for dir_name in self.db.owned_by[owners_module.EVERYONE]:
- filtered_files = filter(
- lambda file_name: not file_name.startswith(dir_name),
- filtered_files)
+ # Eliminate files that the author can review.
+ filtered_files = list(self.db.files_not_covered_by(
+ filtered_files, [author] if author else []))
# If some files are eliminated.
if len(filtered_files) != len(files):
files = filtered_files
# Reload the database.
- self.db = owners_module.Database(local_root, fopen, os_path, glob)
+ self.db = owners_module.Database(local_root, fopen, os_path)
self.db.load_data_needed_for(files)
self.all_possible_owners = self.db.all_possible_owners(files, None)
« no previous file with comments | « owners.py ('k') | presubmit_support.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698