Bug 1305522 - Vendor latest version of robustcheckout; r=me
authorGregory Szorc <gps@mozilla.com>
Tue, 27 Sep 2016 16:59:13 -0700
changeset 315382 4ab108caec1eb612793f17f657fc08dc9a694719
parent 315381 c3d6cc14a14807c08fed16c0dfdad4277bc7f953
child 315383 9b6a4552a5c23c75a3996d11b6349f3e485b3b1c
push id30748
push usercbook@mozilla.com
push dateWed, 28 Sep 2016 13:53:19 +0000
treeherdermozilla-central@8c84b7618840 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1305522
milestone52.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 1305522 - Vendor latest version of robustcheckout; r=me From changeset 872711d144202b3f95e090a95f45cc1c45831caf from the version-control-tools repo. File added without modifications. Upstream change was peer reviewed.
testing/mozharness/external_tools/robustcheckout.py
--- a/testing/mozharness/external_tools/robustcheckout.py
+++ b/testing/mozharness/external_tools/robustcheckout.py
@@ -25,17 +25,17 @@ from mercurial import (
     exchange,
     extensions,
     cmdutil,
     hg,
     scmutil,
     util,
 )
 
-testedwith = '3.5 3.6 3.7 3.8'
+testedwith = '3.6 3.7 3.8 3.9'
 minimumhgversion = '3.7'
 
 cmdtable = {}
 command = cmdutil.command(cmdtable)
 
 
 if os.name == 'nt':
     import ctypes
@@ -261,16 +261,17 @@ def _docheckout(ui, url, dest, upstream,
                                    'SHA-1 fragment')
 
         checkoutrevision = ctx.hex()
         havewantedrev = True
 
     if not havewantedrev:
         ui.write('(pulling to obtain %s)\n' % (revision or branch,))
 
+        remote = None
         try:
             remote = hg.peer(repo, {}, url)
             pullrevs = [remote.lookup(revision or branch)]
             checkoutrevision = hex(pullrevs[0])
             if branch:
                 ui.warn('(remote resolved %s to %s; '
                         'result is not deterministic)\n' %
                         (branch, checkoutrevision))
@@ -290,17 +291,18 @@ def _docheckout(ui, url, dest, upstream,
             raise
         except error.RepoError as e:
             return handlerepoerror(e)
         except error.RevlogError as e:
             ui.warn('(repo corruption: %s; deleting shared store)\n' % e.message)
             deletesharedstore()
             return callself()
         finally:
-            remote.close()
+            if remote:
+                remote.close()
 
     # Now we should have the wanted revision in the store. Perform
     # working directory manipulation.
 
     # Purge if requested. We purge before update because this way we're
     # guaranteed to not have conflicts on `hg update`.
     if purge and not created:
         ui.write('(purging working directory)\n')