evolve: use `merge.graft` instead of `rebasenode` stable
authorPierre-Yves David <pierre-yves.david@fb.com>
Sat, 13 Dec 2014 17:47:09 -0800
branchstable
changeset 1183 58370c718183
parent 1182 15492cea54e9
child 1184 bc601c010185
evolve: use `merge.graft` instead of `rebasenode` The core mechanism is properly factorised and have a more stable API. This is also a good step toward removing the dependency between evolve and the rebase extension. This also avoid a breakage with the future 3.3 where some of the rebase API changed.
hgext/evolve.py
--- a/hgext/evolve.py	Mon Dec 08 12:45:32 2014 -0800
+++ b/hgext/evolve.py	Sat Dec 13 17:47:09 2014 -0800
@@ -806,9 +806,10 @@
     tr = repo.transaction('relocate')
     try:
         try:
-            r = rebase.rebasenode(repo, orig.node(), dest.node(),
-                                  {node.nullrev: node.nullrev}, False,
-                                  orig.p1().node())
+            if repo['.'].rev() != dest.rev():
+                merge.update(repo, dest, False, True, False)
+            r = merge.graft(repo, orig, orig.p1(),
+                                   ['local', 'graft'])
             if r[-1]: #some conflict
                 raise util.Abort(
                         'unresolved merge conflicts (see hg help resolve)')