diff -r 87ad0c1b3405 -r b2770c43b752 hgpoll.py --- a/hgpoll.py Mon Dec 08 15:37:03 2014 -0500 +++ b/hgpoll.py Mon Dec 08 16:12:51 2014 -0500 @@ -8,6 +8,19 @@ from configfile import Config g_needCommitsTxtRebuild = True +def color_for_repo (repo_name): + if repo_name == 'zandronum': + color = 4 + elif repo_name == 'zandronum-stable': + color = 2 + elif repo_name == 'zandronum-sandbox': + color = 7 + elif repo_name == 'zandronum-sandbox-stable': + color = 3 + else: + color = 0 + return color + def make_commits_txt(): global g_needCommitsTxtRebuild @@ -169,7 +182,7 @@ for channel in irc_client.channels: if channel.get_value ('btannounce', default=True): irc_client.privmsg (channel.get_value ('name'), - "%s: commit %s FIXES issue %d" % (repo_name, commit_node, ticket_id)) + "\003%d%s\003: commit\0035 %s\003 addresses issue\002\0032 %d\002" % (color_for_repo (repo_name), repo_name, commit_node, ticket_id)) irc_client.privmsg (channel.get_value ('name'), "Read all about it here: " + Bt.get_ticket_url (ticket_id)) @@ -287,7 +300,7 @@ repo_url = 'https://bitbucket.org/%s/%s' % (repo_owner, repo_name) num_commits = 0 zanrepo = hgapi.Repo (repo_name) - Irc.broadcast ('%d new commits on %s' % (len (commit_data), repo_name)) + print '%d new commits on %s' % (len (commit_data), repo_name) # Drop commits that we already have i = 0 @@ -354,8 +367,8 @@ for channel in irc_client.channels: if not usesandbox or channel.get_value ('btprivate', False): irc_client.privmsg (channel.get_value ('name'), - "%s: new commit %s by %s: %s" - % (repo_name, commit_node, committer, commit_url)) + "\003%d%s\003: new commit\0035 %s\003 by\0032 %s\003: %s" + % (color_for_repo (repo_name), repo_name, commit_node, committer, commit_url)) for line in commit_message.split ('\n'): irc_client.privmsg (channel.get_value ('name'), line)