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

Unified Diff: git_cl.py

Issue 949273002: Add ability to specify and run post upload hooks (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Call specific post upload hooks first Created 5 years, 10 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_support.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 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
« no previous file with comments | « no previous file | presubmit_support.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698