Print clarifying message when no new owners needed

If a CL already has owners on the reviewer list that cover all of the
files - regardless of whether they have approved the change - git cl
owners just prints ** You selected these owners **, which can be
confusing. This change adds an explanation in the no-unowned-files case
and suggests using --ignore-current if more reviewers are wanted.

Bug: 1071967
Change-Id: If60455c5ec15006e09feed39633fa62e3ddf0a04
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2183222
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
changes/22/2183222/2
Bruce Dawson 5 years ago committed by LUCI CQ
parent 97ed44ada9
commit 9b4a0570e5

@ -334,14 +334,19 @@ class OwnersFinder(object):
# Print results # Print results
self.writeln() self.writeln()
self.writeln() self.writeln()
self.writeln('** You selected these owners **') if len(self.selected_owners) == 0:
self.writeln() self.writeln('This change list already has owner-reviewers for all '
for owner in self.selected_owners: 'files.')
self.writeln(self.bold_name(owner) + ':') self.writeln('Use --ignore-current if you want to ignore them.')
self.indent() else:
for file_name in sorted(self.owners_to_files[owner]): self.writeln('** You selected these owners **')
self.writeln(file_name) self.writeln()
self.unindent() for owner in self.selected_owners:
self.writeln(self.bold_name(owner) + ':')
self.indent()
for file_name in sorted(self.owners_to_files[owner]):
self.writeln(file_name)
self.unindent()
def bold(self, text): def bold(self, text):
return self.COLOR_BOLD + text + self.COLOR_RESET return self.COLOR_BOLD + text + self.COLOR_RESET

Loading…
Cancel
Save