aboutsummaryrefslogtreecommitdiffstats
path: root/deployment/mgagit/templates
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2013-12-14 21:17:18 +0000
committerColin Guthrie <colin@mageia.org>2013-12-14 21:17:18 +0000
commit21fd29758a5cae09fd66fe015d98a6d2d35cdb7a (patch)
tree6b56a81657821448dd73836226f73337f4468eea /deployment/mgagit/templates
parente82ed8c7a20f246e17d4eb6e11b27c288e7da66b (diff)
downloadpuppet-21fd29758a5cae09fd66fe015d98a6d2d35cdb7a.tar
puppet-21fd29758a5cae09fd66fe015d98a6d2d35cdb7a.tar.gz
puppet-21fd29758a5cae09fd66fe015d98a6d2d35cdb7a.tar.bz2
puppet-21fd29758a5cae09fd66fe015d98a6d2d35cdb7a.tar.xz
puppet-21fd29758a5cae09fd66fe015d98a6d2d35cdb7a.zip
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
Diffstat (limited to 'deployment/mgagit/templates')
-rwxr-xr-xdeployment/mgagit/templates/git-post-receive-hook8
1 files changed, 7 insertions, 1 deletions
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)