Change the "Missing OWNERS" presubmit check to only suggest owners for missing files.

Previously we would suggest owners for the whole CL, rather than just
the files currently missing owner approval.

R=maruel@chromium.org
BUG=130978

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@224183 0039d316-1c4b-4281-b951-d872f2087c98
experimental/szager/collated-output
dpranke@chromium.org 12 years ago
parent 2a08269234
commit 31b42c0192

@ -822,7 +822,7 @@ def CheckOwners(input_api, output_api, source_file_filter=None,
output('Missing %s for these files:\n %s' %
(needed, '\n '.join(sorted(missing_files))))]
if not input_api.is_committing:
suggested_owners = owners_db.reviewers_for(affected_files, owner_email)
suggested_owners = owners_db.reviewers_for(missing_files, owner_email)
output_list.append(output('Suggested OWNERS:\n %s' %
('\n '.join(suggested_owners or []))))
return output_list

@ -2494,7 +2494,7 @@ class CannedChecksUnittest(PresubmitTestsBase):
fake_db.files_not_covered_by(set(['foo/xyz.cc']),
people).AndReturn(uncovered_files)
if not is_committing and uncovered_files:
fake_db.reviewers_for(set(['foo/xyz.cc']),
fake_db.reviewers_for(set(['foo']),
change.author_email).AndReturn(change.author_email)
self.mox.ReplayAll()

Loading…
Cancel
Save