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. |