autoland: don't reference an undefined variable in the error case (Bug 1294729). r?glob draft
authorSteven MacLeod <smacleod@mozilla.com>
Fri, 12 Aug 2016 11:46:29 -0400
changeset 9151 5d0638a944a2e4185cf3ffa3593cb6c60af88762
parent 9144 610a71840c81a32090c14201e55c1ad62293a68f
child 9152 a70a415d1bdd7c48150395fd8fc9ec07c6d25856
push id1095
push usersmacleod@mozilla.com
push dateFri, 12 Aug 2016 15:53:46 +0000
reviewersglob
bugs1294729
autoland: don't reference an undefined variable in the error case (Bug 1294729). r?glob cmd_output was being referenced in the exception handler, but when run_hg() would fail it is never assigned. This was causing autoland to repeatedly loop on a single changeset due to how it would handle this unexpected exception. We should no longer get stuck on a single revision when the related invocation of run_hg() fails. MozReview-Commit-ID: 5m3aoRMtKA5
autoland/autoland/transplant.py
--- a/autoland/autoland/transplant.py
+++ b/autoland/autoland/transplant.py
@@ -101,17 +101,17 @@ def _transplant(logger, client, tree, de
             json.dump(commit_descriptions, f)
             f.flush()
 
             try:
                 cmd = ['rewritecommitdescriptions',
                        '--descriptions=%s' % f.name, rev]
                 cmd_output = run_hg(cmd)
             except hglib.error.CommandError as e:
-                return False, formulate_hg_error(['hg'] + cmd, cmd_output)
+                return False, formulate_hg_error(['hg'] + cmd, e.out.getvalue())
 
         for line in cmd_output.splitlines():
             m = re.search(r'^rev: [0-9a-z]+ -> ([0-9a-z]+)', line)
             if m and m.groups():
                 base_revision = m.groups()[0]
                 break
 
         if not base_revision: