hgwebdir: show only trailing part of path when browsing subdirectories
authorBrendan Cully <brendan@kublai.com>
Thu, 05 Jul 2007 19:56:16 -0700
changeset 4843 496ac05c6a31
parent 4842 d39776752a1f
child 4844 13cb25bb7607
hgwebdir: show only trailing part of path when browsing subdirectories
mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgwebdir_mod.py	Thu Jul 05 19:47:04 2007 -0700
+++ b/mercurial/hgweb/hgwebdir_mod.py	Thu Jul 05 19:56:16 2007 -0700
@@ -140,6 +140,7 @@
             for name, path in self.repos:
                 if not name.startswith(subdir):
                     continue
+                name = name[len(subdir):]
 
                 u = ui.ui(parentui=parentui)
                 try:
@@ -152,7 +153,7 @@
                 if u.configbool("web", "hidden", untrusted=True):
                     continue
 
-                url = ('/'.join([req.env["REQUEST_URI"].split('?')[0], name[len(subdir):]])
+                url = ('/'.join([req.env["REQUEST_URI"].split('?')[0], name])
                        .replace("//", "/")) + '/'
 
                 # update time with local timezone