BatchUpdate: Key ChangeUpdates by patch set

Allow callers to create one update per patch set of the change,
looking up by patch set ID and creating as necessary. BatchUpdate will
take care of creating a BatchMetaDataUpdate and applying the updates
in order, oldest patch set to newest patch set.

Force callers to specify the patch set instead of implicitly using the
current patch set. There were some places we were forgetting to do
this, so it's good to have made it required.

We will eventually need to update multiple patch sets at once during
submit, where approvals may be copied between patch sets.

Change-Id: I35e9378d6f9b494db516f8d8c38c5b6e75c2f4c7
This commit is contained in:
Dave Borowitz
2016-01-12 13:56:04 -05:00
parent c323b5d1e8
commit 86fa7164b0
18 changed files with 109 additions and 41 deletions

View File

@@ -1807,7 +1807,7 @@ public class ReceiveCommits {
new BatchUpdate.Op() {
@Override
public void updateChange(ChangeContext ctx) throws Exception {
ctx.getUpdate().setTopic(magicBranch.topic);
ctx.getUpdate(ps.getId()).setTopic(magicBranch.topic);
}
});
}