# HG changeset patch # User Mads Kiilerich # Date 1279743748 -7200 # Node ID 8f8a7976f4bc640e08f1ead6885dbfba4731151d # Parent e4357c214bf18710650b3468869ac2cb6ec5910f hgwebdir: allow pure relative globs in paths This allows the (to me, in some setups) obvious configuration: [paths] / = * or / = ** Relative paths used to work with [collections] even though it isn't documented. Perhaps it should be documented? diff -r e4357c214bf1 -r 8f8a7976f4bc mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py Thu Jul 22 15:26:26 2010 -0400 +++ b/mercurial/hgweb/hgwebdir_mod.py Wed Jul 21 22:22:28 2010 +0200 @@ -32,7 +32,7 @@ except KeyError: repos.append((prefix, root)) continue - roothead = os.path.normpath(roothead) + roothead = os.path.normpath(os.path.abspath(roothead)) for path in util.walkrepos(roothead, followsym=True, recurse=recurse): path = os.path.normpath(path) name = util.pconvert(path[len(roothead):]).strip('/') diff -r e4357c214bf1 -r 8f8a7976f4bc tests/test-hgwebdir --- a/tests/test-hgwebdir Thu Jul 22 15:26:26 2010 -0400 +++ b/tests/test-hgwebdir Wed Jul 21 22:22:28 2010 +0200 @@ -65,6 +65,8 @@ b=$root/b coll=$root/* rcoll=$root/** +star=* +starstar=** EOF hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \ diff -r e4357c214bf1 -r 8f8a7976f4bc tests/test-hgwebdir.out --- a/tests/test-hgwebdir.out Thu Jul 22 15:26:26 2010 -0400 +++ b/tests/test-hgwebdir.out Wed Jul 21 22:22:28 2010 +0200 @@ -46,6 +46,15 @@ /rcoll/b/ /rcoll/b/d/ /rcoll/c/ +/star/webdir/a/ +/star/webdir/a/.hg/patches/ +/star/webdir/b/ +/star/webdir/c/ +/starstar/webdir/a/ +/starstar/webdir/a/.hg/patches/ +/starstar/webdir/b/ +/starstar/webdir/b/d/ +/starstar/webdir/c/ 200 Script output follows @@ -165,6 +174,78 @@ + +star/webdir/a +unknown +Foo Bar <foo.bar@example.com> +seconds ago + + + + +star/webdir/a/.hg/patches +unknown +Foo Bar <foo.bar@example.com> +seconds ago + + + + +star/webdir/b +unknown +Foo Bar <foo.bar@example.com> +seconds ago + + + + +star/webdir/c +unknown +Foo Bar <foo.bar@example.com> +seconds ago + + + + +starstar/webdir/a +unknown +Foo Bar <foo.bar@example.com> +seconds ago + + + + +starstar/webdir/a/.hg/patches +unknown +Foo Bar <foo.bar@example.com> +seconds ago + + + + +starstar/webdir/b +unknown +Foo Bar <foo.bar@example.com> +seconds ago + + + + +starstar/webdir/b/d +unknown +Foo Bar <foo.bar@example.com> +seconds ago + + + + +starstar/webdir/c +unknown +Foo Bar <foo.bar@example.com> +seconds ago + + +