Fix storing of approvals in notedb on merge with CherryPick strategy

The approvals which are copied to the new patch set that is created by
the CherryPick merge strategy were only stored in the database but not
in notedb.

This fixes several tests that were failing when notedb was enabled.

Change-Id: I547cad7d79f891a7448a19fdc8613ce919835d5b
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2015-11-10 12:18:36 -08:00
parent cf75de2722
commit 7c40504ecf

View File

@@ -176,6 +176,7 @@ public class CherryPick extends SubmitStrategy {
// Merge conflict; don't update change.
return;
}
ctx.getChangeUpdate().setPatchSetId(psId);
PatchSet ps = new PatchSet(psId);
ps.setCreatedOn(ctx.getWhen());
ps.setUploader(args.caller.getAccountId());
@@ -191,6 +192,7 @@ public class CherryPick extends SubmitStrategy {
for (PatchSetApproval a : args.approvalsUtil.byPatchSet(
args.db, toMerge.getControl(), toMerge.getPatchsetId())) {
approvals.add(new PatchSetApproval(ps.getId(), a));
ctx.getChangeUpdate().putApproval(a.getLabel(), a.getValue());
}
args.db.patchSetApprovals().insert(approvals);