Mercurial > hg
changeset 7201:b1aea76f7001
hgwebdir: show nested repositories (issue1336)
author | Benoit Allard <benoit@aeteurope.nl> |
---|---|
date | Wed, 22 Oct 2008 18:23:32 +0200 |
parents | ca5ac40949dc |
children | 268c582bd42a |
files | mercurial/util.py tests/test-walkrepo.py |
diffstat | 2 files changed, 11 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/util.py Wed Oct 22 13:14:52 2008 +0200 +++ b/mercurial/util.py Wed Oct 22 18:23:32 2008 +0200 @@ -1852,7 +1852,7 @@ _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[:] = [] # don't descend further + dirs.remove('.hg') # don't recurse inside the .hg directory yield root # found a repository qroot = os.path.join(root, '.hg', 'patches') if os.path.isdir(os.path.join(qroot, '.hg')):
--- a/tests/test-walkrepo.py Wed Oct 22 13:14:52 2008 +0200 +++ b/tests/test-walkrepo.py Wed Oct 22 18:23:32 2008 +0200 @@ -12,6 +12,12 @@ mkdir('subdir') chdir('subdir') hg.repository(u, 'sub1', create=1) +chdir('sub1') +hg.repository(u, 'inside_sub1', create=1) +chdir('.hg') +hg.repository(u, 'patches', create=1) +chdir(os.path.pardir) +chdir(os.path.pardir) mkdir('subsubdir') chdir('subsubdir') hg.repository(u, 'subsub1', create=1) @@ -22,12 +28,12 @@ def runtest(): reposet = frozenset(walkrepos('.', followsym=True)) - if sym and (len(reposet) != 3): + if sym and (len(reposet) != 5): print "reposet = %r" % (reposet,) - raise SystemExit(1, "Found %d repositories when I should have found 3" % (len(reposet),)) - if (not sym) and (len(reposet) != 2): + raise SystemExit(1, "Found %d repositories when I should have found 5" % (len(reposet),)) + if (not sym) and (len(reposet) != 4): print "reposet = %r" % (reposet,) - raise SystemExit(1, "Found %d repositories when I should have found 2" % (len(reposet),)) + raise SystemExit(1, "Found %d repositories when I should have found 4" % (len(reposet),)) sub1set = frozenset((pjoin('.', 'sub1'), pjoin('.', 'circle', 'subdir', 'sub1'))) if len(sub1set & reposet) != 1: