From 45541febead4781f7814800a922d9f1dc69e579a Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Sat, 15 Nov 2008 13:28:02 +0100 Subject: don't require bugnumbers to start with '#' use the regex from Debian policy instead --- git-dch | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'git-dch') diff --git a/git-dch b/git-dch index 0ba7fed..30785c1 100755 --- a/git-dch +++ b/git-dch @@ -32,6 +32,8 @@ from gbp.command_wrappers import (Command, CommandExecFailed) snapshot_re = re.compile("\s*\*\* SNAPSHOT build @(?P[a-z0-9]+)\s+\*\*") author_re = re.compile('Author: (?P.*) <(?P.*)>') +bug_r = r'(?:bug)?\#?\s?\d+' +bug_re = re.compile(bug_r) def system(cmd): try: @@ -190,8 +192,7 @@ def parse_commit(repo, commitid, options): thanks = '' closes = '' bugs = {} - bts_closes = re.compile(r'(?P%s):\s+#[0-9]+' % options.meta_closes) - bts_bug = re.compile(r'#[0-9]+') + bts_closes = re.compile(r'(?P%s):\s+%s' % (options.meta_closes, bug_r)) commit = repo.show(commitid) author, email = get_author(commit) @@ -202,11 +203,11 @@ def parse_commit(repo, commitid, options): line = line[4:] m = bts_closes.match(line) if m: - nums = bts_bug.findall(line) + bug_nums = [ bug.strip() for bug in bug_re.findall(line) ] try: - bugs[m.group('bts')] += nums + bugs[m.group('bts')] += bug_nums except KeyError: - bugs[m.group('bts')] = nums + bugs[m.group('bts')] = bug_nums elif line.startswith('Thanks: '): thanks = line.split(' ', 1)[1].strip() else: # normal commit message -- cgit v1.2.3