From patchwork Wed Nov 8 17:31:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D1343: dirstate: move dropping of folded filenames into the dirstate map From: phabricator X-Patchwork-Id: 25427 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Wed, 8 Nov 2017 17:31:20 +0000 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 To: mbthomas, #hg-reviewers Cc: mercurial-devel 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