Merge changes from topics 'mergeop-refactor', 'change-data-submit-type'

* changes:
  Tie CommitMergeStatus explicitly to submit strategies
  CommitMergeStatus: Remove REVISION_GONE and NO_PATCH_SET
  MergeValidationException: Allow arbitrary string messages
  MergeOp: Simplify updateChangeStatus
  MergeOp: Check commit status separately after merge strategies
  Remove unnecessary calls to SubmitRuleEvaluator#setPatchSet
  ChangeScreen: Use submit type from ChangeInfo
  Expose submit type in ChangeInfo
  Store SubmitTypeRecord lazily in ChangeData
  SubmitTypeRecord: Make fields final and document them
This commit is contained in:
Dave Borowitz
2015-12-25 18:10:52 +00:00
committed by Gerrit Code Review
30 changed files with 290 additions and 402 deletions

View File

@@ -179,6 +179,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -270,6 +271,9 @@ public class ReceiveCommits {
public RestApiException apply(Exception input) {
if (input instanceof RestApiException) {
return (RestApiException) input;
} else if ((input instanceof ExecutionException)
&& (input.getCause() instanceof RestApiException)) {
return (RestApiException) input.getCause();
}
return new RestApiException("Error inserting change/patchset", input);
}
@@ -844,6 +848,9 @@ public class ReceiveCommits {
f.checkedGet();
}
magicBranch.cmd.setResult(OK);
} catch (ResourceConflictException e) {
addMessage(e.getMessage());
reject(magicBranch.cmd, "conflict");
} catch (RestApiException err) {
log.error("Can't insert change/patchset for " + project.getName()
+ ". " + err.getMessage(), err);