aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2016-05-25 13:45:45 -0400
committerEric S. Raymond <esr@thyrsus.com>2016-05-25 13:45:45 -0400
commit0fe0030195dbdb0d12369dc0b311bc91c2444df4 (patch)
tree470fdb2b3dc3b3cffdfe7690fae2f9f1efcf4394
parentMerge branch 'master' into 'master' (diff)
downloadirker-0fe0030195dbdb0d12369dc0b311bc91c2444df4.tar.xz
Implement template variable.
-rw-r--r--NEWS3
-rwxr-xr-xirkerhook.py4
-rw-r--r--irkerhook.xml9
3 files changed, 14 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index f03370f..d9f5489 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
irker history
+Repository header:
+ Add the ability to set the notification-message template (Debian bug #824512)
+
2.17: 2016-03-14
Add a reconnect delay (Debian bug #749650).
Add proxy support (requres setting some variables in the source file).
diff --git a/irkerhook.py b/irkerhook.py
index 4f96b1c..9768eac 100755
--- a/irkerhook.py
+++ b/irkerhook.py
@@ -237,7 +237,7 @@ class GitExtractor(GenericExtractor):
self.channels = do("git config --get irker.channels")
self.email = do("git config --get irker.email")
self.tcp = do("git config --bool --get irker.tcp")
- self.template = '%(bold)s%(project)s:%(reset)s %(green)s%(author)s%(reset)s %(repo)s:%(yellow)s%(branch)s%(reset)s * %(bold)s%(rev)s%(reset)s / %(bold)s%(files)s%(reset)s: %(logmsg)s %(brown)s%(url)s%(reset)s'
+ self.template = do("git config --get irker.template") or '%(bold)s%(project)s:%(reset)s %(green)s%(author)s%(reset)s %(repo)s:%(yellow)s%(branch)s%(reset)s * %(bold)s%(rev)s%(reset)s / %(bold)s%(files)s%(reset)s: %(logmsg)s %(brown)s%(url)s%(reset)s'
self.tinyifier = do("git config --get irker.tinyifier") or default_tinyifier
self.color = do("git config --get irker.color")
self.urlprefix = do("git config --get irker.urlprefix") or "gitweb"
@@ -374,7 +374,7 @@ class HgExtractor(GenericExtractor):
self.channels = ui.config('irker', 'channels')
self.email = ui.config('irker', 'email')
self.tcp = str(ui.configbool('irker', 'tcp')) # converted to bool again in do_overrides
- self.template = '%(bold)s%(project)s:%(reset)s %(green)s%(author)s%(reset)s %(repo)s:%(yellow)s%(branch)s%(reset)s * %(bold)s%(rev)s%(reset)s / %(bold)s%(files)s%(reset)s: %(logmsg)s %(brown)s%(url)s%(reset)s'
+ self.template = ui.config('irker', 'template') or '%(bold)s%(project)s:%(reset)s %(green)s%(author)s%(reset)s %(repo)s:%(yellow)s%(branch)s%(reset)s * %(bold)s%(rev)s%(reset)s / %(bold)s%(files)s%(reset)s: %(logmsg)s %(brown)s%(url)s%(reset)s'
self.tinyifier = ui.config('irker', 'tinyifier') or default_tinyifier
self.color = ui.config('irker', 'color')
self.urlprefix = (ui.config('irker', 'urlprefix') or
diff --git a/irkerhook.xml b/irkerhook.xml
index 72918cf..383fa36 100644
--- a/irkerhook.xml
+++ b/irkerhook.xml
@@ -163,6 +163,15 @@ a threshold value for the length of the file list in
characters.</para>
</listitem>
</varlistentry>
+<varlistentry>
+<term>template</term>
+<listitem>
+<para>Set the template used to generate notification messages. Only
+available in VCses with config variables; presently this means git or
+hg. All basic commit and aextractor fields, including color switches,
+are available as %() substitutions.</para>
+</listitem>
+</varlistentry>
</variablelist>
<refsect2 id="git"><title>git</title>