CommitMergeStatus: Remove REVISION_GONE and NO_PATCH_SET
That these were only set on special sentinel CodeReviewCommits with no SHA-1 attached was a smell that they don't really belong as status of a commit per se. Since the recent MergeOp refactorings, we now use a more descriptive error in every case where we used to set these values on commits; they are now dead code and can be removed. Change-Id: I8a14ac1684b68c838bd238a47f025a2aa8a138fc
This commit is contained in:
@@ -26,7 +26,6 @@ import com.google.gerrit.server.project.ChangeControl;
|
||||
import org.eclipse.jgit.errors.IncorrectObjectTypeException;
|
||||
import org.eclipse.jgit.errors.MissingObjectException;
|
||||
import org.eclipse.jgit.lib.AnyObjectId;
|
||||
import org.eclipse.jgit.lib.ObjectId;
|
||||
import org.eclipse.jgit.lib.ObjectReader;
|
||||
import org.eclipse.jgit.lib.Repository;
|
||||
import org.eclipse.jgit.revwalk.RevCommit;
|
||||
@@ -63,33 +62,6 @@ public class CodeReviewCommit extends RevCommit {
|
||||
return new CodeReviewRevWalk(reader);
|
||||
}
|
||||
|
||||
static CodeReviewCommit revisionGone(ChangeControl ctl) {
|
||||
return error(ctl, CommitMergeStatus.REVISION_GONE);
|
||||
}
|
||||
|
||||
static CodeReviewCommit noPatchSet(ChangeControl ctl) {
|
||||
return error(ctl, CommitMergeStatus.NO_PATCH_SET);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an error commit.
|
||||
* <p>
|
||||
* Should only be used for error statuses such that there is no possible
|
||||
* non-zero commit on which we could call {@link
|
||||
* #setStatusCode(CommitMergeStatus)}, enumerated in the methods above.
|
||||
*
|
||||
* @param ctl control for change that caused this error
|
||||
* @param s status
|
||||
* @return new commit instance
|
||||
*/
|
||||
private static CodeReviewCommit error(ChangeControl ctl,
|
||||
CommitMergeStatus s) {
|
||||
CodeReviewCommit r = new CodeReviewCommit(ObjectId.zeroId());
|
||||
r.setControl(ctl);
|
||||
r.statusCode = s;
|
||||
return r;
|
||||
}
|
||||
|
||||
public static class CodeReviewRevWalk extends RevWalk {
|
||||
private CodeReviewRevWalk(Repository repo) {
|
||||
super(repo);
|
||||
|
@@ -41,12 +41,6 @@ public enum CommitMergeStatus {
|
||||
/** */
|
||||
MISSING_DEPENDENCY(""),
|
||||
|
||||
/** */
|
||||
NO_PATCH_SET(""),
|
||||
|
||||
/** */
|
||||
REVISION_GONE(""),
|
||||
|
||||
/** */
|
||||
MANUAL_RECURSIVE_MERGE("The change requires a local merge to resolve.\n"
|
||||
+ "\n"
|
||||
|
@@ -890,11 +890,6 @@ public class MergeOp implements AutoCloseable {
|
||||
problems.put(id, "depends on change that was not submitted");
|
||||
break;
|
||||
|
||||
case REVISION_GONE:
|
||||
// TODO(dborowitz): Should no longer be generated by built-in code;
|
||||
// finish removing.
|
||||
throw new IllegalStateException();
|
||||
|
||||
default:
|
||||
problems.put(id, "unspecified merge failure: " + s);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user