diff hgsubversion/util.py @ 1040:ada2400241c4

fixes for running under Mercurial 2.0
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Mon, 05 Aug 2013 20:27:31 +0200
parents 3df6ed4e7561
children 67e11b650e94
line wrap: on
line diff
--- a/hgsubversion/util.py
+++ b/hgsubversion/util.py
@@ -8,6 +8,7 @@ from mercurial import cmdutil
 from mercurial import error
 from mercurial import hg
 from mercurial import node
+from mercurial import repair
 from mercurial import util as hgutil
 
 try:
@@ -84,6 +85,14 @@ def islocalrepo(url):
         path = path.rsplit('/', 1)[0]
     return False
 
+def strip(ui, repo, changesets, *args , **opts):
+    try:
+        repair.strip(ui, repo, changesets, *args, **opts)
+    except TypeError:
+        # only 2.1.2 and later allow strip to take a list of nodes
+        for changeset in changesets:
+            repair.strip(ui, repo, changeset, *args, **opts)
+
 
 def version(ui):
     """Return version information if available."""