diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py +++ b/mercurial/hgweb/hgweb_mod.py @@ -54,7 +54,9 @@ class hgweb(object): return self.repo.ui.configlist(section, name, default, untrusted=untrusted) - def refresh(self): + def refresh(self, request=None): + if request: + self.ui.environ = request.environ mtime = get_mtime(self.repo.root) if mtime != self.mtime: self.mtime = mtime @@ -80,7 +82,7 @@ class hgweb(object): def run_wsgi(self, req): - self.refresh() + self.refresh(req) # work with CGI variables to create coherent structure # use SCRIPT_NAME, PATH_INFO and QUERY_STRING as well as our REPO_NAME diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -29,8 +29,11 @@ class ui(object): self._ocfg = src._ocfg.copy() self._trustusers = src._trustusers.copy() self._trustgroups = src._trustgroups.copy() + self.environ = src.environ self.fixconfig() else: + # shared read-only environment + self.environ = os.environ # we always trust global config files for f in util.rcpath(): self.readconfig(f, trust=True)