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 @@ -41,16 +41,14 @@ def urlrepos(prefix, roothead, paths): """yield url paths and filesystem paths from a list of repo paths >>> list(urlrepos('hg', '/opt', ['/opt/r', '/opt/r/r', '/opt'])) - [('hg/r', '/opt/r'), ('hg/r/r', '/opt/r/r'), ('hg/', '/opt')] + [('hg/r', '/opt/r'), ('hg/r/r', '/opt/r/r'), ('hg', '/opt')] >>> list(urlrepos('', '/opt', ['/opt/r', '/opt/r/r', '/opt'])) [('r', '/opt/r'), ('r/r', '/opt/r/r'), ('', '/opt')] """ for path in paths: path = os.path.normpath(path) - name = util.pconvert(path[len(roothead):]).strip('/') - if prefix: - name = prefix + '/' + name - yield name, path + yield (prefix + '/' + + util.pconvert(path[len(roothead):]).lstrip('/')).strip('/'), path class hgwebdir(object): refreshinterval = 20 diff --git a/tests/test-hgwebdir.t b/tests/test-hgwebdir.t --- a/tests/test-hgwebdir.t +++ b/tests/test-hgwebdir.t @@ -99,6 +99,7 @@ rss-log without basedir > rcoll=$root/** > star=* > starstar=** + > astar=webdir/a/* > EOF $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \ > -A access-paths.log -E error-paths-2.log @@ -130,6 +131,8 @@ should succeed, slashy names /starstar/webdir/b/ /starstar/webdir/b/d/ /starstar/webdir/c/ + /astar/ + /astar/.hg/patches/ $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=paper' 200 Script output follows @@ -322,6 +325,22 @@ should succeed, slashy names