Patchwork D11424: dirstate: directly call the right function in `set_tracked`

login
register
mail settings
Submitter phabricator
Date Sept. 16, 2021, 2:42 p.m.
Message ID <differential-rev-PHID-DREV-fwtlptrlytp2gdgomqmf-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49740/
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
  This get use closer to removing some older API on the dirstate.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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
@@ -471,9 +471,12 @@ 
 
         return True the file was previously untracked, False otherwise.
         """
+        self._dirty = True
+        self._updatedfiles.add(filename)
         entry = self._map.get(filename)
         if entry is None:
-            self._add(filename)
+            self._check_new_tracked_filename(filename)
+            self._map.addfile(filename, added=True)
             return True
         elif not entry.tracked:
             self._normallookup(filename)