Commit 9d66f480 authored by dpranke@chromium.org's avatar dpranke@chromium.org

handle OWNERS suggestions where anyone can approve better.

previously we would return "*" as one of the suggested owners when
a CL included a file that anyone could approve. If the change had
other owners, the "*" was unnecessary, and if the change only included
wildcard-owned files, "*" isn't very helpful, so I've changed the text slightly.

R=maruel@chromium.org
BUG=169168


Review URL: https://chromiumcodereview.appspot.com/11867016

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@177575 0039d316-1c4b-4281-b951-d872f2087c98
parent 78d11342
......@@ -121,7 +121,13 @@ class Database(object):
files is a sequence of paths relative to (and under) self.root."""
self._check_paths(files)
self._load_data_needed_for(files)
return self._covering_set_of_owners_for(files)
suggested_owners = self._covering_set_of_owners_for(files)
if EVERYONE in suggested_owners:
if len(suggested_owners) > 1:
suggested_owners.remove(EVERYONE)
else:
suggested_owners = set(['<anyone>'])
return suggested_owners
# TODO(dpranke): rename to objects_not_covered_by
def directories_not_covered_by(self, files, reviewers):
......
......@@ -259,7 +259,8 @@ class ReviewersForTest(_BaseTestCase):
self.assertRaises(AssertionError, db.reviewers_for, ['/OWNERS'])
def test_reviewers_for__wildcard_dir(self):
self.assert_reviewers_for(['DEPS'], [owners.EVERYONE])
self.assert_reviewers_for(['DEPS'], ['<anyone>'])
self.assert_reviewers_for(['DEPS', 'chrome/gpu/gpu_channel.h'], [ken])
def test_reviewers_for__one_owner(self):
self.assert_reviewers_for([
......
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