Bug 748158 - Strip trailing slashes from repository urls before passing them to hgtool.py (in client.py). r=Callek
authorMark Banner <bugzilla@standard8.plus.com>
Tue, 24 Apr 2012 07:53:47 +0100
changeset 11716 9b83555adeb2daf130476db5ba4f1cb72fa78e36
parent 11715 33e93567f9f3f7d43fc8e9553d8a28d22d95ea67
child 11717 fbc7135f80a7d1672bf6a5dd40d2f89b6fd97b89
push id529
push userbugzilla@standard8.plus.com
push dateMon, 04 Jun 2012 19:55:55 +0000
treeherdercomm-beta@109334822255 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersCallek
bugs748158
Bug 748158 - Strip trailing slashes from repository urls before passing them to hgtool.py (in client.py). r=Callek
client.py
--- a/client.py
+++ b/client.py
@@ -311,27 +311,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.