hgweb: add reponame to requestcontext
authorGregory Szorc <gregory.szorc@gmail.com>
Sat, 22 Aug 2015 17:04:24 -0700
changeset 26210 7c759f1a056f
parent 26209 7917746c9a67
child 26211 ea489d94e1dc
hgweb: add reponame to requestcontext We have to use object.__setattr__ until the app proxy is gone.
mercurial/hgweb/hgweb_mod.py
--- 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)