bug 1338643, allow for empty pushes in changetracker, r?gps
On autoland, we have removed the changesets for pushes, which
leads to an empty list of changesets for that push.
changetracker should just ignore that.
MozReview-Commit-ID: D1cyWvw0fIt
--- a/pylib/mozautomation/mozautomation/changetracker.py
+++ b/pylib/mozautomation/mozautomation/changetracker.py
@@ -120,16 +120,18 @@ class ChangeTracker(object):
tree_id = self.tree_id(tree, url)
last_push_id = self.last_push_id(tree)
if last_push_id is None:
last_push_id = -1
with self._db:
for push_id, push in repo.push_info(start_id=last_push_id + 1):
+ if not push['changesets']:
+ continue
self._db.execute('INSERT INTO pushes (push_id, tree_id, time, '
'user) VALUES (?, ?, ?, ?)', [push_id, tree_id, push['date'],
push['user']])
head = buffer(binascii.unhexlify(push['changesets'][-1]))
params = [(buffer(binascii.unhexlify(c)), head, push_id,
tree_id) for c in push['changesets']]