# HG changeset patch # User Bryan O'Sullivan # Date 1122861240 28800 # Node ID 72d9bd4841f377b5e06eecd3f5b29dee6847d801 # Parent 89985a1b342711c63868ad6da72f90f09236c4c8 Ensure that dirstate.walk only yields names once. Its predecessor code used to do this, and now it does, too. diff -r 89985a1b3427 -r 72d9bd4841f3 mercurial/hg.py --- a/mercurial/hg.py Sun Jul 31 17:42:46 2005 -0800 +++ b/mercurial/hg.py Sun Jul 31 17:54:00 2005 -0800 @@ -440,6 +440,10 @@ dc = self.map.copy() # walk all files by default if not files: files = [self.root] + known = {'.hg': 1} + def seen(fn): + if fn in known: return True + known[fn] = 1 def traverse(): for f in util.unique(files): f = os.path.join(self.root, f) @@ -447,7 +451,7 @@ for dir, subdirs, fl in os.walk(f): d = dir[len(self.root) + 1:] nd = os.path.normpath(d) - if nd == '.hg': + if seen(nd): subdirs[:] = [] continue for sd in subdirs: @@ -468,6 +472,7 @@ for src, fn in util.unique(traverse()): fn = os.path.normpath(fn) + if seen(fn): continue if fn in dc: del dc[fn] elif self.ignore(fn):