# HG changeset patch # User Teemu Piippo # Date 1417272812 -7200 # Node ID 2a56ccf6778242f461dc439786255d9250be3407 # Parent 147d78eea80b508ea87a9bf570df0095056d0ea8 - be more liberal on posting commit messages to IRC - don't log REST connections to log channel anymore diff -r 147d78eea80b -r 2a56ccf67782 hgpoll.py --- a/hgpoll.py Sat Nov 29 16:44:09 2014 +0200 +++ b/hgpoll.py Sat Nov 29 16:53:32 2014 +0200 @@ -326,41 +326,37 @@ print 'Processing new commit %s...' % commit_node try: - if usesandbox: - commit_author = get_commit_data (zanrepo, commit_node, '{author}') - commit_url = '%s/commits/%s' % (repo_url, commit_node) - commit_email = '' + commit_author = get_commit_data (zanrepo, commit_node, '{author}') + commit_url = '%s/commits/%s' % (repo_url, commit_node) + commit_email = '' - # Remove the email address from the author if possible - rex = re.compile (r'^(.+) <([^>]+)>$.*') - match = rex.match (commit_author) - if match: - commit_author = match.group (1) - commit_email = match.group (2) + # Remove the email address from the author if possible + rex = re.compile (r'^(.+) <([^>]+)>$.*') + match = rex.match (commit_author) + if match: + commit_author = match.group (1) + commit_email = match.group (2) - commit_trackeruser = Config.find_developer_by_email (commit_email) - committer = commit_trackeruser if commit_trackeruser != '' else commit_author + commit_trackeruser = Config.find_developer_by_email (commit_email) + committer = commit_trackeruser if commit_trackeruser != '' else commit_author - for irc_client in Irc.all_clients: - for channel in irc_client.channels: - if 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)) - - for line in commit_message.split ('\n'): - irc_client.privmsg (channel.get_value ('name'), line) + for irc_client in Irc.all_clients: + 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)) - num_commits += 1 - continue + for line in commit_message.split ('\n'): + irc_client.privmsg (channel.get_value ('name'), line) - rex = re.compile (r'^.*(fixes|resolves|addresses|should fix) ([0-9]+).*$') - match = rex.match (commit_message) + if not usesandbox: + rex = re.compile (r'^.*(fixes|resolves|addresses|should fix) ([0-9]+).*$') + match = rex.match (commit_message) - if not match: - continue # no "fixes" message in the commit + if match: + announce_ticket_resolved (match.group (2), commit_node) - announce_ticket_resolved (match.group (2), commit_node) num_commits += 1 except Exception as e: Irc.broadcast ('Error while processing %s: %s' % (commit_node, e)) diff -r 147d78eea80b -r 2a56ccf67782 rest.py --- a/rest.py Sat Nov 29 16:44:09 2014 +0200 +++ b/rest.py Sat Nov 29 16:53:32 2014 +0200 @@ -194,7 +194,6 @@ sock.close() return - Irc.broadcast ('REST connection from %s:%s' % address) conn = RESTConnection (sock, address) def handle_error (self):