Patchwork D11425: dirstate: replace `_add` call in `setparent`

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

Comments

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

REVISION SUMMARY
  Same logic as the previous changeset, it get us closer to removed older API on
  the dirstate.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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
@@ -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):