Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Unified Diff: git_cl.py

Issue 1927773002: Reland Implement owners check in presubmit for Gerrit. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@P300
Patch Set: gerrit fix Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | presubmit_canned_checks.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
diff --git a/git_cl.py b/git_cl.py
index 9bf60ea29f60e404dc7465255c80b84159deae58..bf949133c959efd8552fd8fe1752b34f55a88aaf 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -1317,7 +1317,8 @@ class Changelist(object):
return presubmit_support.DoPresubmitChecks(change, committing,
verbose=verbose, output_stream=sys.stdout, input_stream=sys.stdin,
default_presubmit=None, may_prompt=may_prompt,
- rietveld_obj=self._codereview_impl.GetRieveldObjForPresubmit())
+ rietveld_obj=self._codereview_impl.GetRieveldObjForPresubmit(),
+ gerrit_obj=self._codereview_impl.GetGerritObjForPresubmit())
except presubmit_support.PresubmitFailure, e:
DieWithError(
('%s\nMaybe your depot_tools is out of date?\n'
@@ -1501,6 +1502,10 @@ class _ChangelistCodereviewBase(object):
# For non-Rietveld codereviews, this probably should return a dummy object.
raise NotImplementedError()
+ def GetGerritObjForPresubmit(self):
+ # None is valid return value, otherwise presubmit_support.GerritAccessor.
+ return None
+
def UpdateDescriptionRemote(self, description):
"""Update the description on codereview site."""
raise NotImplementedError()
@@ -2107,6 +2112,9 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase):
raise NotImplementedError()
return ThisIsNotRietveldIssue()
+ def GetGerritObjForPresubmit(self):
+ return presubmit_support.GerritAccessor(self._GetGerritHost())
+
def GetStatus(self):
"""Apply a rough heuristic to give a simple summary of an issue's review
or CQ status, assuming adherence to a common workflow.
« no previous file with comments | « no previous file | presubmit_canned_checks.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698