Skip to content

Commit

Permalink
reformat change iteration for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
opalmer committed Jun 22, 2014
1 parent 1ca2062 commit 91a7150
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions master/contrib/github_buildbot.py
Expand Up @@ -131,15 +131,22 @@ def process_change(self, payload, user, repo, repo_url, project, request):
if payload['deleted'] is True:
logging.info("Branch %r deleted, ignoring", branch)
else:
changes = [{'revision': c['id'],
'revlink': c['url'],
'who': c['author']['username'] + " <" + c['author']['email'] + "> ",
'comments': c['message'],
'repository': payload['repository']['url'],
'files': c['added'] + c['removed'] + c['modified'],
'project': project,
'branch': branch}
for c in payload['commits']]
changes = []

for change in payload['commits']:
files = change['added'] + change['removed'] + change['modified']
who = "%s <%s>" % (
change['author']['username'], change['author']['email'])

changes.append(
{'revision': change['id'],
'revlink': change['url'],
'who': who,
'comments': change['message'],
'repository': payload['repository']['url'],
'files': files,
'project': project,
'branch': branch})

if not changes:
logging.warning("No changes found")
Expand Down

0 comments on commit 91a7150

Please sign in to comment.