dirstate: replace the use of `_normallookup` in `rebuild`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 15 Sep 2021 18:12:55 +0200
changeset 47992 14fa2e583422
parent 47991 625b84c1abdd
child 47993 eb1f8d6e9419
dirstate: replace the use of `_normallookup` in `rebuild` Normal lookup is a complicated function that we want to get rid of. Differential Revision: https://phab.mercurial-scm.org/D11432
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Wed Sep 15 18:16:16 2021 +0200
+++ b/mercurial/dirstate.py	Wed Sep 15 18:12:55 2021 +0200
@@ -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)