diff options
Diffstat (limited to 'gbp/rpm/policy.py')
-rw-r--r-- | gbp/rpm/policy.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gbp/rpm/policy.py b/gbp/rpm/policy.py index 82d6abee..9fae0457 100644 --- a/gbp/rpm/policy.py +++ b/gbp/rpm/policy.py @@ -167,8 +167,6 @@ class RpmPkgPolicy(PkgPolicy): # Maximum length for a changelog entry line max_entry_line_length = 76 - # Bug tracking system related meta tags recognized from git commit msg - bts_meta_tags = ("Close", "Closes", "Fixes", "Fix") # Regexp for matching bug tracking system ids (e.g. "bgo#123") bug_id_re = r'[A-Za-z0-9#_\-]+' @@ -180,15 +178,18 @@ class RpmPkgPolicy(PkgPolicy): @param lines: commit message @type lines: C{list} of C{str} - @param meta_tags: meta tags to look for - @type meta_tags: C{tuple} of C{str} + @param meta_tags: meta tags (regexp) to look for + @type meta_tags: C{str} @return: bts-ids per meta tag and the non-mathced lines @rtype: (C{dict}, C{list} of C{str}) """ + if not meta_tags: + return ({}, lines[:]) + tags = {} other_lines = [] - bts_re = re.compile(r'^(?P<tag>%s):\s*(?P<ids>.*)' % - ('|'.join(meta_tags)), re.I) + bts_re = re.compile(r'^(?P<tag>%s):\s*(?P<ids>.*)' % meta_tags, + re.I) bug_id_re = re.compile(cls.bug_id_re) for line in lines: match = bts_re.match(line) @@ -244,7 +245,7 @@ class RpmPkgPolicy(PkgPolicy): return None # Parse and filter out bts-related meta-tags - bts_tags, body = cls._parse_bts_tags(body, cls.bts_meta_tags) + bts_tags, body = cls._parse_bts_tags(body, kwargs['meta_bts']) # Additional filtering body = cls._extra_filter(body, kwargs['ignore_re']) |