use of com.google.gerrit.server.change.AbandonOp in project gerrit by GerritCodeReview.
the class Abandon method abandon.
public Change abandon(BatchUpdate.Factory updateFactory, ChangeNotes notes, CurrentUser user, String msgTxt, NotifyResolver.Result notify) throws RestApiException, UpdateException {
AccountState accountState = user.isIdentifiedUser() ? user.asIdentifiedUser().state() : null;
AbandonOp op = abandonOpFactory.create(accountState, msgTxt);
ChangeData changeData = changeDataFactory.create(notes.getProjectName(), notes.getChangeId());
try (BatchUpdate u = updateFactory.create(notes.getProjectName(), user, TimeUtil.now())) {
u.setNotify(notify);
u.addOp(notes.getChangeId(), op);
u.addOp(notes.getChangeId(), storeSubmitRequirementsOpFactory.create(changeData.submitRequirements().values(), changeData));
u.execute();
}
return op.getChange();
}
Aggregations