public void deleteBuild(DbBackedBuild build) {
getDatastore().delete(build);
}
public DbBackedBuild getPreviousFinishedBuildOfSameBranch(DbBackedBuild build, String branch) {
DbBackedProject project = (DbBackedProject) build.getProject();
DbBackedBuild previousBuild = getQuery(project).
limit(1).
order("-number").
field("actions.causes.branch.branch").equal(branch).