Patchwork [2,of,9,V2] configitems: register the 'bugzilla.strip' config

login
register
mail settings
Submitter Boris Feld
Date July 14, 2017, 3:26 p.m.
Message ID <57dd90ce60747fa07e60.1500045979@FB>
Download mbox | patch
Permalink /patch/22334/
State Accepted
Headers show

Comments

Boris Feld - July 14, 2017, 3:26 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1499414649 -7200
#      Fri Jul 07 10:04:09 2017 +0200
# Node ID 57dd90ce60747fa07e60f6924b8337aa1ea11620
# Parent  0a8570d6f449291b4c64733d67d4702f30d9e6a8
# EXP-Topic config.register.bugzilla
configitems: register the 'bugzilla.strip' config

Patch

diff -r 0a8570d6f449 -r 57dd90ce6074 hgext/bugzilla.py
--- 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('/')