D1343: dirstate: move dropping of folded filenames into the dirstate map

mbthomas (Mark Thomas) phabricator at mercurial-scm.org
Wed Nov 8 12:31:20 EST 2017


mbthomas created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  When dropping files from the dirstate, the corresponding entry in the
  filefoldmap is also dropped.  Move this into the dirstate map object.  A future
  implementation of the dirstate will maintain the filefoldmap differently.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -387,11 +387,6 @@
         return self._map.copymap
 
     def _droppath(self, f):
-        if "filefoldmap" in self._map.__dict__:
-            normed = util.normcase(f)
-            if normed in self._map.filefoldmap:
-                del self._map.filefoldmap[normed]
-
         self._updatedfiles.add(f)
 
     def _addpath(self, f, state, mode, size, mtime):
@@ -1258,6 +1253,9 @@
         """
         if oldstate not in "?r" and "dirs" in self.__dict__:
             self.dirs.delpath(f)
+        if "filefoldmap" in self.__dict__:
+            normed = util.normcase(f)
+            self.filefoldmap.pop(normed, None)
         self._map[f] = dirstatetuple('r', 0, size, 0)
         self.nonnormalset.add(f)
 
@@ -1271,6 +1269,9 @@
             if oldstate != "r" and "dirs" in self.__dict__:
                 self.dirs.delpath(f)
             del self._map[f]
+        if "filefoldmap" in self.__dict__:
+            normed = util.normcase(f)
+            self.filefoldmap.pop(normed, None)
         self.nonnormalset.discard(f)
         return exists
 



To: mbthomas, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list