[PATCH 2 of 5 hgweb-thread-isolation] hgweb: regenerate web substitutions when repo is refreshed

Gregory Szorc gregory.szorc at gmail.com
Thu Sep 3 18:16:17 CDT 2015


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1440286862 25200
#      Sat Aug 22 16:41:02 2015 -0700
# Node ID 305b554e1ec3be68e6ca28022c2bc243845a4a8d
# Parent  b0e667395fd4c0dbd24d597fd81ce5c7f13b8b3f
hgweb: regenerate web substitutions when repo is refreshed

Previously, changes to the configuration would not be picked up by a
running server. That feels like a bug. Regenerate the web substitutions
table when the repository changes.

diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py
--- a/mercurial/hgweb/hgweb_mod.py
+++ b/mercurial/hgweb/hgweb_mod.py
@@ -238,9 +238,8 @@ class hgweb(object):
         hook.redirect(True)
         self.repostate = None
         self.mtime = -1
         self.reponame = name
-        self.websubtable = webutil.getwebsubs(r)
 
     def _getview(self, repo):
         """The 'web.view' config controls changeset filter to hgweb. Possible
         values are ``served``, ``visible`` and ``all``. Default is ``served``.
@@ -278,8 +277,10 @@ class hgweb(object):
             self.repostate = repostate
             # mtime is needed for ETag
             self.mtime = st.st_mtime
 
+            self.websubtable = webutil.getwebsubs(r)
+
     def run(self):
         """Start a server from CGI environment.
 
         Modern servers should be using WSGI and should avoid this


More information about the Mercurial-devel mailing list