Fix client.py bustage from bug 748158 - I had forgotten to fully take account of repository being None. rs=Callek
authorMark Banner <bugzilla@standard8.plus.com>
Tue, 24 Apr 2012 08:34:38 +0100
changeset 11717 fbc7135f80a7d1672bf6a5dd40d2f89b6fd97b89
parent 11716 9b83555adeb2daf130476db5ba4f1cb72fa78e36
child 11718 e46f87c271f14a7d03feebe02ac03f87313c543c
push idunknown
push userunknown
push dateunknown
reviewersCallek
bugs748158
Fix client.py bustage from bug 748158 - I had forgotten to fully take account of repository being None. rs=Callek
client.py
--- a/client.py
+++ b/client.py
@@ -311,31 +311,29 @@ def do_hg_pull(dir, repository, hg, rev,
     hgcloneopts = []
     if options.hgcloneopts:
         hgcloneopts = options.hgcloneopts.split()
 
     hgopts = []
     if options.hgopts:
         hgopts = options.hgopts.split()
 
-    # We need to strip the trailing slash from the repository url so that the hg tool gets a
-    # url that's consistent with the rest of the build automation.
-    repo = repository.rstrip('/')
-
     if hgtool:
         hgtoolcmd = hgtool.split()
-        check_call_noisy(['python'] + hgtoolcmd + [repo, fulldir], retryMax=options.retries)
+        # We need to strip the trailing slash from the repository url so that the hg tool gets a
+        # url that's consistent with the rest of the build automation.
+        check_call_noisy(['python'] + hgtoolcmd + [repository.rstrip('/'), fulldir], retryMax=options.retries)
     elif not os.path.exists(fulldir):
         fulldir = os.path.join(topsrcdir, dir)
-        check_call_noisy([hg, 'clone'] + hgcloneopts + hgopts + [repo, fulldir],
+        check_call_noisy([hg, 'clone'] + hgcloneopts + hgopts + [repository, fulldir],
                          retryMax=options.retries)
     else:
         cmd = [hg, 'pull', '-R', fulldir] + hgopts
-        if repo is not None:
-            cmd.append(repo)
+        if repository is not None:
+            cmd.append(repository)
         check_call_noisy(cmd, retryMax=options.retries)
 
     # update to specific revision
     cmd = [hg, 'update', '-r', rev, '-R', fulldir ] + hgopts
     if options.verbose:
         cmd.append('-v')
     # Explicitly never retry 'hg update': otherwise any merge failures are ignored.
     # This command is local: a failure can't be caused by a network error.