mercurial/hgweb/hgweb_mod.py
branchstable
changeset 26150 ee31ede3afb8
parent 26120 1a45e49a6bed
child 26167 7187f6e923d5
equal deleted inserted replaced
26122:d0843f7e16b4 26150:ee31ede3afb8
   129         else:
   129         else:
   130             return repo.filtered('served')
   130             return repo.filtered('served')
   131 
   131 
   132     def refresh(self, request=None):
   132     def refresh(self, request=None):
   133         repostate = []
   133         repostate = []
       
   134         mtime = 0
   134         # file of interrests mtime and size
   135         # file of interrests mtime and size
   135         for meth, fname in foi:
   136         for meth, fname in foi:
   136             prefix = getattr(self.repo, meth)
   137             prefix = getattr(self.repo, meth)
   137             st = get_stat(prefix, fname)
   138             st = get_stat(prefix, fname)
   138             repostate.append((st.st_mtime, st.st_size))
   139             repostate.append((st.st_mtime, st.st_size))
       
   140             mtime = max(mtime, st.st_mtime)
   139         repostate = tuple(repostate)
   141         repostate = tuple(repostate)
   140         # we need to compare file size in addition to mtime to catch
   142         # we need to compare file size in addition to mtime to catch
   141         # changes made less than a second ago
   143         # changes made less than a second ago
   142         if repostate != self.repostate:
   144         if repostate != self.repostate:
   143             r = hg.repository(self.repo.baseui, self.repo.url())
   145             r = hg.repository(self.repo.baseui, self.repo.url())
   151             encoding.encoding = self.config("web", "encoding",
   153             encoding.encoding = self.config("web", "encoding",
   152                                             encoding.encoding)
   154                                             encoding.encoding)
   153             # update these last to avoid threads seeing empty settings
   155             # update these last to avoid threads seeing empty settings
   154             self.repostate = repostate
   156             self.repostate = repostate
   155             # mtime is needed for ETag
   157             # mtime is needed for ETag
   156             self.mtime = st.st_mtime
   158             self.mtime = mtime
   157         if request:
   159         if request:
   158             self.repo.ui.environ = request.env
   160             self.repo.ui.environ = request.env
   159 
   161 
   160     def run(self):
   162     def run(self):
   161         if not os.environ.get('GATEWAY_INTERFACE', '').startswith("CGI/1."):
   163         if not os.environ.get('GATEWAY_INTERFACE', '').startswith("CGI/1."):