Index: git_cl.py |
diff --git a/git_cl.py b/git_cl.py |
index 1b375e856ca190fa4c7217cdfb30316f5c37a088..73c221f457619aa719f59aadfd5ca8ec15efbaab 100755 |
--- a/git_cl.py |
+++ b/git_cl.py |
@@ -431,6 +431,11 @@ class Settings(object): |
def GetBugPrefix(self): |
return self._GetRietveldConfig('bug-prefix', error_ok=True) |
+ def GetRunPostUploadHook(self): |
+ run_post_upload_hook = self._GetRietveldConfig( |
+ 'run-post-upload-hook', error_ok=True) |
+ return run_post_upload_hook == "True" |
+ |
def GetDefaultCCList(self): |
return self._GetRietveldConfig('cc', error_ok=True) |
@@ -1028,6 +1033,8 @@ def GetCodereviewSettingsInteractively(): |
'tree-status-url', False) |
SetProperty(settings.GetViewVCUrl(), 'ViewVC URL', 'viewvc-url', True) |
SetProperty(settings.GetBugPrefix(), 'Bug Prefix', 'bug-prefix', False) |
+ SetProperty(settings.GetRunPostUploadHook(), 'Run Post Upload Hook', |
+ 'run-post-upload-hook', False) |
# TODO: configure a default branch to diff against, rather than this |
# svn-based hackery. |
@@ -1210,6 +1217,8 @@ def LoadCodereviewSettingsFromFile(fileobj): |
SetProperty('cpplint-ignore-regex', 'LINT_IGNORE_REGEX', unset_error_ok=True) |
SetProperty('project', 'PROJECT', unset_error_ok=True) |
SetProperty('pending-ref-prefix', 'PENDING_REF_PREFIX', unset_error_ok=True) |
+ SetProperty('run-post-upload-hook', 'RUN_POST_UPLOAD_HOOK', |
+ unset_error_ok=True) |
if 'GERRIT_HOST' in keyvals: |
RunGit(['config', 'gerrit.host', keyvals['GERRIT_HOST']]) |
@@ -2035,6 +2044,14 @@ def CMDupload(parser, args): |
if not ret: |
git_set_branch_value('last-upload-hash', |
RunGit(['rev-parse', 'HEAD']).strip()) |
+ # Run post upload hooks, if specified. |
+ if settings.GetRunPostUploadHook(): |
+ presubmit_support.DoPostUploadExecuter( |
+ change, |
+ cl, |
+ settings.GetRoot(), |
+ options.verbose, |
+ sys.stdout) |
return ret |