##// END OF EJS Templates
hgweb: move additional state setting outside of refresh...
Gregory Szorc -
r26160:952e0564 default
parent child Browse files
Show More
@@ -195,7 +195,7 class hgweb(object):
195 195 else:
196 196 return repo.filtered('served')
197 197
198 def refresh(self, request):
198 def refresh(self):
199 199 repostate = []
200 200 # file of interrests mtime and size
201 201 for meth, fname in foi:
@@ -208,15 +208,11 class hgweb(object):
208 208 if repostate != self.repostate:
209 209 r = hg.repository(self.repo.baseui, self.repo.url())
210 210 self.repo = self._getview(r)
211 encoding.encoding = self.config("web", "encoding",
212 encoding.encoding)
213 211 # update these last to avoid threads seeing empty settings
214 212 self.repostate = repostate
215 213 # mtime is needed for ETag
216 214 self.mtime = st.st_mtime
217 215
218 self.repo.ui.environ = request.env
219
220 216 def run(self):
221 217 """Start a server from CGI environment.
222 218
@@ -243,9 +239,13 class hgweb(object):
243 239 This is typically only called by Mercurial. External consumers
244 240 should be using instances of this class as the WSGI application.
245 241 """
246 self.refresh(req)
242 self.refresh()
247 243 rctx = requestcontext(self)
248 244
245 # This state is global across all threads.
246 encoding.encoding = rctx.config('web', 'encoding', encoding.encoding)
247 rctx.repo.ui.environ = req.env
248
249 249 # work with CGI variables to create coherent structure
250 250 # use SCRIPT_NAME, PATH_INFO and QUERY_STRING as well as our REPO_NAME
251 251
General Comments 0
You need to be logged in to leave comments. Login now