Bug 748158 - Strip trailing slashes from repository urls before passing them to hgtool.py (in client.py). r=Callek,a=Standard8
authorMark Banner <bugzilla@standard8.plus.com>
Tue, 24 Apr 2012 07:53:47 +0100
changeset 11261 715e865456c2c013d6d336ded90846ec4b31bab2
parent 11260 6bf9e01901a60cdc22401c822bda44b3404db0e8
child 11262 8a041705c46a7595a620d86a0139fdf817ab4d6a
push idunknown
push userunknown
push dateunknown
reviewersCallek, Standard8
bugs748158
Bug 748158 - Strip trailing slashes from repository urls before passing them to hgtool.py (in client.py). r=Callek,a=Standard8
client.py
--- a/client.py
+++ b/client.py
@@ -314,27 +314,31 @@ 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 + [repository, fulldir], retryMax=options.retries)
+        check_call_noisy(['python'] + hgtoolcmd + [repo, fulldir], retryMax=options.retries)
     elif not os.path.exists(fulldir):
         fulldir = os.path.join(topsrcdir, dir)
-        check_call_noisy([hg, 'clone'] + hgcloneopts + hgopts + [repository, fulldir],
+        check_call_noisy([hg, 'clone'] + hgcloneopts + hgopts + [repo, fulldir],
                          retryMax=options.retries)
     else:
         cmd = [hg, 'pull', '-R', fulldir] + hgopts
-        if repository is not None:
-            cmd.append(repository)
+        if repo is not None:
+            cmd.append(repo)
         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.