changeset 255:9852b3ef7234

evolve: update rebase usage to match 2.3
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Wed, 06 Jun 2012 01:06:11 +0200
parents 3ff969da57ef
children 909a3a079daf
files hgext/evolve.py
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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)