##// END OF EJS Templates
dirstate: remove _filefoldmap property cache...
Durham Goode -
r34677:bfddc3d6 default
parent child Browse files
Show More
@@ -549,8 +549,8 b' def perfdirstatefoldmap(ui, repo, **opts'
549 dirstate = repo.dirstate
549 dirstate = repo.dirstate
550 'a' in dirstate
550 'a' in dirstate
551 def d():
551 def d():
552 dirstate._filefoldmap.get('a')
552 dirstate._map.filefoldmap.get('a')
553 del dirstate._filefoldmap
553 del dirstate._map.filefoldmap
554 timer(d)
554 timer(d)
555 fm.end()
555 fm.end()
556
556
@@ -133,10 +133,6 b' class dirstate(object):'
133 return self._map
133 return self._map
134
134
135 @propertycache
135 @propertycache
136 def _filefoldmap(self):
137 return self._map.filefoldmap()
138
139 @propertycache
140 def _dirfoldmap(self):
136 def _dirfoldmap(self):
141 f = {}
137 f = {}
142 normcase = util.normcase
138 normcase = util.normcase
@@ -380,7 +376,7 b' class dirstate(object):'
380 rereads the dirstate. Use localrepo.invalidatedirstate() if you want to
376 rereads the dirstate. Use localrepo.invalidatedirstate() if you want to
381 check whether the dirstate has changed before rereading it.'''
377 check whether the dirstate has changed before rereading it.'''
382
378
383 for a in ("_map", "_filefoldmap", "_dirfoldmap", "_branch",
379 for a in ("_map", "_dirfoldmap", "_branch",
384 "_dirs", "_ignore"):
380 "_dirs", "_ignore"):
385 if a in self.__dict__:
381 if a in self.__dict__:
386 delattr(self, a)
382 delattr(self, a)
@@ -412,10 +408,10 b' class dirstate(object):'
412 if self[f] not in "?r" and "_dirs" in self.__dict__:
408 if self[f] not in "?r" and "_dirs" in self.__dict__:
413 self._dirs.delpath(f)
409 self._dirs.delpath(f)
414
410
415 if "_filefoldmap" in self.__dict__:
411 if "filefoldmap" in self._map.__dict__:
416 normed = util.normcase(f)
412 normed = util.normcase(f)
417 if normed in self._filefoldmap:
413 if normed in self._map.filefoldmap:
418 del self._filefoldmap[normed]
414 del self._map.filefoldmap[normed]
419
415
420 self._updatedfiles.add(f)
416 self._updatedfiles.add(f)
421
417
@@ -563,18 +559,18 b' class dirstate(object):'
563
559
564 def _normalizefile(self, path, isknown, ignoremissing=False, exists=None):
560 def _normalizefile(self, path, isknown, ignoremissing=False, exists=None):
565 normed = util.normcase(path)
561 normed = util.normcase(path)
566 folded = self._filefoldmap.get(normed, None)
562 folded = self._map.filefoldmap.get(normed, None)
567 if folded is None:
563 if folded is None:
568 if isknown:
564 if isknown:
569 folded = path
565 folded = path
570 else:
566 else:
571 folded = self._discoverpath(path, normed, ignoremissing, exists,
567 folded = self._discoverpath(path, normed, ignoremissing, exists,
572 self._filefoldmap)
568 self._map.filefoldmap)
573 return folded
569 return folded
574
570
575 def _normalize(self, path, isknown, ignoremissing=False, exists=None):
571 def _normalize(self, path, isknown, ignoremissing=False, exists=None):
576 normed = util.normcase(path)
572 normed = util.normcase(path)
577 folded = self._filefoldmap.get(normed, None)
573 folded = self._map.filefoldmap.get(normed, None)
578 if folded is None:
574 if folded is None:
579 folded = self._dirfoldmap.get(normed, None)
575 folded = self._dirfoldmap.get(normed, None)
580 if folded is None:
576 if folded is None:
@@ -1270,6 +1266,7 b' class dirstatemap(object):'
1270 otherparent.add(fname)
1266 otherparent.add(fname)
1271 return nonnorm, otherparent
1267 return nonnorm, otherparent
1272
1268
1269 @propertycache
1273 def filefoldmap(self):
1270 def filefoldmap(self):
1274 """Returns a dictionary mapping normalized case paths to their
1271 """Returns a dictionary mapping normalized case paths to their
1275 non-normalized versions.
1272 non-normalized versions.
General Comments 0
You need to be logged in to leave comments. Login now