Merge "Move out the merge change step out of Submit#apply"
This commit is contained in:
		| @@ -209,6 +209,11 @@ public class Submit | |||||||
|       submitter = rsrc.getUser().asIdentifiedUser(); |       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(); |     Change change = rsrc.getChange(); | ||||||
|     if (!change.getStatus().isOpen()) { |     if (!change.getStatus().isOpen()) { | ||||||
|       throw new ResourceConflictException("change is " + ChangeUtil.status(change)); |       throw new ResourceConflictException("change is " + ChangeUtil.status(change)); | ||||||
| @@ -235,7 +240,7 @@ public class Submit | |||||||
|  |  | ||||||
|     switch (change.getStatus()) { |     switch (change.getStatus()) { | ||||||
|       case MERGED: |       case MERGED: | ||||||
|         return new Output(change); |         return change; | ||||||
|       case NEW: |       case NEW: | ||||||
|         ChangeMessage msg = getConflictMessage(rsrc); |         ChangeMessage msg = getConflictMessage(rsrc); | ||||||
|         if (msg != null) { |         if (msg != null) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 ekempin
					ekempin