diff mercurial/dirstatemap.py @ 47535:6025353c9c55

dirstate: no longer pass `oldstate` to the `dropfile` The `oldstate` value come literally from `_map` so we don't need to pass tha information along. Differential Revision: https://phab.mercurial-scm.org/D10978
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 04 Jul 2021 02:28:08 +0200
parents a1745a292885
children 84391ddf4c78
line wrap: on
line diff
--- a/mercurial/dirstatemap.py	Sun Jul 04 02:21:59 2021 +0200
+++ b/mercurial/dirstatemap.py	Sun Jul 04 02:28:08 2021 +0200
@@ -235,12 +235,17 @@
         self._map[f] = dirstatetuple(b'r', 0, size, 0)
         self.nonnormalset.add(f)
 
-    def dropfile(self, f, oldstate):
+    def dropfile(self, f):
         """
         Remove a file from the dirstate.  Returns True if the file was
         previously recorded.
         """
-        exists = self._map.pop(f, None) is not None
+        old_entry = self._map.pop(f, None)
+        exists = False
+        oldstate = b'?'
+        if old_entry is not None:
+            exists = True
+            oldstate = old_entry.state
         if exists:
             if oldstate != b"r" and "_dirs" in self.__dict__:
                 self._dirs.delpath(f)