We were making the "Deleting stale bottles" commit too soon; when rebuilding bottles for multiple OS versions at once, all except 1 would get merge conflicts and get dropped (see commits from Apr 22, there should be 2 "Deleting stale bottles" but there's only 1).
As far as I can tell, the other commits we make before the build (adding formula, bumping version) are fine, since if multiple concurrent builds make those commits, they'll all be identical.
I don't have anything to test this on (I only noticed the issue after all the builds for the current revision were already running) so please review carefully. I'll check that the next nightly build succeeds, but most of this won't be properly tested until the next time we need to publish a revision.
I suppose it's safest to do this both at the beginning (like before) and after each rebase (to fix the merge conflict issue), so I changed it to do that.
As far as I can tell, the other commits we make before the build (adding formula, bumping version) are fine, since if multiple concurrent builds make those commits, they'll all be identical.
I don't have anything to test this on (I only noticed the issue after all the builds for the current revision were already running) so please review carefully. I'll check that the next nightly build succeeds, but most of this won't be properly tested until the next time we need to publish a revision.