Patchwork D5596: copies: get working copy parents from wctx, not dirstate, to make in-mem work

login
register
mail settings
Submitter phabricator
Date Jan. 24, 2019, 11:57 p.m.
Message ID <da08fee4ec4578238fe5266940088ab5@localhost.localdomain>
Download mbox | patch
Permalink /patch/38010/
State Not Applicable
Headers show

Comments

phabricator - Jan. 24, 2019, 11:57 p.m.
martinvonz updated this revision to Diff 13436.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5596?vs=13234&id=13436

REVISION DETAIL
  https://phab.mercurial-scm.org/D5596

AFFECTED FILES
  mercurial/copies.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -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: