diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -1901,7 +1901,7 @@ def walkrepos(path, followsym=False, see _add_dir_if_not_there(seen_dirs, path) for root, dirs, files in os.walk(path, topdown=True, onerror=errhandler): if '.hg' in dirs: - dirs.remove('.hg') # don't recurse inside the .hg directory + dirs[:] = [] # don't descend further yield root # found a repository qroot = os.path.join(root, '.hg', 'patches') if os.path.isdir(os.path.join(qroot, '.hg')): diff --git a/tests/test-hgwebdir b/tests/test-hgwebdir --- a/tests/test-hgwebdir +++ b/tests/test-hgwebdir @@ -16,14 +16,8 @@ hg --cwd b ci -Amb -d'2 0' hg init c echo c > c/c hg --cwd c ci -Amc -d'3 0' +root=`pwd` -cd b -hg init d -echo d > d/d -hg --cwd d ci -Amd -cd .. - -root=`pwd` cd .. cat > paths.conf <