self.template = None
self.urlprefix = None
self.host = socket.getfqdn()
+ self.cialike = None
self.filtercmd = None
# Color highlighting is disabled by default.
self.color = None
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"
+ self.cialike = do("git config --get irker.cialike")
self.filtercmd = do("git config --get irker.filtercmd")
# These are git-specific
self.refname = do("git symbolic-ref HEAD 2>/dev/null")
self.urlprefix = (ui.config('irker', 'urlprefix') or
ui.config('web', 'baseurl') or '')
if self.urlprefix:
- self.urlprefix = self.urlprefix.rstrip('/') + '/rev'
# self.commit is appended to this by do_overrides
+ self.urlprefix = self.urlprefix.rstrip('/') + '/rev'
+ self.cialike = ui.config('irker', 'cialike')
+ self.filtercmd = ui.config('irker', 'filtercmd')
if not self.project:
self.project = os.path.basename(self.repository.root.rstrip('/'))
self.do_overrides()
sys.stderr.write("irkerhook.py: could not decode JSON: %s\n" % data)
raise SystemExit, 1
+ # Rewrite the file list if too long. The objective here is only
+ # to be easier on the eyes.
+ if extractor.cialike \
+ and extractor.cialike.lower() != "none" \
+ and len(metadata.files) > int(extractor.cialike):
+ files = metadata.files.split()
+ dirs = set([d.rpartition('/')[0] for d in files])
+ if len(dirs) == 1:
+ metadata.files = "(%s files)" % (len(files),)
+ else:
+ metadata.files = "(%s files in %s dirs)" % (len(files), len(dirs))
# 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
a value less than 2, however, would probably be unwise.</para>
</listitem>
</varlistentry>
+<varlistentry>
+<term>cialike</term>
+<listitem>
+<para>If not empty and not "None", this emulates the old CIA behavior
+of dropping long lists of files in favor of a summary of the form (N
+files in M directories). The value must be numeric giving a threshold
+value for the length of the file list in characters.</para>
+</listitem>
+</varlistentry>
</variablelist>
<refsect2 id="git"><title>git</title>