dirstate: directly call the right function in `set_tracked`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 15 Sep 2021 09:41:02 +0200
changeset 47984 6255a0d33c45
parent 47983 ffde999a3ea9
child 47985 7e65ca30fb91
dirstate: directly call the right function in `set_tracked` This get use closer to removing some older API on the dirstate. Differential Revision: https://phab.mercurial-scm.org/D11424
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Wed Sep 15 10:05:25 2021 +0200
+++ b/mercurial/dirstate.py	Wed Sep 15 09:41:02 2021 +0200
@@ -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)