mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
vcs: remove pointless return value
we can't synchronously check for errors in a background thread we just spawned
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user