Patchwork D8624: wip: this does not help but seems less wrong

login
register
mail settings
Submitter phabricator
Date June 9, 2020, 8:52 p.m.
Message ID <differential-rev-PHID-DREV-yvg3v6i53qmkdnrgszme-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46490/
State New
Headers show

Comments

phabricator - June 9, 2020, 8:52 p.m.
durin42 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/mergestate.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/mergestate.py b/mercurial/mergestate.py
--- a/mercurial/mergestate.py
+++ b/mercurial/mergestate.py
@@ -875,6 +875,7 @@ 
         self._basectx = ctx
         self.reset()
         self._ancestor_filectxs = {}
+        self._state = {}
 
     def add(self, fcl, fco, fca, fd):
         """add a new (potentially?) conflicting file to the merge state"""
@@ -882,7 +883,9 @@ 
         # TODO(augie): the rebase codepath depends on non-implicit
         # ancestor. I think we should fix things so that ancestor can
         # be passed in to reset().
-        self._ancestor_filectxs[fcl.path()] = fca
+        print('paths', fcl.path(), fco.path(), fca.path(), fd)
+        self._ancestor_filectxs[fd] = fca
+        self._state[fd] = fcl, fco, fca
 
     # Since memmergestate isn't mutable yet, these are all trivial
     # implementations used by the "happy path" in merge code.
@@ -956,12 +959,13 @@ 
             fca = _filectxorabsent(
                 nullhex if dfile not in actx else None, actx, dfile
             )
+        fcl, fco, fca = self._state[dfile]
         fn = filemerge.premerge if preresolve else filemerge.filemerge
         complete, mergeret, deleted = fn(
             self._repo,
             wctx,
             self._local,
-            dfile,  # orig
+            fcl.path(),
             fcd,
             fco,
             fca,