##// END OF EJS Templates
ui: add environ property to access os.environ or wsgirequest.environ...
Sune Foldager -
r9887:38170eee default
parent child Browse files
Show More
@@ -54,7 +54,9 b' class hgweb(object):'
54 return self.repo.ui.configlist(section, name, default,
54 return self.repo.ui.configlist(section, name, default,
55 untrusted=untrusted)
55 untrusted=untrusted)
56
56
57 def refresh(self):
57 def refresh(self, request=None):
58 if request:
59 self.ui.environ = request.environ
58 mtime = get_mtime(self.repo.root)
60 mtime = get_mtime(self.repo.root)
59 if mtime != self.mtime:
61 if mtime != self.mtime:
60 self.mtime = mtime
62 self.mtime = mtime
@@ -80,7 +82,7 b' class hgweb(object):'
80
82
81 def run_wsgi(self, req):
83 def run_wsgi(self, req):
82
84
83 self.refresh()
85 self.refresh(req)
84
86
85 # work with CGI variables to create coherent structure
87 # work with CGI variables to create coherent structure
86 # use SCRIPT_NAME, PATH_INFO and QUERY_STRING as well as our REPO_NAME
88 # use SCRIPT_NAME, PATH_INFO and QUERY_STRING as well as our REPO_NAME
@@ -29,8 +29,11 b' class ui(object):'
29 self._ocfg = src._ocfg.copy()
29 self._ocfg = src._ocfg.copy()
30 self._trustusers = src._trustusers.copy()
30 self._trustusers = src._trustusers.copy()
31 self._trustgroups = src._trustgroups.copy()
31 self._trustgroups = src._trustgroups.copy()
32 self.environ = src.environ
32 self.fixconfig()
33 self.fixconfig()
33 else:
34 else:
35 # shared read-only environment
36 self.environ = os.environ
34 # we always trust global config files
37 # we always trust global config files
35 for f in util.rcpath():
38 for f in util.rcpath():
36 self.readconfig(f, trust=True)
39 self.readconfig(f, trust=True)
General Comments 0
You need to be logged in to leave comments. Login now