LabelNormalizer: record what happens to each approval
Unchanged, updated, and deleted approvals may need to be handled separately by the underlying storage layer, e.g. in Submit. Record this information in the result of LabelNormalizer.normalize(). For callers that don't care whether approvals were updated or not, provide a convenience method to concatenate them. Change-Id: Ifea7db3f7333d3ddb5e4d647a1d7e8eeb8cbff11
This commit is contained in:
@@ -81,8 +81,8 @@ public class ApprovalCopier {
|
||||
db.patchSetApprovals().insert(getForPatchSet(db, ctl, ps));
|
||||
}
|
||||
|
||||
private List<PatchSetApproval> getForPatchSet(ReviewDb db, ChangeControl ctl,
|
||||
PatchSet ps) throws OrmException {
|
||||
private Iterable<PatchSetApproval> getForPatchSet(ReviewDb db,
|
||||
ChangeControl ctl, PatchSet ps) throws OrmException {
|
||||
ChangeData cd = changeDataFactory.create(db, ctl);
|
||||
try {
|
||||
ProjectState project =
|
||||
@@ -123,7 +123,7 @@ public class ApprovalCopier {
|
||||
}
|
||||
}
|
||||
}
|
||||
return labelNormalizer.normalize(ctl, byUser.values());
|
||||
return labelNormalizer.normalize(ctl, byUser.values()).getNormalized();
|
||||
} finally {
|
||||
repo.close();
|
||||
}
|
||||
|
Reference in New Issue
Block a user