diff hgext/evolve.py @ 1131:a44a26f8cc48

evolve: adapt to change in core rebase Mercurial core changeset 63e889cc610d (And the ones around it) changed the way graft and rebase work. We adapt to them.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 16 Oct 2014 04:38:37 -0700
parents da565c825429
children 7a1784a1c642
line wrap: on
line diff
--- a/hgext/evolve.py	Thu Oct 16 14:06:52 2014 -0700
+++ b/hgext/evolve.py	Thu Oct 16 04:38:37 2014 -0700
@@ -806,14 +806,20 @@
     try:
         try:
             r = rebase.rebasenode(repo, orig.node(), dest.node(),
-                                  {node.nullrev: node.nullrev}, False)
+                                  {node.nullrev: node.nullrev}, False,
+                                  orig.p1().node())
             if r[-1]: #some conflict
                 raise util.Abort(
                         'unresolved merge conflicts (see hg help resolve)')
-            cmdutil.duplicatecopies(repo, orig.node(), dest.node())
             nodenew = rebase.concludenode(repo, orig.node(), dest.node(),
                                           node.nullid, commitmsg)
         except util.Abort, exc:
+            repo.dirstate.beginparentchange()
+            repo.setparents(repo['.'].node(), nullid)
+            repo.dirstate.write()
+            # fix up dirstate for copies and renames
+            copies.duplicatecopies(repo, dest.rev(), orig.p1().rev())
+            repo.dirstate.endparentchange()
             class LocalMergeFailure(MergeFailure, exc.__class__):
                 pass
             exc.__class__ = LocalMergeFailure