Patchwork [04,of,10] configitems: register the 'bugzilla.strip' config

login
register
mail settings
Submitter Boris Feld
Date July 12, 2017, 12:41 p.m.
Message ID <69feb1d1d3d3b2d2dee3.1499863287@FB>
Download mbox | patch
Permalink /patch/22255/
State Accepted
Headers show

Comments

Boris Feld - July 12, 2017, 12:41 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 69feb1d1d3d3b2d2dee30941cc910b7a1b98b04b
# Parent  1ca312b6211d3bde677c53972abd95c4be45f8ff
# EXP-Topic config.register.bugzilla
configitems: register the 'bugzilla.strip' config

Patch

diff -r 1ca312b6211d -r 69feb1d1d3d3 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
@@ -355,6 +355,9 @@ 
 configitem('bugzilla', 'regexp',
     default=lambda: bugzilla._default_bug_re,
 )
+configitem('bugzilla', 'strip',
+    default=0,
+)
 
 class bzaccess(object):
     '''Base class for access to Bugzilla.'''
@@ -1057,7 +1060,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('/')