Merge "Add REST endpoint to list the commits that are integrated by a merge"

This commit is contained in:
David Pursehouse
2016-09-13 09:29:12 +00:00
committed by Gerrit Code Review
7 changed files with 297 additions and 1 deletions

View File

@@ -17,6 +17,7 @@ package com.google.gerrit.extensions.api.changes;
import com.google.gerrit.extensions.client.SubmitType;
import com.google.gerrit.extensions.common.ActionInfo;
import com.google.gerrit.extensions.common.CommentInfo;
import com.google.gerrit.extensions.common.CommitInfo;
import com.google.gerrit.extensions.common.FileInfo;
import com.google.gerrit.extensions.common.MergeableInfo;
import com.google.gerrit.extensions.common.TestSubmitRuleInput;
@@ -72,6 +73,33 @@ public interface RevisionApi {
SubmitType submitType() throws RestApiException;
SubmitType testSubmitType(TestSubmitRuleInput in) throws RestApiException;
MergeListRequest getMergeList() throws RestApiException;
abstract class MergeListRequest {
private boolean addLinks;
private int uninterestingParent = 1;
public abstract List<CommitInfo> get() throws RestApiException;
public MergeListRequest withLinks() {
this.addLinks = true;
return this;
}
public MergeListRequest withUninterestingParent(int uninterestingParent) {
this.uninterestingParent = uninterestingParent;
return this;
}
public boolean getAddLinks() {
return addLinks;
}
public int getUninterestingParent() {
return uninterestingParent;
}
}
/**
* A default implementation which allows source compatibility
* when adding new methods to the interface.
@@ -217,5 +245,10 @@ public interface RevisionApi {
throws RestApiException {
throw new NotImplementedException();
}
@Override
public MergeListRequest getMergeList() throws RestApiException {
throw new NotImplementedException();
}
}
}