Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
####### CHANGESOURCES
+branchNames = [branches[b]["name"] for b in branches]
# find targets
targets = [ ]
def GetNextBuild(builder, requests):
for r in requests:
- if r.properties and r.properties.hasProperty("tag"):
- return r
+ if r.properties:
+ # order tagged build first
+ if r.properties.hasProperty("tag"):
+ return r
+ # then order by branch order
+ pbranch = r.properties.getProperty("branch")
+ for name in branchNames:
+ if pbranch == name:
+ return r
r = requests[0]
log.msg("GetNextBuild: {:>20} id: {} bsid: {}".format(builder.name, r.id, r.bsid))