evolve: update rebase usage to match 2.3
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Wed, 06 Jun 2012 01:06:11 +0200
changeset 255 9852b3ef7234
parent 254 3ff969da57ef
child 256 909a3a079daf
evolve: update rebase usage to match 2.3
hgext/evolve.py
--- a/hgext/evolve.py	Tue Jun 05 20:43:39 2012 +0200
+++ b/hgext/evolve.py	Wed Jun 06 01:06:11 2012 +0200
@@ -156,7 +156,14 @@
         assert orig.p2().rev() == node.nullrev, 'no support yet'
         destbookmarks = repo.nodebookmarks(dest.node())
         cmdutil.duplicatecopies(repo, orig.node(), dest.node())
-        rebase.rebasenode(repo, orig.node(), dest.node(), {node.nullrev: node.nullrev})
+        if rebase.rebasenode.func_code.co_argcount == 5:
+            # rebasenode collapse argument was introduced by
+            # d1afbf03e69a (2.3)
+            rebase.rebasenode(repo, orig.node(), dest.node(),
+                              {node.nullrev: node.nullrev}, False)
+        else:
+            rebase.rebasenode(repo, orig.node(), dest.node(),
+                              {node.nullrev: node.nullrev})
         nodenew = rebase.concludenode(repo, orig.node(), dest.node(), node.nullid)
         nodesrc = orig.node()
         repo.addobsolete(nodenew, nodesrc)