Bug 1203796 - Remove the trychooser syntax commit if pushing to the try server fails; r=chmanchester
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 10 Sep 2015 21:04:55 -0400
changeset 296206 4c42d55c2455b134fbc72ad19a1036804a6f53d0
parent 296205 0f88a6861417daaf397c2b4714a8ebdfe6379e2c
child 296207 6bc0228c2d3d4b0520b3d8b2dbc1c128446bf3c4
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschmanchester
bugs1203796
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1203796 - Remove the trychooser syntax commit if pushing to the try server fails; r=chmanchester
testing/tools/autotry/autotry.py
--- a/testing/tools/autotry/autotry.py
+++ b/testing/tools/autotry/autotry.py
@@ -94,19 +94,21 @@ class AutoTry(object):
         ret = subprocess.call(args)
         if ret:
             print('ERROR git command %s returned %s' %
                   (args, ret))
             sys.exit(1)
 
     def _git_push_to_try(self, msg):
         self._run_git('commit', '--allow-empty', '-m', msg)
-        self._run_git('push', 'hg::ssh://hg.mozilla.org/try',
-                      '+HEAD:refs/heads/branches/default/tip')
-        self._run_git('reset', 'HEAD~')
+        try:
+            self._run_git('push', 'hg::ssh://hg.mozilla.org/try',
+                          '+HEAD:refs/heads/branches/default/tip')
+        finally:
+            self._run_git('reset', 'HEAD~')
 
     def push_to_try(self, msg, verbose):
         if not self._use_git:
             try:
                 hg_args = ['hg', 'push-to-try', '-m', msg]
                 subprocess.check_call(hg_args, stderr=subprocess.STDOUT)
             except subprocess.CalledProcessError as e:
                 print('ERROR hg command %s returned %s' % (hg_args, e.returncode))