##// END OF EJS Templates
small refactoring of path normalization in dirstate.statwalk
Matt Mackall -
r3536:ece5c535 default
parent child Browse files
Show More
@@ -373,6 +373,7 b' class dirstate(object):'
373 files = [self.root]
373 files = [self.root]
374 dc = self.map.copy()
374 dc = self.map.copy()
375 else:
375 else:
376 files = util.unique(files)
376 dc = self.filterfiles(files)
377 dc = self.filterfiles(files)
377
378
378 def imatch(file_):
379 def imatch(file_):
@@ -431,12 +432,12 b' class dirstate(object):'
431
432
432 # step one, find all files that match our criteria
433 # step one, find all files that match our criteria
433 files.sort()
434 files.sort()
434 for ff in util.unique(files):
435 for ff in files:
436 nf = util.normpath(ff)
435 f = self.wjoin(ff)
437 f = self.wjoin(ff)
436 try:
438 try:
437 st = os.lstat(f)
439 st = os.lstat(f)
438 except OSError, inst:
440 except OSError, inst:
439 nf = util.normpath(ff)
440 found = False
441 found = False
441 for fn in dc:
442 for fn in dc:
442 if nf == fn or (fn.startswith(nf) and fn[len(nf)] == '/'):
443 if nf == fn or (fn.startswith(nf) and fn[len(nf)] == '/'):
@@ -457,14 +458,11 b' class dirstate(object):'
457 for e in sorted_:
458 for e in sorted_:
458 yield e
459 yield e
459 else:
460 else:
460 ff = util.normpath(ff)
461 if not seen(nf) and match(nf):
461 if seen(ff):
462 continue
463 if match(ff):
464 if self.supported_type(ff, st, verbose=True):
462 if self.supported_type(ff, st, verbose=True):
465 yield 'f', ff, st
463 yield 'f', nf, st
466 elif ff in dc:
464 elif ff in dc:
467 yield 'm', ff, st
465 yield 'm', nf, st
468
466
469 # step two run through anything left in the dc hash and yield
467 # step two run through anything left in the dc hash and yield
470 # if we haven't already seen it
468 # if we haven't already seen it
General Comments 0
You need to be logged in to leave comments. Login now