##// END OF EJS Templates
dirstate: eliminate reference cycle from normalize...
Matt Mackall -
r8732:3507f6c7 default
parent child Browse files
Show More
@@ -114,12 +114,6 b' class dirstate(object):'
114 114 def _checkcase(self):
115 115 return not util.checkcase(self._join('.hg'))
116 116
117 @propertycache
118 def normalize(self):
119 if self._checkcase:
120 return self._normalize
121 return lambda x, y=False: x
122
123 117 def _join(self, f):
124 118 # much faster than os.path.join()
125 119 # it's safe because f is always a relative path
@@ -345,7 +339,7 b' class dirstate(object):'
345 339 except KeyError:
346 340 self._ui.warn(_("not in dirstate: %s\n") % f)
347 341
348 def _normalize(self, path, knownpath=False):
342 def _normalize(self, path, knownpath):
349 343 norm_path = os.path.normcase(path)
350 344 fold_path = self._foldmap.get(norm_path, None)
351 345 if fold_path is None:
@@ -450,7 +444,6 b' class dirstate(object):'
450 444 badfn = match.bad
451 445 dmap = self._map
452 446 normpath = util.normpath
453 normalize = self.normalize
454 447 listdir = osutil.listdir
455 448 lstat = os.lstat
456 449 getkind = stat.S_IFMT
@@ -461,6 +454,11 b' class dirstate(object):'
461 454 work = []
462 455 wadd = work.append
463 456
457 if self._checkcase:
458 normalize = self._normalize
459 else:
460 normalize = lambda x, y: x
461
464 462 exact = skipstep3 = False
465 463 if matchfn == match.exact: # match.exact
466 464 exact = True
@@ -475,7 +473,7 b' class dirstate(object):'
475 473
476 474 # step 1: find all explicit files
477 475 for ff in sorted(files):
478 nf = normalize(normpath(ff))
476 nf = normalize(normpath(ff), True)
479 477 if nf in results:
480 478 continue
481 479
General Comments 0
You need to be logged in to leave comments. Login now