changeset 41394:75e753a26806

copies: get working copy parents from wctx, not dirstate, to make in-mem work Before this patch, `run-tests.py test-rebase-conflicts.t --extra-config-opt rebase.experimental.inmemory=1` would have some lines that say "searching for copies back to rev 3" changed to "... rev 1". I don't know of a better way of testing this patch than doing that manually. There are many other differences, so we're not ready to use #testcases syntax on the entire test-rebase-conflicts.t yet. Differential Revision: https://phab.mercurial-scm.org/D5596
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 15 Jan 2019 16:55:20 -0800
parents dc50121126ae
children 9087513df412
files mercurial/copies.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/copies.py	Tue Jan 15 16:50:50 2019 -0800
+++ b/mercurial/copies.py	Tue Jan 15 16:55:20 2019 -0800
@@ -45,11 +45,15 @@
     #   - quit when interesting revs is zero
 
     cl = repo.changelog
+    wdirparents = None
     a = ctxa.rev()
     b = ctxb.rev()
     if a is None:
+        wdirparents = (ctxa.p1(), ctxa.p2())
         a = node.wdirrev
     if b is None:
+        assert not wdirparents
+        wdirparents = (ctxb.p1(), ctxb.p2())
         b = node.wdirrev
 
     side = {a: -1, b: 1}
@@ -61,7 +65,7 @@
     while interesting:
         r = -heapq.heappop(visit)
         if r == node.wdirrev:
-            parents = [cl.rev(p) for p in repo.dirstate.parents()]
+            parents = [pctx.rev() for pctx in wdirparents]
         else:
             parents = cl.parentrevs(r)
         if parents[1] == node.nullrev: