dirstate: replace `_add` call in `setparent`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 15 Sep 2021 18:18:16 +0200
changeset 47985 7e65ca30fb91
parent 47984 6255a0d33c45
child 47986 72b80a0124f8
dirstate: replace `_add` call in `setparent` Same logic as the previous changeset, it get us closer to removed older API on the dirstate. Differential Revision: https://phab.mercurial-scm.org/D11425
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Wed Sep 15 09:41:02 2021 +0200
+++ b/mercurial/dirstate.py	Wed Sep 15 18:18:16 2021 +0200
@@ -409,7 +409,13 @@
                     source = self._map.copymap.get(f)
                     if source:
                         copies[f] = source
-                    self._add(f)
+                    self._check_new_tracked_filename(f)
+                    self._updatedfiles.add(f)
+                    self._map.reset_state(
+                        f,
+                        p1_tracked=False,
+                        wc_tracked=True,
+                    )
         return copies
 
     def setbranch(self, branch):