private BanCommit.Factory banCommitFactory;
@Override
protected void run() throws Failure {
try {
final BanCommitResult result =
banCommitFactory.create().ban(projectControl, commitsToBan, reason);
final List<ObjectId> newlyBannedCommits =
result.getNewlyBannedCommits();
if (!newlyBannedCommits.isEmpty()) {
stdout.print("The following commits were banned:\n");
printCommits(stdout, newlyBannedCommits);
}
final List<ObjectId> alreadyBannedCommits =
result.getAlreadyBannedCommits();
if (!alreadyBannedCommits.isEmpty()) {
stdout.print("The following commits were already banned:\n");
printCommits(stdout, alreadyBannedCommits);
}
final List<ObjectId> ignoredIds = result.getIgnoredObjectIds();
if (!ignoredIds.isEmpty()) {
stdout.print("The following ids do not represent commits"
+ " and were ignored:\n");
printCommits(stdout, ignoredIds);
}