changeset 34243:d24816dfdcff

configitems: register the 'web.prefix' config
author Boris Feld <boris.feld@octobus.net>
date Fri, 30 Jun 2017 03:45:49 +0200
parents e2d633f8ee65
children fe5202bef5ce
files mercurial/configitems.py mercurial/hgweb/hgwebdir_mod.py mercurial/hgweb/server.py
diffstat 3 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/configitems.py	Fri Jun 30 03:45:48 2017 +0200
+++ b/mercurial/configitems.py	Fri Jun 30 03:45:49 2017 +0200
@@ -631,6 +631,9 @@
 coreconfigitem('web', 'port',
     default=8000,
 )
+coreconfigitem('web', 'prefix',
+    default='',
+)
 coreconfigitem('worker', 'backgroundclose',
     default=dynamicdefault,
 )
--- a/mercurial/hgweb/hgwebdir_mod.py	Fri Jun 30 03:45:48 2017 +0200
+++ b/mercurial/hgweb/hgwebdir_mod.py	Fri Jun 30 03:45:49 2017 +0200
@@ -177,7 +177,7 @@
         if self.stripecount:
             self.stripecount = int(self.stripecount)
         self._baseurl = self.ui.config('web', 'baseurl')
-        prefix = self.ui.config('web', 'prefix', '')
+        prefix = self.ui.config('web', 'prefix')
         if prefix.startswith('/'):
             prefix = prefix[1:]
         if prefix.endswith('/'):
--- a/mercurial/hgweb/server.py	Fri Jun 30 03:45:48 2017 +0200
+++ b/mercurial/hgweb/server.py	Fri Jun 30 03:45:49 2017 +0200
@@ -277,7 +277,7 @@
 
         handler.preparehttpserver(self, ui)
 
-        prefix = ui.config('web', 'prefix', '')
+        prefix = ui.config('web', 'prefix')
         if prefix:
             prefix = '/' + prefix.strip('/')
         self.prefix = prefix