Back out laurentb's filtering - good idea, but not ready for a stable release.
authorEric S. Raymond <esr@thyrsus.com>
Thu, 4 Oct 2012 04:23:24 +0000 (00:23 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 4 Oct 2012 04:23:24 +0000 (00:23 -0400)
NEWS
irkerhook.py
irkerhook.xml

diff --git a/NEWS b/NEWS
index d9afdcd206cb19dc5073591da65843b3832d51fc..ba4881c2c30edd8b5c033109b0839a6c25bb6795 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,7 +4,6 @@
   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.
index 239fbef5933ab4be34db88461ad0c7eb797a0048..96d6de2cc4d9e7fffae391fdd24416ad21e2ff29 100755 (executable)
@@ -368,11 +368,6 @@ def ship(extractor, commit, debug):
     "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
@@ -385,6 +380,7 @@ def ship(extractor, commit, debug):
         privmsg = str(metadata)
 
     # Anti-spamming guard.
+    channels = extractor.channels.split(",")
     if extractor.maxchannels != 0:
         channels = channels[:extractor.maxchannels]
 
index a44c4f2edd30e87f69dc7b0401ab7773ea94566a..e10d5b838b5b576f7f96fb24b844d4920f2a63c2 100644 (file)
@@ -296,33 +296,6 @@ exists.</para>
 
 </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>