示例#1
0
 def refresh(self, request=None):
     st = get_stat(self.repo.spath)
     pst = get_stat(self.repo.spath, 'phaseroots')
     # changelog mtime and size, phaseroots mtime and size
     repostate = ((st.st_mtime, st.st_size), (pst.st_mtime, pst.st_size))
     # we need to compare file size in addition to mtime to catch
     # changes made less than a second ago
     if repostate != self.repostate:
         r = hg.repository(self.repo.baseui, self.repo.url())
         self.repo = self._getview(r)
         self.maxchanges = int(self.config("web", "maxchanges", 10))
         self.stripecount = int(self.config("web", "stripes", 1))
         self.maxshortchanges = int(self.config("web", "maxshortchanges",
                                                60))
         self.maxfiles = int(self.config("web", "maxfiles", 10))
         self.allowpull = self.configbool("web", "allowpull", True)
         encoding.encoding = self.config("web", "encoding",
                                         encoding.encoding)
         # update these last to avoid threads seeing empty settings
         self.repostate = repostate
         # mtime is needed for ETag
         self.mtime = st.st_mtime
     if request:
         self.repo.ui.environ = request.env
示例#2
0
 def refresh(self, request=None):
     st = get_stat(self.repo.spath)
     # compare changelog size in addition to mtime to catch
     # rollbacks made less than a second ago
     if st.st_mtime != self.mtime or st.st_size != self.size:
         self.mtime = st.st_mtime
         self.size = st.st_size
         r = hg.repository(self.repo.baseui, self.repo.root)
         self.repo = self._getview(r)
         self.maxchanges = int(self.config("web", "maxchanges", 10))
         self.stripecount = int(self.config("web", "stripes", 1))
         self.maxshortchanges = int(self.config("web", "maxshortchanges", 60))
         self.maxfiles = int(self.config("web", "maxfiles", 10))
         self.allowpull = self.configbool("web", "allowpull", True)
         encoding.encoding = self.config("web", "encoding", encoding.encoding)
     if request:
         self.repo.ui.environ = request.env
示例#3
0
 def refresh(self, request=None):
     if request:
         self.repo.ui.environ = request.env
     st = get_stat(self.repo.spath)
     # compare changelog size in addition to mtime to catch
     # rollbacks made less than a second ago
     if st.st_mtime != self.mtime or st.st_size != self.size:
         self.mtime = st.st_mtime
         self.size = st.st_size
         self.repo = hg.repository(self.repo.ui, self.repo.root)
         self.maxchanges = int(self.config("web", "maxchanges", 10))
         self.stripecount = int(self.config("web", "stripes", 1))
         self.maxshortchanges = int(self.config("web", "maxshortchanges", 60))
         self.maxfiles = int(self.config("web", "maxfiles", 10))
         self.allowpull = self.configbool("web", "allowpull", True)
         encoding.encoding = self.config("web", "encoding",
                                         encoding.encoding)