Do not overwrite motd attribute of hgwebdir instances on refresh. stable
authorThomas Arendsen Hein <thomas@intevation.de>
Sun, 22 Nov 2009 11:25:01 +0100
branchstable
changeset 9903 5d748045c2ae
parent 9900 8939900073a8
child 9904 ac73cd788853
child 9911 58bdcab55bdc
child 9918 f5fa1b5863de
Do not overwrite motd attribute of hgwebdir instances on refresh. This allows using application = hgwebdir(...) application.motd = (string or object with __str__ method) in WSGI (like it is possible in CGI). Changed web.motd in the config file is still read with this, because hgwebdir.templater.motd() does not store the config value.
mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgwebdir_mod.py	Thu Nov 19 11:06:01 2009 +0900
+++ b/mercurial/hgweb/hgwebdir_mod.py	Sun Nov 22 11:25:01 2009 +0100
@@ -48,6 +48,7 @@
         self.conf = conf
         self.baseui = baseui
         self.lastrefresh = 0
+        self.motd = None
         self.refresh()
 
     def refresh(self):
@@ -72,7 +73,6 @@
 
         encoding.encoding = self.ui.config('web', 'encoding',
                                            encoding.encoding)
-        self.motd = self.ui.config('web', 'motd')
         self.style = self.ui.config('web', 'style', 'paper')
         self.stripecount = self.ui.config('web', 'stripes', 1)
         if self.stripecount: