bug 613429: merge patches to sort unimportant and important changes
authorDustin J. Mitchell <dustin@mozilla.com>
Tue, 23 Nov 2010 14:05:00 -0600
changeset 107 5904e51e155bc07b7c3bb2e7f9515b249720cbe7
parent 106 f189210bc7de4c3f7f162134d47cc9bbc416c9c9
child 110 fb22c62a98564e75b1bfdbf1743f426a8d81ac8c
child 111 e7d90277a2a92a7e77780d048e92bc99b7e0c3ba
push id42
push userdmitchell@mozilla.com
push dateTue, 23 Nov 2010 20:05:25 +0000
bugs613429
bug 613429: merge patches to sort unimportant and important changes A merge of buildbot commits c3e9f1e772cca6be557e4e38388da92d8ada6c9c 9beb205847527c814cc47605f2371fbbf48dfce0
master/buildbot/schedulers/basic.py
--- a/master/buildbot/schedulers/basic.py
+++ b/master/buildbot/schedulers/basic.py
@@ -140,16 +140,22 @@ class Scheduler(base.BaseScheduler, base
                 return self.stableAt + 1.0
 
         # ok, do a build
         self.stableAt = None
         self._add_build_and_remove_changes(t, all_changes)
         return None
 
     def _add_build_and_remove_changes(self, t, all_changes):
+        # all_changes is segregated into important and unimportant
+        # changes, but we need it ordered earliest to latest, based
+        # on change number, since the SourceStamp will be created
+        # based on the final change.
+        all_changes.sort(key=lambda c : c.number)
+
         db = self.parent.db
         if self.treeStableTimer is None:
             # each Change gets a separate build
             for c in all_changes:
                 ss = SourceStamp(changes=[c])
                 ssid = db.get_sourcestampid(ss, t)
                 self.create_buildset(ssid, "scheduler", t)
         else: