Search in sources :

Example 1 with AbandonOp

use of com.google.gerrit.server.git.AbandonOp in project gerrit by GerritCodeReview.

the class Abandon method abandon.

public Change abandon(BatchUpdate.Factory updateFactory, ChangeControl control, String msgTxt, NotifyHandling notifyHandling, ListMultimap<RecipientType, Account.Id> accountsToNotify) throws RestApiException, UpdateException {
    CurrentUser user = control.getUser();
    Account account = user.isIdentifiedUser() ? user.asIdentifiedUser().getAccount() : null;
    AbandonOp op = abandonOpFactory.create(account, msgTxt, notifyHandling, accountsToNotify);
    try (BatchUpdate u = updateFactory.create(dbProvider.get(), control.getProject().getNameKey(), control.getUser(), TimeUtil.nowTs())) {
        u.addOp(control.getId(), op).execute();
    }
    return op.getChange();
}
Also used : Account(com.google.gerrit.reviewdb.client.Account) CurrentUser(com.google.gerrit.server.CurrentUser) AbandonOp(com.google.gerrit.server.git.AbandonOp) BatchUpdate(com.google.gerrit.server.update.BatchUpdate)

Aggregations

Account (com.google.gerrit.reviewdb.client.Account)1 CurrentUser (com.google.gerrit.server.CurrentUser)1 AbandonOp (com.google.gerrit.server.git.AbandonOp)1 BatchUpdate (com.google.gerrit.server.update.BatchUpdate)1