dirstate: remove some usage of `_drop`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 02 Sep 2021 02:48:56 +0200
changeset 47971 c0157aca5bf5
parent 47970 7ab99007fce5
child 47972 5a6c1ef4bcac
dirstate: remove some usage of `_drop` This is a step toward being able to remove the `_drop` method on `dirstate`. Differential Revision: https://phab.mercurial-scm.org/D11418
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Thu Sep 02 02:44:12 2021 +0200
+++ b/mercurial/dirstate.py	Thu Sep 02 02:48:56 2021 +0200
@@ -496,13 +496,13 @@
         entry = self._map.get(filename)
         if entry is None:
             return False
-        elif entry.added:
-            self._drop(filename)
-            return True
         else:
             self._dirty = True
             self._updatedfiles.add(filename)
-            self._map.set_untracked(filename)
+            if entry.added:
+                self._map.dropfile(filename)
+            else:
+                self._map.set_untracked(filename)
             return True
 
     @requires_no_parents_change