--- a/hooks-queue.py Sun Jul 17 23:25:29 2016 +0800
+++ b/hooks-queue.py Sun Jul 17 23:42:38 2016 +0800
'source': 'bitbucket.org'
for change in payload['push']['changes']:
- for head in change['new']['heads']:
- item.update(change=head['hash'])
+ for head in change['new'].get('heads', []):
+ hashes.add(head['hash'])
+ hashes.add(change['new']['target']['hash'])
logging.debug('Pushing %s', data)
self.rconn.rpush('candolint:queue:changes', data)
logging.info('Pushed a change for %s', item['repo'])
- self.finish({'message': 'OK, added {}'.format(len(items))})
+ self.finish({'message': 'OK, added {}'.format(len(hashes))})