# HG changeset patch # User Matt Mackall # Date 1161976201 18000 # Node ID ece5c53577eb38693dc43ed27f5098dc4be80554 # Parent 4d97184a06ad9c6f899e04c97ef82252ffd8c496 small refactoring of path normalization in dirstate.statwalk diff -r 4d97184a06ad -r ece5c53577eb mercurial/dirstate.py --- a/mercurial/dirstate.py Fri Oct 27 14:06:32 2006 -0500 +++ b/mercurial/dirstate.py Fri Oct 27 14:10:01 2006 -0500 @@ -373,6 +373,7 @@ files = [self.root] dc = self.map.copy() else: + files = util.unique(files) dc = self.filterfiles(files) def imatch(file_): @@ -431,12 +432,12 @@ # step one, find all files that match our criteria files.sort() - for ff in util.unique(files): + for ff in files: + nf = util.normpath(ff) f = self.wjoin(ff) try: st = os.lstat(f) except OSError, inst: - nf = util.normpath(ff) found = False for fn in dc: if nf == fn or (fn.startswith(nf) and fn[len(nf)] == '/'): @@ -457,14 +458,11 @@ for e in sorted_: yield e else: - ff = util.normpath(ff) - if seen(ff): - continue - if match(ff): + if not seen(nf) and match(nf): if self.supported_type(ff, st, verbose=True): - yield 'f', ff, st + yield 'f', nf, st elif ff in dc: - yield 'm', ff, st + yield 'm', nf, st # step two run through anything left in the dc hash and yield # if we haven't already seen it