hgext/mq.py
changeset 5226 438ff951df70
parent 5180 5bbbd1f1d586
child 5248 5517aa5aafb0
child 5334 448eb46d4d84
--- a/hgext/mq.py	Mon Aug 27 01:44:35 2007 -0300
+++ b/hgext/mq.py	Mon Aug 27 01:44:35 2007 -0300
@@ -1490,6 +1490,11 @@
     Source patch repository is looked for in <src>/.hg/patches by
     default.  Use -p <url> to change.
     '''
+    def patchdir(repo):
+        url = repo.url()
+        if url.endswith('/'):
+            url = url[:-1]
+        return url + '/.hg/patches'
     cmdutil.setremoteconfig(ui, opts)
     if dest is None:
         dest = hg.defaultdest(source)
@@ -1511,10 +1516,8 @@
                       update=False,
                       stream=opts['uncompressed'])
     ui.note(_('cloning patch repo\n'))
-    spr, dpr = hg.clone(ui, opts['patches'] or (sr.url() + '/.hg/patches'),
-                        dr.url() + '/.hg/patches',
-                        pull=opts['pull'],
-                        update=not opts['noupdate'],
+    spr, dpr = hg.clone(ui, opts['patches'] or patchdir(sr), patchdir(dr),
+                        pull=opts['pull'], update=not opts['noupdate'],
                         stream=opts['uncompressed'])
     if dr.local():
         if qbase: