changeset 33463:037d809737fb

configitems: register the 'bugzilla.strip' config
author Boris Feld <boris.feld@octobus.net>
date Fri, 07 Jul 2017 10:04:09 +0200
parents c841712253d5
children 56f98a3f97d2
files hgext/bugzilla.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/bugzilla.py	Fri Jul 07 10:04:07 2017 +0200
+++ b/hgext/bugzilla.py	Fri Jul 07 10:04:09 2017 +0200
@@ -357,6 +357,9 @@
              r'(?P<ids>(?:\d+\s*(?:,?\s*(?:and)?)?\s*)+)'
              r'\.?\s*(?:h(?:ours?)?\s*(?P<hours>\d*(?:\.\d+)?))?')
 )
+configitem('bugzilla', 'strip',
+    default=0,
+)
 
 class bzaccess(object):
     '''Base class for access to Bugzilla.'''
@@ -1055,7 +1058,7 @@
         def webroot(root):
             '''strip leading prefix of repo root and turn into
             url-safe path.'''
-            count = int(self.ui.config('bugzilla', 'strip', 0))
+            count = int(self.ui.config('bugzilla', 'strip'))
             root = util.pconvert(root)
             while count > 0:
                 c = root.find('/')