diff --git a/mercurial/configitems.py b/mercurial/configitems.py --- a/mercurial/configitems.py +++ b/mercurial/configitems.py @@ -631,6 +631,9 @@ coreconfigitem('web', 'ipv6', coreconfigitem('web', 'port', default=8000, ) +coreconfigitem('web', 'prefix', + default='', +) coreconfigitem('worker', 'backgroundclose', default=dynamicdefault, ) diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py +++ b/mercurial/hgweb/hgwebdir_mod.py @@ -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('/'): diff --git a/mercurial/hgweb/server.py b/mercurial/hgweb/server.py --- a/mercurial/hgweb/server.py +++ b/mercurial/hgweb/server.py @@ -277,7 +277,7 @@ class MercurialHTTPServer(_mixin, httpse handler.preparehttpserver(self, ui) - prefix = ui.config('web', 'prefix', '') + prefix = ui.config('web', 'prefix') if prefix: prefix = '/' + prefix.strip('/') self.prefix = prefix