diff mercurial/hgweb/hgwebdir_mod.py @ 40728:2cd5f1fac788

hgweb: load globally-enabled extensions explicitly Before, extensions were loaded as a side effect of hg.repository() if the hgweb was executed as a CGI/WSGI. I want to make it explicit so that another ui hook can be inserted after extensions.loadall().
author Yuya Nishihara <yuya@tcha.org>
date Sat, 17 Nov 2018 19:11:45 +0900
parents 536f22d6c2c5
children c93d046d4300
line wrap: on
line diff
--- a/mercurial/hgweb/hgwebdir_mod.py	Sat Nov 24 14:11:02 2018 -0500
+++ b/mercurial/hgweb/hgwebdir_mod.py	Sat Nov 17 19:11:45 2018 +0900
@@ -30,6 +30,7 @@
     configitems,
     encoding,
     error,
+    extensions,
     hg,
     profiling,
     pycompat,
@@ -268,6 +269,9 @@
         self.lastrefresh = 0
         self.motd = None
         self.refresh()
+        if not baseui:
+            # set up environment for new ui
+            extensions.loadall(self.ui)
 
     def refresh(self):
         if self.ui: