Patchwork [18,of,23] configitems: register the 'web.prefix' config

login
register
mail settings
Submitter Boris Feld
Date Sept. 16, 2017, 6:28 p.m.
Message ID <4372d845a3441e704ff4.1505586505@FB>
Download mbox | patch
Permalink /patch/23970/
State Accepted
Headers show

Comments

Boris Feld - Sept. 16, 2017, 6:28 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1498787149 -7200
#      ven. juin 30 03:45:49 2017 +0200
# Node ID 4372d845a3441e704ff461c6fde407f5eff55ab2
# Parent  71bc12dbd2bf981202a34f64f941949a4b3c1860
# EXP-Topic config.register.web
configitems: register the 'web.prefix' config

Patch

diff -r 71bc12dbd2bf -r 4372d845a344 mercurial/configitems.py
--- a/mercurial/configitems.py	ven. juin 30 03:45:48 2017 +0200
+++ b/mercurial/configitems.py	ven. juin 30 03:45:49 2017 +0200
@@ -631,6 +631,9 @@ 
 coreconfigitem('web', 'port',
     default=8000,
 )
+coreconfigitem('web', 'prefix',
+    default='',
+)
 coreconfigitem('worker', 'backgroundclose',
     default=dynamicdefault,
 )
diff -r 71bc12dbd2bf -r 4372d845a344 mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgwebdir_mod.py	ven. juin 30 03:45:48 2017 +0200
+++ b/mercurial/hgweb/hgwebdir_mod.py	ven. juin 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('/'):
diff -r 71bc12dbd2bf -r 4372d845a344 mercurial/hgweb/server.py
--- a/mercurial/hgweb/server.py	ven. juin 30 03:45:48 2017 +0200
+++ b/mercurial/hgweb/server.py	ven. juin 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