Show More
@@ -560,8 +560,8 b' def perfdirfoldmap(ui, repo, **opts):' | |||||
560 | dirstate = repo.dirstate |
|
560 | dirstate = repo.dirstate | |
561 | 'a' in dirstate |
|
561 | 'a' in dirstate | |
562 | def d(): |
|
562 | def d(): | |
563 | dirstate._dirfoldmap.get('a') |
|
563 | dirstate._map.dirfoldmap.get('a') | |
564 | del dirstate._dirfoldmap |
|
564 | del dirstate._map.dirfoldmap | |
565 | del dirstate._map.dirs |
|
565 | del dirstate._map.dirs | |
566 | timer(d) |
|
566 | timer(d) | |
567 | fm.end() |
|
567 | fm.end() |
@@ -132,14 +132,6 b' class dirstate(object):' | |||||
132 | self._read() |
|
132 | self._read() | |
133 | return self._map |
|
133 | return self._map | |
134 |
|
134 | |||
135 | @propertycache |
|
|||
136 | def _dirfoldmap(self): |
|
|||
137 | f = {} |
|
|||
138 | normcase = util.normcase |
|
|||
139 | for name in self._map.dirs: |
|
|||
140 | f[normcase(name)] = name |
|
|||
141 | return f |
|
|||
142 |
|
||||
143 | @property |
|
135 | @property | |
144 | def _sparsematcher(self): |
|
136 | def _sparsematcher(self): | |
145 | """The matcher for the sparse checkout. |
|
137 | """The matcher for the sparse checkout. | |
@@ -372,8 +364,7 b' class dirstate(object):' | |||||
372 | rereads the dirstate. Use localrepo.invalidatedirstate() if you want to |
|
364 | rereads the dirstate. Use localrepo.invalidatedirstate() if you want to | |
373 | check whether the dirstate has changed before rereading it.''' |
|
365 | check whether the dirstate has changed before rereading it.''' | |
374 |
|
366 | |||
375 |
for a in ("_map", "_ |
|
367 | for a in ("_map", "_branch", "_ignore"): | |
376 | "_ignore"): |
|
|||
377 | if a in self.__dict__: |
|
368 | if a in self.__dict__: | |
378 | delattr(self, a) |
|
369 | delattr(self, a) | |
379 | self._lastnormaltime = 0 |
|
370 | self._lastnormaltime = 0 | |
@@ -568,7 +559,7 b' class dirstate(object):' | |||||
568 | normed = util.normcase(path) |
|
559 | normed = util.normcase(path) | |
569 | folded = self._map.filefoldmap.get(normed, None) |
|
560 | folded = self._map.filefoldmap.get(normed, None) | |
570 | if folded is None: |
|
561 | if folded is None: | |
571 | folded = self._dirfoldmap.get(normed, None) |
|
562 | folded = self._map.dirfoldmap.get(normed, None) | |
572 | if folded is None: |
|
563 | if folded is None: | |
573 | if isknown: |
|
564 | if isknown: | |
574 | folded = path |
|
565 | folded = path | |
@@ -576,7 +567,7 b' class dirstate(object):' | |||||
576 | # store discovered result in dirfoldmap so that future |
|
567 | # store discovered result in dirfoldmap so that future | |
577 | # normalizefile calls don't start matching directories |
|
568 | # normalizefile calls don't start matching directories | |
578 | folded = self._discoverpath(path, normed, ignoremissing, exists, |
|
569 | folded = self._discoverpath(path, normed, ignoremissing, exists, | |
579 | self._dirfoldmap) |
|
570 | self._map.dirfoldmap) | |
580 | return folded |
|
571 | return folded | |
581 |
|
572 | |||
582 | def normalize(self, path, isknown=False, ignoremissing=False): |
|
573 | def normalize(self, path, isknown=False, ignoremissing=False): | |
@@ -875,7 +866,7 b' class dirstate(object):' | |||||
875 | if len(paths) > 1: |
|
866 | if len(paths) > 1: | |
876 | for path in paths: |
|
867 | for path in paths: | |
877 | folded = self._discoverpath(path, norm, True, None, |
|
868 | folded = self._discoverpath(path, norm, True, None, | |
878 | self._dirfoldmap) |
|
869 | self._map.dirfoldmap) | |
879 | if path != folded: |
|
870 | if path != folded: | |
880 | results[path] = None |
|
871 | results[path] = None | |
881 |
|
872 | |||
@@ -1396,3 +1387,10 b' class dirstatemap(object):' | |||||
1396 | self.read() |
|
1387 | self.read() | |
1397 | return self.identity |
|
1388 | return self.identity | |
1398 |
|
1389 | |||
|
1390 | @propertycache | |||
|
1391 | def dirfoldmap(self): | |||
|
1392 | f = {} | |||
|
1393 | normcase = util.normcase | |||
|
1394 | for name in self.dirs: | |||
|
1395 | f[normcase(name)] = name | |||
|
1396 | return f |
General Comments 0
You need to be logged in to leave comments.
Login now