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

Unified Diff: git_cl/git_cl.py

Issue 6079003: Improve parsing of committed hash to be more resilient. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/git_cl
Patch Set: Address review comments Created 9 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
« 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/git_cl.py
diff --git a/git_cl/git_cl.py b/git_cl/git_cl.py
index 46d178a3dbdc94f5eb62fd44129d84c27c794c61..ac51470d0cd2daae1ea4e13089a6e523f0def1a6 100644
--- a/git_cl/git_cl.py
+++ b/git_cl/git_cl.py
@@ -1000,7 +1000,13 @@ 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 == 'push' and retcode == 0:
- revision = output.splitlines()[1].split('\t')[2].split('..')[1]
+ match = (re.match(r'.*?([a-f0-9]{7})\.\.([a-f0-9]{7})$', l)
+ for l in output.splitlines(False))
+ match = filter(None, match)
+ if len(match) != 1:
+ DieWithError("Couldn't parse ouput to extract the committed hash:\n%s" %
+ output)
+ revision = match[0].group(2)
else:
return 1
viewvc_url = settings.GetViewVCUrl()
« 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