bug 1338643, allow for empty pushes in changetracker, r?gps draft
authorAxel Hecht <axel@pike.org>
Thu, 23 Mar 2017 19:20:55 +0100
changeset 10536 23adcbd58fc590aa0baf1d57e3a9f7080027d3e3
parent 10535 3f3f408b2ade0cf0048f457e52a5586ef836b30a
push id1587
push useraxel@mozilla.com
push dateThu, 23 Mar 2017 18:22:18 +0000
reviewersgps
bugs1338643
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
pylib/mozautomation/mozautomation/changetracker.py
--- 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']]