In 1.5 trying to appease pylint broke the Mercurial hook.
Added credits for contributors in hacking.txt.
Fix the aging out of connections when we hit a resource limit.
- Add option for external filtering.
1.5 @ 2012-10-03
Mercurial support.
"Ship a notification for the specified commit."
metadata = extractor.commit_factory(commit)
- # Run through an external filter if required.
- channels = extractor.channels.split(",")
- if extractor.filtercmd:
- channels = filterc(extractor.filtercmd, channels, metadata) or []
-
# Message reduction. The assumption here is that IRC can't handle
# lines more than 510 characters long. If we exceed that length, we
# try knocking out the file list, on the theory that for notification
privmsg = str(metadata)
# Anti-spamming guard.
+ channels = extractor.channels.split(",")
if extractor.maxchannels != 0:
channels = channels[:extractor.maxchannels]
</refsect2>
-<refsect2 id="filter"><title>Filtering</title>
-
-<para>It is possible to filter commits before sending them to <application>irkerd</application>.</para>
-
-<para>You have to specify the <option>filtercmd</option> option, which will be the command <application>irkerhook.py</application> will run. This command should accept two arguments: the first one being the commit metadata, the second one being the channel list. The command should then return a tuple, with the new channel list then an optional list of commit metadata updates.</para>
-
-<para>Below is an example filter:</para>
-
-<programlisting>
-#!/usr/bin/env python
-import sys, json
-channels = json.loads(sys.argv[1])
-commit = json.loads(sys.argv[2])
-update = {}
-# we have two bobs in the project
-if commit.get("mail", "") == "bob@foo":
- update["author"] = "bobm"
-if commit.get("mail", "") == "bob@bar":
- update["author"] = "bobp"
-# ignore some commits
-if 'automated commit' in commit['logmsg']:
- channels = []
-print json.dumps([channels, update])
-</programlisting>
-
-</refsect2>
-
</refsect1>
<refsect1 id='options'><title>OPTIONS</title>