changeset 34612:c2cb6be4212f

configitems: register the 'web.logourl' config
author Boris Feld <boris.feld@octobus.net>
date Wed, 11 Oct 2017 04:16:17 +0200
parents c879fc7bd71f
children 5e61cd5fb0fc
files mercurial/configitems.py mercurial/hgweb/hgweb_mod.py mercurial/hgweb/hgwebdir_mod.py
diffstat 3 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/configitems.py	Wed Oct 11 04:16:05 2017 +0200
+++ b/mercurial/configitems.py	Wed Oct 11 04:16:17 2017 +0200
@@ -748,6 +748,9 @@
 coreconfigitem('web', 'logoimg',
     default='hglogo.png',
 )
+coreconfigitem('web', 'logourl',
+    default='https://mercurial-scm.org/',
+)
 coreconfigitem('web', 'accesslog',
     default='-',
 )
--- a/mercurial/hgweb/hgweb_mod.py	Wed Oct 11 04:16:05 2017 +0200
+++ b/mercurial/hgweb/hgweb_mod.py	Wed Oct 11 04:16:17 2017 +0200
@@ -168,7 +168,7 @@
         port = req.env['SERVER_PORT']
         port = port != default_port and (':' + port) or ''
         urlbase = '%s://%s%s' % (proto, req.env['SERVER_NAME'], port)
-        logourl = self.config('web', 'logourl', 'https://mercurial-scm.org/')
+        logourl = self.config('web', 'logourl')
         logoimg = self.config('web', 'logoimg')
         staticurl = self.config('web', 'staticurl') or req.url + 'static/'
         if not staticurl.endswith('/'):
--- a/mercurial/hgweb/hgwebdir_mod.py	Wed Oct 11 04:16:05 2017 +0200
+++ b/mercurial/hgweb/hgwebdir_mod.py	Wed Oct 11 04:16:17 2017 +0200
@@ -510,7 +510,7 @@
 
         start = url[-1] == '?' and '&' or '?'
         sessionvars = webutil.sessionvars(vars, start)
-        logourl = config('web', 'logourl', 'https://mercurial-scm.org/')
+        logourl = config('web', 'logourl')
         logoimg = config('web', 'logoimg')
         staticurl = config('web', 'staticurl') or url + 'static/'
         if not staticurl.endswith('/'):