Mercurial > hg
changeset 34676:bfddc3d678ae
dirstate: remove _filefoldmap property cache
Now that the filefoldmap is source of truthed on the dirstatemap, let's get rid
of the property cache on the dirstate.
Differential Revision: https://phab.mercurial-scm.org/D981
author | Durham Goode <durham@fb.com> |
---|---|
date | Thu, 05 Oct 2017 11:34:41 -0700 |
parents | c6ef9a2498a5 |
children | 014bd2a555c8 |
files | contrib/perf.py mercurial/dirstate.py |
diffstat | 2 files changed, 10 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/perf.py Thu Oct 05 11:34:41 2017 -0700 +++ b/contrib/perf.py Thu Oct 05 11:34:41 2017 -0700 @@ -549,8 +549,8 @@ dirstate = repo.dirstate 'a' in dirstate def d(): - dirstate._filefoldmap.get('a') - del dirstate._filefoldmap + dirstate._map.filefoldmap.get('a') + del dirstate._map.filefoldmap timer(d) fm.end()
--- a/mercurial/dirstate.py Thu Oct 05 11:34:41 2017 -0700 +++ b/mercurial/dirstate.py Thu Oct 05 11:34:41 2017 -0700 @@ -133,10 +133,6 @@ return self._map @propertycache - def _filefoldmap(self): - return self._map.filefoldmap() - - @propertycache def _dirfoldmap(self): f = {} normcase = util.normcase @@ -380,7 +376,7 @@ rereads the dirstate. Use localrepo.invalidatedirstate() if you want to check whether the dirstate has changed before rereading it.''' - for a in ("_map", "_filefoldmap", "_dirfoldmap", "_branch", + for a in ("_map", "_dirfoldmap", "_branch", "_dirs", "_ignore"): if a in self.__dict__: delattr(self, a) @@ -412,10 +408,10 @@ if self[f] not in "?r" and "_dirs" in self.__dict__: self._dirs.delpath(f) - if "_filefoldmap" in self.__dict__: + if "filefoldmap" in self._map.__dict__: normed = util.normcase(f) - if normed in self._filefoldmap: - del self._filefoldmap[normed] + if normed in self._map.filefoldmap: + del self._map.filefoldmap[normed] self._updatedfiles.add(f) @@ -563,18 +559,18 @@ def _normalizefile(self, path, isknown, ignoremissing=False, exists=None): normed = util.normcase(path) - folded = self._filefoldmap.get(normed, None) + folded = self._map.filefoldmap.get(normed, None) if folded is None: if isknown: folded = path else: folded = self._discoverpath(path, normed, ignoremissing, exists, - self._filefoldmap) + self._map.filefoldmap) return folded def _normalize(self, path, isknown, ignoremissing=False, exists=None): normed = util.normcase(path) - folded = self._filefoldmap.get(normed, None) + folded = self._map.filefoldmap.get(normed, None) if folded is None: folded = self._dirfoldmap.get(normed, None) if folded is None: @@ -1270,6 +1266,7 @@ otherparent.add(fname) return nonnorm, otherparent + @propertycache def filefoldmap(self): """Returns a dictionary mapping normalized case paths to their non-normalized versions.