# HG changeset patch # User Gregory Szorc # Date 1440286769 25200 # Node ID e037fd28c8bb2d4cf051603dcc06e1827438b80c # Parent 84511b1d9724a73cb7362ad8dff5a340d799b81d hgweb: create websubtable on requestcontext diff -r 84511b1d9724 -r e037fd28c8bb mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py Sat Aug 22 16:28:22 2015 -0700 +++ b/mercurial/hgweb/hgweb_mod.py Sat Aug 22 16:39:29 2015 -0700 @@ -90,6 +90,13 @@ object.__setattr__(self, 'templatepath', self.config('web', 'templates', untrusted=False)) + # This object is more expensive to build than simple config values. + # It is shared across requests. The app will replace the object + # if it is updated. Since this is a reference and nothing should + # modify the underlying object, it should be constant for the lifetime + # of the request. + object.__setattr__(self, 'websubtable', app.websubtable) + # Proxy unknown reads and writes to the application instance # until everything is moved to us. def __getattr__(self, name):