mercurial/hgweb/hgweb_mod.py
changeset 9887 38170eeed18c
parent 9842 d3dbdca92458
child 9888 510122bb3c7f
equal deleted inserted replaced
9886:56af3f240a22 9887:38170eeed18c
    52 
    52 
    53     def configlist(self, section, name, default=None, untrusted=True):
    53     def configlist(self, section, name, default=None, untrusted=True):
    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
    61             self.repo = hg.repository(self.repo.ui, self.repo.root)
    63             self.repo = hg.repository(self.repo.ui, self.repo.root)
    62             self.maxchanges = int(self.config("web", "maxchanges", 10))
    64             self.maxchanges = int(self.config("web", "maxchanges", 10))
    78         req = wsgirequest(env, respond)
    80         req = wsgirequest(env, respond)
    79         return self.run_wsgi(req)
    81         return self.run_wsgi(req)
    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
    87 
    89 
    88         req.url = req.env['SCRIPT_NAME']
    90         req.url = req.env['SCRIPT_NAME']