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

Unified Diff: git_cl.py

Issue 523113003: Fail if retcode is not zero after push (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 6 years, 4 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 | no next file » | 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 573245f14fe2bd026db58c8b1a893f93d5de616d..7793c8cb0644a1e3d09e2f457bbdc25f94f788bc 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -2029,7 +2029,11 @@ def SendUpstream(parser, args, cmd):
if base_has_submodules:
RunGit(['branch', '-D', CHERRY_PICK_BRANCH])
- if retcode == 0 and pushed_to_pending:
+ if retcode != 0:
+ print 'Failed to push. If this persists, please file a bug.'
+ return retcode
+
+ if pushed_to_pending:
try:
revision = WaitForRealCommit(remote, revision, base_branch, branch)
# We set pushed_to_pending to False, since it made it all the way to the
@@ -2043,7 +2047,7 @@ def SendUpstream(parser, args, cmd):
if cmd == 'dcommit' and 'Committed r' in output:
revision = re.match(
'.*?\nCommitted r(\\d+)', output, re.DOTALL).group(1)
- elif cmd == 'land' and retcode == 0:
+ elif cmd == 'land':
match = (re.match(r'.*?([a-f0-9]{7,})\.\.([a-f0-9]{7,})$', l)
for l in output.splitlines(False))
match = filter(None, match)
@@ -2079,17 +2083,16 @@ def SendUpstream(parser, args, cmd):
cl.RpcServer().add_comment(cl.GetIssue(), comment)
cl.SetIssue(None)
- if pushed_to_pending and retcode == 0:
+ if pushed_to_pending:
_, branch = cl.FetchUpstreamTuple(cl.GetBranch())
print 'The commit is in the pending queue (%s).' % pending_ref
print (
'It will show up on %s in ~1 min, once it gets Cr-Commit-Position '
'footer.' % branch)
- if retcode == 0:
- hook = POSTUPSTREAM_HOOK_PATTERN % cmd
- if os.path.isfile(hook):
- RunCommand([hook, merge_base], error_ok=True)
+ hook = POSTUPSTREAM_HOOK_PATTERN % cmd
+ if os.path.isfile(hook):
+ RunCommand([hook, merge_base], error_ok=True)
return 0
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698