mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
Add a --ignore-self parameter to "git cl owners"
Sometimes CL author is also listed as OWNERS but want to find a co-owner to review CL. Currently "git cl owners" is unhelpful as it consider the author's ownership as enough. Add a --ignore-self parameter to "git cl owners" that will cause the tool to ignore author's ownership when looking for a reviewer. Bug: none Change-Id: Iba110a465a552cd6befb46c77b2e65f60b663a13 Reviewed-on: https://chromium-review.googlesource.com/c/1459625 Reviewed-by: Dirk Pranke <dpranke@chromium.org> Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
This commit is contained in:
committed by
Commit Bot
parent
70ce8736cb
commit
b1f865dac5
@@ -26,7 +26,8 @@ class OwnersFinder(object):
|
||||
fopen, os_path,
|
||||
email_postfix='@chromium.org',
|
||||
disable_color=False,
|
||||
override_files=None):
|
||||
override_files=None,
|
||||
ignore_author=False):
|
||||
self.email_postfix = email_postfix
|
||||
|
||||
if os.name == 'nt' or disable_color:
|
||||
@@ -46,7 +47,7 @@ class OwnersFinder(object):
|
||||
filtered_files = files
|
||||
|
||||
reviewers = list(reviewers)
|
||||
if author:
|
||||
if author and not ignore_author:
|
||||
reviewers.append(author)
|
||||
|
||||
# Eliminate files that existing reviewers can review.
|
||||
@@ -62,6 +63,8 @@ class OwnersFinder(object):
|
||||
self.db.load_data_needed_for(files)
|
||||
|
||||
self.all_possible_owners = self.db.all_possible_owners(files, None)
|
||||
if author and author in self.all_possible_owners:
|
||||
del self.all_possible_owners[author]
|
||||
|
||||
self.owners_to_files = {}
|
||||
self._map_owners_to_files(files)
|
||||
|
||||
Reference in New Issue
Block a user