##// END OF EJS Templates
hgweb: introduce helper method to update req.env
Yuya Nishihara -
r10673:9848b39a stable
parent child Browse files
Show More
@@ -284,8 +284,7 b' class hgwebdir(object):'
284 for column in sortable]
284 for column in sortable]
285
285
286 self.refresh()
286 self.refresh()
287 if self._baseurl is not None:
287 self.updatereqenv(req.env)
288 req.env['SCRIPT_NAME'] = self._baseurl
289
288
290 return tmpl("index", entries=entries, subdir=subdir,
289 return tmpl("index", entries=entries, subdir=subdir,
291 sortcolumn=sortcolumn, descending=descending,
290 sortcolumn=sortcolumn, descending=descending,
@@ -308,8 +307,7 b' class hgwebdir(object):'
308 def config(section, name, default=None, untrusted=True):
307 def config(section, name, default=None, untrusted=True):
309 return self.ui.config(section, name, default, untrusted)
308 return self.ui.config(section, name, default, untrusted)
310
309
311 if self._baseurl is not None:
310 self.updatereqenv(req.env)
312 req.env['SCRIPT_NAME'] = self._baseurl
313
311
314 url = req.env.get('SCRIPT_NAME', '')
312 url = req.env.get('SCRIPT_NAME', '')
315 if not url.endswith('/'):
313 if not url.endswith('/'):
@@ -339,3 +337,7 b' class hgwebdir(object):'
339 "staticurl": staticurl,
337 "staticurl": staticurl,
340 "sessionvars": sessionvars})
338 "sessionvars": sessionvars})
341 return tmpl
339 return tmpl
340
341 def updatereqenv(self, env):
342 if self._baseurl is not None:
343 env['SCRIPT_NAME'] = self._baseurl
General Comments 0
You need to be logged in to leave comments. Login now