changeset 26210:7c759f1a056f

hgweb: add reponame to requestcontext We have to use object.__setattr__ until the app proxy is gone.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 22 Aug 2015 17:04:24 -0700
parents 7917746c9a67
children ea489d94e1dc
files mercurial/hgweb/hgweb_mod.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py	Sat Aug 22 16:54:52 2015 -0700
+++ b/mercurial/hgweb/hgweb_mod.py	Sat Aug 22 17:04:24 2015 -0700
@@ -69,6 +69,7 @@
     def __init__(self, app):
         object.__setattr__(self, 'app', app)
         object.__setattr__(self, 'repo', app.repo)
+        object.__setattr__(self, 'reponame', app.reponame)
 
         object.__setattr__(self, 'archives', ('zip', 'gz', 'bz2'))
 
@@ -176,9 +177,10 @@
         sessionvars = webutil.sessionvars(vars, start)
 
         if not self.reponame:
-            self.reponame = (self.config('web', 'name')
-                             or req.env.get('REPO_NAME')
-                             or req.url.strip('/') or self.repo.root)
+            object.__setattr__(self, 'reponame',
+                               (self.config('web', 'name')
+                                or req.env.get('REPO_NAME')
+                                or req.url.strip('/') or self.repo.root))
 
         def websubfilter(text):
             return websub(text, self.websubtable)