diff hgext/rebase.py @ 34787:754b5117622f

context: add workingfilectx.markcopied With in-memory merge, copy information needs to be stored in-memory, not in the dirstate. To make this transition easy, move the existing dirstate-based approach to workingfilectx; that way, other implementations can choose to store it somewhere else. Differential Revision: https://phab.mercurial-scm.org/D1106
author Phil Cohen <phillco@fb.com>
date Sun, 15 Oct 2017 20:36:29 -0700
parents 93fcd65e459f
children 44c4ed4ad032
line wrap: on
line diff
--- a/hgext/rebase.py	Sun Oct 15 20:36:29 2017 -0700
+++ b/hgext/rebase.py	Sun Oct 15 20:36:29 2017 -0700
@@ -977,10 +977,11 @@
         repo.ui.debug("   detach base %d:%s\n" % (base, repo[base]))
     # When collapsing in-place, the parent is the common ancestor, we
     # have to allow merging with it.
+    wctx = repo[None]
     stats = mergemod.update(repo, rev, True, True, base, collapse,
                             labels=['dest', 'source'])
     if collapse:
-        copies.duplicatecopies(repo, rev, dest)
+        copies.duplicatecopies(repo, wctx, rev, dest)
     else:
         # If we're not using --collapse, we need to
         # duplicate copies between the revision we're
@@ -988,7 +989,7 @@
         # duplicate any copies that have already been
         # performed in the destination.
         p1rev = repo[rev].p1().rev()
-        copies.duplicatecopies(repo, rev, p1rev, skiprev=dest)
+        copies.duplicatecopies(repo, wctx, rev, p1rev, skiprev=dest)
     return stats
 
 def adjustdest(repo, rev, destmap, state, skipped):