changeset 1172:3f30a5e7e15b

Use path relative to document root as reponame if published via a web server. The full path is still displayed when using 'hg serve'.
author Thomas Arendsen Hein <thomas@intevation.de>
date Wed, 31 Aug 2005 08:38:34 +0200
parents 85555540a4e2
children bc9695f1f872
files mercurial/hgweb.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb.py	Wed Aug 31 07:25:02 2005 +0200
+++ b/mercurial/hgweb.py	Wed Aug 31 08:38:34 2005 +0200
@@ -178,8 +178,7 @@
             self.repo = repo
 
         self.mtime = -1
-        self.reponame = name or self.repo.ui.config("web", "name",
-                                                    self.repo.root)
+        self.reponame = name
         self.archives = 'zip', 'gz', 'bz2'
 
     def refresh(self):
@@ -730,6 +729,9 @@
         if "?" in uri:
             uri = uri.split("?")[0]
         url = "http://%s%s%s" % (req.env["SERVER_NAME"], port, uri)
+        if not self.reponame:
+            self.reponame = (self.repo.ui.config("web", "name")
+                             or uri.strip('/') or self.repo.root)
 
         self.t = templater(m, common_filters,
                            {"url": url,