mercurial/hgweb/hgweb_mod.py
changeset 4346 c593e502f7fd
parent 4325 aa26759c6fb3
parent 4344 26a2fa9433b8
child 4349 69109aa0cddd
--- a/mercurial/hgweb/hgweb_mod.py
+++ b/mercurial/hgweb/hgweb_mod.py
@@ -703,7 +703,7 @@ class hgweb(object):
                     # strip leading /
                     pi = pi[1:]
                     if pi:
-                        root = root[:-len(pi)]
+                        root = root[:root.rfind(root, pi)]
                     if req.env.has_key('REPO_NAME'):
                         rn = req.env['REPO_NAME'] + '/'
                         root += rn