Merge "Move out the merge change step out of Submit#apply"

This commit is contained in:
ekempin
2017-05-05 07:22:05 +00:00
committed by Gerrit Code Review

View File

@@ -209,6 +209,11 @@ public class Submit
submitter = rsrc.getUser().asIdentifiedUser();
}
return new Output(mergeChange(rsrc, submitter, input));
}
public Change mergeChange(RevisionResource rsrc, IdentifiedUser submitter, SubmitInput input)
throws OrmException, RestApiException, IOException {
Change change = rsrc.getChange();
if (!change.getStatus().isOpen()) {
throw new ResourceConflictException("change is " + ChangeUtil.status(change));
@@ -235,7 +240,7 @@ public class Submit
switch (change.getStatus()) {
case MERGED:
return new Output(change);
return change;
case NEW:
ChangeMessage msg = getConflictMessage(rsrc);
if (msg != null) {