From bbe9cc5aa8a273f1807a99af625daede80722207 Mon Sep 17 00:00:00 2001 From: "iannucci@chromium.org" Date: Fri, 5 Sep 2014 18:25:51 +0000 Subject: [PATCH] Return 1 from git_cl land when you Ctrl-C it in the middle. R=agable@chromium.org, mmoss@chromium.org BUG= Review URL: https://codereview.chromium.org/549513002 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@291823 0039d316-1c4b-4281-b951-d872f2087c98 --- git_cl.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/git_cl.py b/git_cl.py index b8263b550..0185c38d4 100755 --- a/git_cl.py +++ b/git_cl.py @@ -2052,6 +2052,7 @@ def SendUpstream(parser, args, cmd): print 'Failed to push. If this persists, please file a bug.' return 1 + killed = False if pushed_to_pending: try: revision = WaitForRealCommit(remote, revision, base_branch, branch) @@ -2059,7 +2060,7 @@ def SendUpstream(parser, args, cmd): # real ref. pushed_to_pending = False except KeyboardInterrupt: - pass + killed = True if cl.GetIssue(): to_pending = ' to pending queue' if pushed_to_pending else '' @@ -2096,7 +2097,7 @@ def SendUpstream(parser, args, cmd): if os.path.isfile(hook): RunCommand([hook, merge_base], error_ok=True) - return 0 + return 1 if killed else 0 def WaitForRealCommit(remote, pushed_commit, local_base_ref, real_ref):