From 5f87f97468726802da8fbd60f8adfb7652ca1b95 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Sun, 22 Dec 2013 13:31:11 +0000 Subject: mgagit: Match multiple bug references on a single line --- deployment/mgagit/templates/git-post-receive-hook | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'deployment/mgagit') diff --git a/deployment/mgagit/templates/git-post-receive-hook b/deployment/mgagit/templates/git-post-receive-hook index 5cdc37f3..71235254 100755 --- a/deployment/mgagit/templates/git-post-receive-hook +++ b/deployment/mgagit/templates/git-post-receive-hook @@ -155,13 +155,12 @@ class LinksRevision(git_multimail.Revision): if m: commit = m.group(1); for tracker in BUG_REFS.keys(): - m = BUG_REFS[tracker]['re'].search(line) - if m: - bug = m.group(1) + foundbugs = BUG_REFS[tracker]['re'].findall(line) + if len(foundbugs): if not tracker in bugs: - bugs[tracker] = [bug] - elif not bug in bugs[tracker]: - bugs[tracker].append(bug) + bugs[tracker] = foundbugs + else: + bugs[tracker] = list(set(bugs[tracker] + foundbugs)) return output -- cgit v1.2.1