--- a/hooks-queue.py Thu Jul 21 23:38:15 2016 +0800
+++ b/hooks-queue.py Fri Jul 22 10:29:31 2016 +0800
return self.application.rconn
- def push(self, base, hashes):
+ def push(self, base, changes):
+ item['change'] = change
logging.debug('Pushing %s', data)
self.rconn.rpush('candolint:queue:changes', data)
logging.info('Pushed a change for %s', item['repo'])
- self.finish({'result': 'OK', 'queued': len(hashes)})
+ self.finish({'result': 'OK', 'queued': len(changes)})
class BitbucketHookHandler(BaseHookHandler):
'source': 'bitbucket.org'
for change in payload['push']['changes']:
for head in change['new'].get('heads', []):
- hashes.add(head['hash'])
- hashes.add(change['new']['target']['hash'])
+ changes.add(head['hash'])
+ changes.add(change['new']['target']['hash'])
- self.push(base, hashes)
+ self.push(base, changes)
class CandolintHooks(Application):