Minor hgwebdir tweaks
authormpm@selenic.com
Wed, 24 Aug 2005 03:32:08 -0700
changeset 1022 31dcaf9123ba
parent 1021 a0ce13606208
child 1023 bc806ba72959
child 1033 5426c8248df6
Minor hgwebdir tweaks - ignore / for PATH_INFO - fix // in URLs
mercurial/hgweb.py
--- a/mercurial/hgweb.py	Wed Aug 24 00:38:36 2005 -0700
+++ b/mercurial/hgweb.py	Wed Aug 24 03:32:08 2005 -0700
@@ -844,7 +844,7 @@
         except:
             virtual = ""
 
-        if virtual:
+        if virtual[1:]:
             real = self.cp.get("paths", virtual[1:])
             h = hgweb(real)
             h.run()
@@ -875,9 +875,12 @@
                     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",