Commit c3c15a1f authored by Edward Lesmes's avatar Edward Lesmes Committed by LUCI CQ

owners_finder: Don't print comments for owners

This feature will not be supported when using Gerrit
Code-Owners plugin.

Change-Id: I7ad0d5bf004ba39818e57fc00e40592a44d1d11f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2638140
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: 's avatarGavin Mak <gavinmak@google.com>
parent 0489cc12
......@@ -82,7 +82,6 @@ class OwnersFinder(object):
self.all_possible_owners, files)
self.original_files_to_owners = copy.deepcopy(self.files_to_owners)
self.comments = self.db.comments
# This is the queue that will be shown in the interactive questions.
# It is initially sorted by the score in descending order. In the
......@@ -220,30 +219,6 @@ class OwnersFinder(object):
continues = True
break
def print_comments(self, owner):
if owner not in self.comments:
self.writeln(self.bold_name(owner))
else:
self.writeln(self.bold_name(owner) + ' is commented as:')
self.indent()
if owners_module.GLOBAL_STATUS in self.comments[owner]:
self.writeln(
self.greyed(self.comments[owner][owners_module.GLOBAL_STATUS]) +
' (global status)')
if len(self.comments[owner]) == 1:
self.unindent()
return
for path in self.comments[owner]:
if path == owners_module.GLOBAL_STATUS:
continue
elif len(self.comments[owner][path]) > 0:
self.writeln(self.greyed(self.comments[owner][path]) +
' (at ' + self.bold(path or '<root>') + ')')
else:
self.writeln(self.greyed('[No comment] ') + ' (at ' +
self.bold(path or '<root>') + ')')
self.unindent()
def print_file_info(self, file_name, except_owner=''):
if file_name not in self.unreviewed_files:
self.writeln(self.greyed(file_name +
......@@ -277,7 +252,7 @@ class OwnersFinder(object):
def print_owned_files_for(self, owner):
# Print owned files
self.print_comments(owner)
self.writeln(self.bold_name(owner))
self.writeln(self.bold_name(owner) + ' owns ' +
str(len(self.owners_to_files[owner])) + ' file(s):')
self.indent()
......@@ -291,7 +266,7 @@ class OwnersFinder(object):
len(self.selected_owners)) > 3:
for ow in owners_queue:
if ow not in self.deselected_owners and ow not in self.selected_owners:
self.print_comments(ow)
self.writeln(self.bold_name(ow))
else:
for ow in owners_queue:
if ow not in self.deselected_owners and ow not in self.selected_owners:
......
......@@ -272,23 +272,6 @@ class OwnersFinderTests(_BaseTestCase):
['chrome/renderer/gpu/gpu_channel_host.h',
[ben, brett, ken, peter, tom]])
def test_print_comments(self):
finder = self.defaultFinder()
finder.print_comments(darin)
self.assertEqual(finder.output,
[darin + ' is commented as:', ['foo (at content)']])
def test_print_global_comments(self):
finder = self.ownersFinder(['content/common/common.cc'])
finder.print_comments(jochen)
self.assertEqual(finder.output,
[jochen + ' is commented as:', ['bar (global status)']])
finder = self.ownersFinder(['content/foo/foo.cc'])
finder.print_comments(jochen)
self.assertEqual(finder.output,
[jochen + ' is commented as:', ['bar (global status)',
'foo (at content/foo)']])
if __name__ == '__main__':
unittest.main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment