Add REST endpoint to list the commits that are integrated by a merge
In a later step we want to display this list in the change screen if a merge commit is reviewed. This allows reviewers to see which commits are being integrated by accepting the merge commit. Change-Id: Ic4fc31608fd645ae6f55afc6ce24215c7c393404 Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user