diff mercurial/hgweb.py @ 1022:31dcaf9123ba

Minor hgwebdir tweaks - ignore / for PATH_INFO - fix // in URLs
author mpm@selenic.com
date Wed, 24 Aug 2005 03:32:08 -0700
parents bfe12654764d
children bc806ba72959
line wrap: on
line diff
--- a/mercurial/hgweb.py
+++ b/mercurial/hgweb.py
@@ -844,7 +844,7 @@ class hgwebdir:
         except:
             virtual = ""
 
-        if virtual:
+        if virtual[1:]:
             real = self.cp.get("paths", virtual[1:])
             h = hgweb(real)
             h.run()
@@ -875,9 +875,12 @@ class hgwebdir:
                     except:
                         return default
 
+                url = os.environ["REQUEST_URI"] + "/" + v
+                url = url.replace("//", "/")
+
                 yield dict(author = get("web", "author", "unknown"),
                            name = get("web", "name", v),
-                           url = os.environ["REQUEST_URI"] + "/" + v,
+                           url = url,
                            parity = parity,
                            shortdesc = get("web", "description", "unknown"),
                            lastupdate = os.stat(os.path.join(r, ".hg",