diff --git a/doc/hgrc.5.txt b/doc/hgrc.5.txt --- a/doc/hgrc.5.txt +++ b/doc/hgrc.5.txt @@ -873,6 +873,10 @@ Web interface configuration. the list of repositories. The contents of the deny_read list have priority over (are examined before) the contents of the allow_read list. +``descend`` + hgwebdir indexes will not descend into subdirectories. Only repositories + directly in the current path will be shown (other repositories are still + available from the index corresponding to their containing path). ``description`` Textual description of the repository's purpose or contents. Default is "unknown". diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py +++ b/mercurial/hgweb/hgwebdir_mod.py @@ -198,12 +198,17 @@ class hgwebdir(object): sortdefault = 'name', False def entries(sortcolumn="", descending=False, subdir="", **map): + rows = [] parity = paritygen(self.stripecount) + descend = self.ui.configbool('web', 'descend', True) for name, path in self.repos: + if not name.startswith(subdir): continue name = name[len(subdir):] + if not descend and '/' in name: + continue u = self.ui.copy() try: diff --git a/tests/test-hgwebdir b/tests/test-hgwebdir --- a/tests/test-hgwebdir +++ b/tests/test-hgwebdir @@ -29,6 +29,7 @@ hg --cwd c ci -Amc -d'3 0' root=`pwd` cd .. + cat > paths.conf < paths.conf < paths.conf <> $DAEMON_PIDS +echo % test descend = False +"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=raw' +"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=raw' + + cat > collections.conf <