# HG changeset patch # User Dirkjan Ochtman # Date 1250678824 -7200 # Node ID 8635b33eaade85b819cf3ad5ab080df8ef3ea37c # Parent bb7e2cdd4854b9f84db04e38a3ea8003f4072388 hgweb: add web.descend configuration variable diff -r bb7e2cdd4854 -r 8635b33eaade doc/hgrc.5.txt --- a/doc/hgrc.5.txt Tue Aug 18 13:59:30 2009 +0200 +++ b/doc/hgrc.5.txt Wed Aug 19 12:47:04 2009 +0200 @@ -873,6 +873,10 @@ 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 -r bb7e2cdd4854 -r 8635b33eaade mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py Tue Aug 18 13:59:30 2009 +0200 +++ b/mercurial/hgweb/hgwebdir_mod.py Wed Aug 19 12:47:04 2009 +0200 @@ -198,12 +198,17 @@ 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 -r bb7e2cdd4854 -r 8635b33eaade tests/test-hgwebdir --- a/tests/test-hgwebdir Tue Aug 18 13:59:30 2009 +0200 +++ b/tests/test-hgwebdir Wed Aug 19 12:47:04 2009 +0200 @@ -29,6 +29,7 @@ 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 <