--- a/mercurial/hgweb/hgwebdir_mod.py Tue Mar 02 15:08:43 2010 -0500
+++ b/mercurial/hgweb/hgwebdir_mod.py Thu Mar 11 00:25:46 2010 +0900
@@ -284,8 +284,7 @@
for column in sortable]
self.refresh()
- if self._baseurl is not None:
- req.env['SCRIPT_NAME'] = self._baseurl
+ self.updatereqenv(req.env)
return tmpl("index", entries=entries, subdir=subdir,
sortcolumn=sortcolumn, descending=descending,
@@ -308,8 +307,7 @@
def config(section, name, default=None, untrusted=True):
return self.ui.config(section, name, default, untrusted)
- if self._baseurl is not None:
- req.env['SCRIPT_NAME'] = self._baseurl
+ self.updatereqenv(req.env)
url = req.env.get('SCRIPT_NAME', '')
if not url.endswith('/'):
@@ -339,3 +337,7 @@
"staticurl": staticurl,
"sessionvars": sessionvars})
return tmpl
+
+ def updatereqenv(self, env):
+ if self._baseurl is not None:
+ env['SCRIPT_NAME'] = self._baseurl