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

Unified Diff: git_cl.py

Issue 130803004: Indiciate the tree status in the rietveld message when bypassing hooks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: updates Created 6 years, 11 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
« gcl.py ('K') | « gcl.py ('k') | tests/gcl_unittest.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 2bf1b9811ef670bf948c815515f30a39a7c12472..4acbed58195d58d163aa291b8aa703d6c7a98440 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -1750,8 +1750,8 @@ def SendUpstream(parser, args, cmd):
else:
breakpad.SendStack(
'GitClHooksBypassedCommit',
- 'Issue %s/%s bypassed hook when committing' %
- (cl.GetRietveldServer(), cl.GetIssue()),
+ 'Issue %s/%s bypassed hook when committing (tree status was "%s")' %
+ (cl.GetRietveldServer(), cl.GetIssue(), GetTreeStatus()),
verbose=False)
change_desc = ChangeDescription(options.message)
@@ -1871,7 +1871,10 @@ def SendUpstream(parser, args, cmd):
props = cl.GetIssueProperties()
patch_num = len(props['patchsets'])
comment = "Committed patchset #%d manually as r%s" % (patch_num, revision)
- comment += ' (presubmit successful).' if not options.bypass_hooks else '.'
+ if options.bypass_hooks:
+ comment += ' (tree was closed).' if GetTreeStatus() == 'closed' else '.'
+ else:
+ comment += ' (presubmit successful).'
cl.RpcServer().add_comment(cl.GetIssue(), comment)
cl.SetIssue(None)
@@ -2023,10 +2026,10 @@ def CMDrebase(parser, args):
return subprocess2.call(['git', 'svn', 'rebase'] + args, env=env)
-def GetTreeStatus():
+def GetTreeStatus(url=None):
"""Fetches the tree status and returns either 'open', 'closed',
'unknown' or 'unset'."""
- url = settings.GetTreeStatusUrl(error_ok=True)
+ url = url or settings.GetTreeStatusUrl(error_ok=True)
if url:
status = urllib2.urlopen(url).read().lower()
if status.find('closed') != -1 or status == '0':
« gcl.py ('K') | « gcl.py ('k') | tests/gcl_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698