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

Gregory Szorc gregory.szorc at gmail.com
Wed Sep 9 21:27:26 UTC 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 a153206894742a6aa4666e51ee2b2967177728a6
# Parent  ab1c6e4efda47281b14a4f5a46cc0d4a114fff7d
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
@@ -237,9 +237,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``.
@@ -279,8 +278,10 @@ class hgweb(object):
             self.repostate = repostate
             # mtime is needed for ETag
             self.mtime = 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