Patchwork D11432: dirstate: replace the use of `_normallookup` in `rebuild`

login
register
mail settings
Submitter phabricator
Date Sept. 16, 2021, 2:44 p.m.
Message ID <differential-rev-PHID-DREV-muze72qbfwzeirmnk7n4-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49748/
State Superseded
Headers show

Comments

phabricator - Sept. 16, 2021, 2:44 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Normal lookup is a complicated function that we want to get rid of.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -853,7 +853,17 @@ 
         self._map.setparents(parent, self._nodeconstants.nullid)
 
         for f in to_lookup:
-            self._normallookup(f)
+
+            if self.in_merge:
+                self.set_tracked(f)
+            else:
+                self._map.reset_state(
+                    f,
+                    wc_tracked=True,
+                    p1_tracked=True,
+                    possibly_dirty=True,
+                )
+            self._updatedfiles.add(f)
         for f in to_drop:
             if self._map.dropfile(f):
                 self._updatedfiles.add(f)