Index: git_cl.py |
diff --git a/git_cl.py b/git_cl.py |
index 0acb9cd59ba2f67a73dc357a21e5ef0d2f851b14..b30776ca99e04d84e5dd9f49d709c2ad664bdea0 100755 |
--- a/git_cl.py |
+++ b/git_cl.py |
@@ -1315,7 +1315,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' |
@@ -1499,6 +1500,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() |
@@ -2105,6 +2110,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. |