mod_hgpoll.py

changeset 110
b2770c43b752
parent 87
9e757b602586
child 111
44d9aea72947
--- a/mod_hgpoll.py	Mon Dec 08 15:37:03 2014 -0500
+++ b/mod_hgpoll.py	Mon Dec 08 16:12:51 2014 -0500
@@ -115,7 +115,14 @@
 		
 		if username != '':
 			author = username
-		
+
+		# Try prettify the diffstat
+		rex = re.compile (r'^([0-9]+): \+([0-9]+)/-([0-9]+)$')
+		match = rex.match (diffstat)
+
+		if match:
+			diffstat = "%s\003:\0033 +%s\003/\0034-%s\003" % (match.group (1), match.group (2), match.group (3))
+
 		if delta.days < 4:
 			if delta.days == 0:
 				if delta.seconds < 60:
@@ -131,7 +138,7 @@
 		else:
 			datestring = 'on %s' % (str (date))
 		
-		bot.privmsg (replyto, 'changeset %s (%s %s): committed by %s %s (%s)' % \
+		bot.privmsg (replyto, 'changeset\0035 %s (%s %s)\003: committed by\0032 %s\003 %s,\0032 %s' % \
 			(node, zanversion, date.strftime ('%y%m%d-%H%M'), author, datestring, diffstat))
 		
 		for line in message.split ('\n'):

mercurial