changeset 47971:c0157aca5bf5

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
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 02 Sep 2021 02:48:56 +0200
parents 7ab99007fce5
children 5a6c1ef4bcac
files mercurial/dirstate.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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