Patchwork [9,of,9,V2] bugzilla: move the default regexp for fix in the config declaration

login
register
mail settings
Submitter Boris Feld
Date July 14, 2017, 3:26 p.m.
Message ID <9da870e7c1057d9067da.1500045986@FB>
Download mbox | patch
Permalink /patch/22341/
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 1500041857 -7200
#      Fri Jul 14 16:17:37 2017 +0200
# Node ID 9da870e7c1057d9067da0eebea81d6adcc170664
# Parent  7a9c79633732fd90db14a33d13803cf34eb35028
# EXP-Topic config.register.bugzilla
bugzilla: move the default regexp for fix in the config declaration

This mimic the change requested by Yuya for '_default_bug_re'.
Augie Fackler - July 14, 2017, 4:42 p.m.
On Fri, Jul 14, 2017 at 05:26:26PM +0200, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld@octobus.net>
> # Date 1500041857 -7200
> #      Fri Jul 14 16:17:37 2017 +0200
> # Node ID 9da870e7c1057d9067da0eebea81d6adcc170664
> # Parent  7a9c79633732fd90db14a33d13803cf34eb35028
> # EXP-Topic config.register.bugzilla
> bugzilla: move the default regexp for fix in the config declaration

queued, thanks

Patch

diff -r 7a9c79633732 -r 9da870e7c105 hgext/bugzilla.py
--- a/hgext/bugzilla.py	Fri Jul 07 10:04:21 2017 +0200
+++ b/hgext/bugzilla.py	Fri Jul 14 16:17:37 2017 +0200
@@ -338,7 +338,10 @@ 
     default='bugs',
 )
 configitem('bugzilla', 'fixregexp',
-    default=lambda: bugzilla._default_fix_re,
+    default=(r'fix(?:es)?\s*(?:bugs?\s*)?,?\s*'
+             r'(?:nos?\.?|num(?:ber)?s?)?\s*'
+             r'(?P<ids>(?:#?\d+\s*(?:,?\s*(?:and)?)?\s*)+)'
+             r'\.?\s*(?:h(?:ours?)?\s*(?P<hours>\d*(?:\.\d+)?))?')
 )
 configitem('bugzilla', 'fixresolution',
     default='FIXED',
@@ -989,11 +992,6 @@ 
         'restapi': bzrestapi,
         }
 
-    _default_fix_re = (r'fix(?:es)?\s*(?:bugs?\s*)?,?\s*'
-                       r'(?:nos?\.?|num(?:ber)?s?)?\s*'
-                       r'(?P<ids>(?:#?\d+\s*(?:,?\s*(?:and)?)?\s*)+)'
-                       r'\.?\s*(?:h(?:ours?)?\s*(?P<hours>\d*(?:\.\d+)?))?')
-
     def __init__(self, ui, repo):
         self.ui = ui
         self.repo = repo