configitems: register the 'web.prefix' config

This commit is contained in:
Boris Feld 2017-06-30 03:45:49 +02:00
parent 88f87cb825
commit dd08c3c7c0
3 changed files with 5 additions and 2 deletions

View File

@ -631,6 +631,9 @@ coreconfigitem('web', 'ipv6',
coreconfigitem('web', 'port',
default=8000,
)
coreconfigitem('web', 'prefix',
default='',
)
coreconfigitem('worker', 'backgroundclose',
default=dynamicdefault,
)

View File

@ -177,7 +177,7 @@ class hgwebdir(object):
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('/'):

View File

@ -277,7 +277,7 @@ class MercurialHTTPServer(_mixin, httpservermod.httpserver, object):
handler.preparehttpserver(self, ui)
prefix = ui.config('web', 'prefix', '')
prefix = ui.config('web', 'prefix')
if prefix:
prefix = '/' + prefix.strip('/')
self.prefix = prefix