changeset 47985:7e65ca30fb91

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
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 15 Sep 2021 18:18:16 +0200
parents 6255a0d33c45
children 72b80a0124f8
files mercurial/dirstate.py
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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):