mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
com.intellij.openapi.vcs.changes.ChangeListManager.ensureUpToDate should wait until all refresh tasks are finished
This commit is contained in:
@@ -1304,6 +1304,7 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec
|
||||
public boolean ensureUpToDate(final boolean canBeCanceled) {
|
||||
final EnsureUpToDateFromNonAWTThread worker = new EnsureUpToDateFromNonAWTThread(myProject);
|
||||
worker.execute();
|
||||
myUpdater.waitUntilRefreshed();
|
||||
return worker.isDone();
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ import com.intellij.openapi.vcs.ProjectLevelVcsManager;
|
||||
import com.intellij.util.Consumer;
|
||||
import com.intellij.util.concurrency.Semaphore;
|
||||
import com.intellij.util.io.storage.HeavyProcessLatch;
|
||||
import org.jetbrains.annotations.TestOnly;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.ArrayList;
|
||||
@@ -95,15 +94,14 @@ public class UpdateRequestsQueue {
|
||||
}
|
||||
|
||||
public void schedule() {
|
||||
if (ChangeListManagerImpl.DEBUG) {
|
||||
System.out.println("UpdateRequestsQueue.schedule");
|
||||
}
|
||||
|
||||
synchronized (myLock) {
|
||||
if (! myStarted && ApplicationManager.getApplication().isUnitTestMode()) return;
|
||||
|
||||
if (! myStopped) {
|
||||
if (! myRequestSubmitted) {
|
||||
if (ChangeListManagerImpl.DEBUG) {
|
||||
System.out.println("UpdateRequestsQueue.schedule");
|
||||
}
|
||||
final MyRunnable runnable = new MyRunnable();
|
||||
myRequestSubmitted = true;
|
||||
myExecutor.schedule(runnable, 300, TimeUnit.MILLISECONDS);
|
||||
@@ -142,7 +140,6 @@ public class UpdateRequestsQueue {
|
||||
LOG.debug("Stop finished for project: " + myProject.getName());
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
public void waitUntilRefreshed() {
|
||||
if (ChangeListManagerImpl.DEBUG) {
|
||||
System.out.println("UpdateRequestsQueue.waitUntilRefreshed");
|
||||
@@ -261,7 +258,14 @@ public class UpdateRequestsQueue {
|
||||
}
|
||||
|
||||
LOG.debug("MyRunnable: INVOKE, project: " + myProject.getName() + ", runnable: " + hashCode());
|
||||
if (ChangeListManagerImpl.DEBUG) {
|
||||
System.out.println("UpdateRequestsQueue$MyRunnable.run");
|
||||
}
|
||||
|
||||
myDelegate.run();
|
||||
if (ChangeListManagerImpl.DEBUG) {
|
||||
System.out.println(" - end - UpdateRequestsQueue$MyRunnable.run");
|
||||
}
|
||||
LOG.debug("MyRunnable: invokeD, project: " + myProject.getName() + ", runnable: " + hashCode());
|
||||
} finally {
|
||||
synchronized (myLock) {
|
||||
|
||||
Reference in New Issue
Block a user