Search in sources :

Example 1 with BanCommitInput

use of com.google.gerrit.extensions.api.projects.BanCommitInput in project gerrit by GerritCodeReview.

the class BanCommitCommand method run.

@Override
protected void run() throws Failure {
    enableGracefulStop();
    try {
        BanCommitInput input = BanCommitInput.fromCommits(Lists.transform(commitsToBan, ObjectId::getName));
        input.reason = reason;
        BanResultInfo r = banCommit.apply(new ProjectResource(projectState, user), input).value();
        printCommits(r.newlyBanned, "The following commits were banned");
        printCommits(r.alreadyBanned, "The following commits were already banned");
        printCommits(r.ignored, "The following ids do not represent commits and were ignored");
    } catch (Exception e) {
        throw die(e);
    }
}
Also used : BanCommitInput(com.google.gerrit.extensions.api.projects.BanCommitInput) BanResultInfo(com.google.gerrit.server.restapi.project.BanCommit.BanResultInfo) ProjectResource(com.google.gerrit.server.project.ProjectResource)

Aggregations

BanCommitInput (com.google.gerrit.extensions.api.projects.BanCommitInput)1 ProjectResource (com.google.gerrit.server.project.ProjectResource)1 BanResultInfo (com.google.gerrit.server.restapi.project.BanCommit.BanResultInfo)1