vcs: remove pointless return value

we can't synchronously check for errors in a background thread we just spawned
This commit is contained in:
Aleksey Pivovarov
2018-02-26 14:56:40 +03:00
parent 96be1a7fb2
commit a5e027c0ea
3 changed files with 9 additions and 8 deletions
@@ -1310,16 +1310,16 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec
doCommit(changeList, changes, false);
}
private boolean doCommit(final LocalChangeList changeList, final List<Change> changes, final boolean synchronously) {
private void doCommit(final LocalChangeList changeList, final List<Change> changes, final boolean synchronously) {
FileDocumentManager.getInstance().saveAllDocuments();
return new CommitHelper(myProject, changeList, changes, changeList.getName(),
StringUtil.isEmpty(changeList.getComment()) ? changeList.getName() : changeList.getComment(), new ArrayList<>(),
false, synchronously, FunctionUtil.nullConstant(), null, false, null).doCommit();
new CommitHelper(myProject, changeList, changes, changeList.getName(),
StringUtil.isEmpty(changeList.getComment()) ? changeList.getName() : changeList.getComment(), new ArrayList<>(),
false, synchronously, FunctionUtil.nullConstant(), null, false, null).doCommit();
}
@TestOnly
public boolean commitChangesSynchronouslyWithResult(@NotNull LocalChangeList changeList, @NotNull List<Change> changes) {
return doCommit(changeList, changes, true);
public void commitChangesSynchronouslyWithResult(@NotNull LocalChangeList changeList, @NotNull List<Change> changes) {
doCommit(changeList, changes, true);
}
@Override
@@ -129,6 +129,7 @@ public class CommitHelper {
notNull(resultHandler, new DefaultCommitResultHandler(myProject, myIncludedChanges, myCommitMessage, myCommitProcessor, myFeedback));
}
@SuppressWarnings("UnusedReturnValue")
public boolean doCommit() {
Task.Backgroundable task = new Task.Backgroundable(myProject, myActionName, true, myConfiguration.getCommitOption()) {
public void run(@NotNull ProgressIndicator indicator) {
@@ -154,7 +155,7 @@ public class CommitHelper {
}
};
ProgressManager.getInstance().run(task);
return hasOnlyWarnings(myCommitProcessor.getVcsExceptions());
return true;
}
private void delegateCommitToVcsThread() {
@@ -83,7 +83,7 @@ public class HgTestChangeListManager {
final LocalChangeList list = peer.getDefaultChangeList();
assertNotNull(list);
peer.editComment(list.getName(), "A comment to a commit");
UIUtil.invokeAndWaitIfNeeded((Runnable)() -> Assert.assertTrue(peer.commitChangesSynchronouslyWithResult(list, changes)));
UIUtil.invokeAndWaitIfNeeded((Runnable)() -> peer.commitChangesSynchronouslyWithResult(list, changes));
ensureUpToDate();
}