Improve parsing of committed hash to be more resilient.

TEST=Verified that if this code breaks, the presubmit checks fail.
BUG=none

Review URL: http://codereview.chromium.org/6079003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@71229 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/git_cl/git_cl.py b/git_cl/git_cl.py
index 46d178a..ac51470 100644
--- a/git_cl/git_cl.py
+++ b/git_cl/git_cl.py
@@ -1000,7 +1000,13 @@
     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()