Search in sources :

Example 1 with GetPureRevert

use of com.google.gerrit.server.restapi.change.GetPureRevert in project gerrit by GerritCodeReview.

the class ChangeApiImpl method pureRevert.

@Override
public PureRevertInfo pureRevert(@Nullable String claimedOriginal) throws RestApiException {
    try {
        GetPureRevert getPureRevert = getPureRevertProvider.get();
        getPureRevert.setClaimedOriginal(claimedOriginal);
        return getPureRevert.apply(change).value();
    } catch (Exception e) {
        throw asRestApiException("Cannot compute pure revert", e);
    }
}
Also used : GetPureRevert(com.google.gerrit.server.restapi.change.GetPureRevert) ApiUtil.asRestApiException(com.google.gerrit.server.api.ApiUtil.asRestApiException) BadRequestException(com.google.gerrit.extensions.restapi.BadRequestException) IllegalLabelException(com.google.gerrit.server.StarredChangesUtil.IllegalLabelException) RestApiException(com.google.gerrit.extensions.restapi.RestApiException) StorageException(com.google.gerrit.exceptions.StorageException) CmdLineException(org.kohsuke.args4j.CmdLineException)

Aggregations

StorageException (com.google.gerrit.exceptions.StorageException)1 BadRequestException (com.google.gerrit.extensions.restapi.BadRequestException)1 RestApiException (com.google.gerrit.extensions.restapi.RestApiException)1 IllegalLabelException (com.google.gerrit.server.StarredChangesUtil.IllegalLabelException)1 ApiUtil.asRestApiException (com.google.gerrit.server.api.ApiUtil.asRestApiException)1 GetPureRevert (com.google.gerrit.server.restapi.change.GetPureRevert)1 CmdLineException (org.kohsuke.args4j.CmdLineException)1