From 21fd29758a5cae09fd66fe015d98a6d2d35cdb7a Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Sat, 14 Dec 2013 21:17:18 +0000 Subject: mgagit: Suppress the 'Bug links:' section when posting comment to bugzilla. It is only suppressed when a single bug is referenced. If multiple bugs are referenced (including external bug trackers) then it will be included. mga#11987 --- deployment/mgagit/templates/git-post-receive-hook | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'deployment/mgagit/templates') diff --git a/deployment/mgagit/templates/git-post-receive-hook b/deployment/mgagit/templates/git-post-receive-hook index 0ccdb3bf..5cdc37f3 100755 --- a/deployment/mgagit/templates/git-post-receive-hook +++ b/deployment/mgagit/templates/git-post-receive-hook @@ -131,7 +131,13 @@ class LinksRevision(git_multimail.Revision): bz = self.bugzilla_init() # Mask email address - comment = output[0:idx] + comment = None + # Suppress the "Bug links:" section if only one bug + # is referenced + if len(bugs) == 1 and len(bugs['Mageia']) == 1: + comment = output[0:idx-4] + else: + comment = output[0:idx] comment[1] = re.sub(r'^(Author: [^@]*)@.*(>)?', r'\1@...>', comment[1]) comment = "".join(comment) -- cgit v1.2.1