diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -397,10 +397,8 @@ class dirstate: if os.path.isdir(f): for dir, subdirs, fl in os.walk(f): d = dir[len(self.root) + 1:] - if ".hg" in subdirs: - subdirs.remove(".hg") for sd in subdirs: - if ignore(os.path.join(d, sd + '/')): + if sd == ".hg" or ignore(os.path.join(d, sd +'/')): subdirs.remove(sd) for fn in fl: fn = util.pconvert(os.path.join(d, fn))