diff hgsubversion/wrappers.py @ 816:86d124a8768e

Fix hg.clone() calls changed by d976542986d2
author Patrick Mezard <pmezard@gmail.com>
date Wed, 15 Jun 2011 14:44:14 +0200
parents 800d293f907d
children e30ff6d5feff
line wrap: on
line diff
--- a/hgsubversion/wrappers.py
+++ b/hgsubversion/wrappers.py
@@ -449,7 +449,13 @@ def clone(orig, ui, source, dest=None, *
     """
 
     data = {}
-    def hgclonewrapper(orig, ui, origsource, dest, **opts):
+    def hgclonewrapper(orig, ui, *args, **opts):
+        if getattr(hg, 'peer', None):
+            # Since 1.9 (d976542986d2)
+            origsource = args[1]
+        else:
+            origsource = args[0]
+
         if isinstance(origsource, str):
             source, branch, checkout = util.parseurl(ui.expandpath(origsource),
                                          opts.get('branch'))
@@ -463,7 +469,7 @@ def clone(orig, ui, source, dest=None, *
                 data['branches'] = branches
                 ui.setconfig('hgsubversion', 'branch', branches[-1])
 
-        data['srcrepo'], data['dstrepo'] = orig(ui, origsource, dest, **opts)
+        data['srcrepo'], data['dstrepo'] = orig(ui, *args, **opts)
 
     for opt, (section, name) in optionmap.iteritems():
         if opt in opts and opts[opt]: