Submit whole topic: check if all changes are submittable
We were checking only if the current change was submittable, but we really need to check all changes. Change-Id: Ief424e7bd32f5d552b3adc18fc3c7c2ff7c46df2
This commit is contained in:
@@ -391,16 +391,20 @@ public class Submit implements RestModifyView<RevisionResource, SubmitInput>,
|
|||||||
ReviewDb db = dbProvider.get();
|
ReviewDb db = dbProvider.get();
|
||||||
ChangeData cd = changeDataFactory.create(db, rsrc.getControl());
|
ChangeData cd = changeDataFactory.create(db, rsrc.getControl());
|
||||||
|
|
||||||
List<SubmitRecord> submitRecords = checkSubmitRule(cd,
|
List<ChangeData> changesByTopic = queryProvider.get().byTopicOpen(topic);
|
||||||
rsrc.getPatchSet(), force);
|
String problems = problemsForSubmittingChanges(changesByTopic, caller);
|
||||||
|
if (problems != null) {
|
||||||
|
throw new ResourceConflictException(problems);
|
||||||
|
}
|
||||||
|
|
||||||
Change change = rsrc.getChange();
|
Change change = rsrc.getChange();
|
||||||
ChangeUpdate update = updateFactory.create(rsrc.getControl(), timestamp);
|
ChangeUpdate update = updateFactory.create(rsrc.getControl(), timestamp);
|
||||||
|
|
||||||
|
List<SubmitRecord> submitRecords = checkSubmitRule(cd,
|
||||||
|
rsrc.getPatchSet(), force);
|
||||||
update.submit(submitRecords);
|
update.submit(submitRecords);
|
||||||
|
|
||||||
db.changes().beginTransaction(change.getId());
|
db.changes().beginTransaction(change.getId());
|
||||||
|
|
||||||
List<ChangeData> changesByTopic = queryProvider.get().byTopicOpen(topic);
|
|
||||||
try {
|
try {
|
||||||
BatchMetaDataUpdate batch = approve(rsrc, update, caller, timestamp);
|
BatchMetaDataUpdate batch = approve(rsrc, update, caller, timestamp);
|
||||||
// Write update commit after all normalized label commits.
|
// Write update commit after all normalized label commits.
|
||||||
|
|||||||
Reference in New Issue
Block a user