configitems: register the 'web.prefix' config
authorBoris Feld <boris.feld@octobus.net>
Fri, 30 Jun 2017 03:45:49 +0200
changeset 34243 d24816dfdcff
parent 34242 e2d633f8ee65
child 34244 fe5202bef5ce
configitems: register the 'web.prefix' config
mercurial/configitems.py
mercurial/hgweb/hgwebdir_mod.py
mercurial/hgweb/server.py
--- 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