mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
ChangeListManagerImpl: introduce freezeImmediately to freeze without update.
Use in GitFreezingProcess. This fixes IDEA-81281.
This commit is contained in:
@@ -284,15 +284,19 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec
|
|||||||
invokeAfterUpdate(new Runnable() {
|
invokeAfterUpdate(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
myUpdater.setIgnoreBackgroundOperation(false);
|
freezeImmediately(reason);
|
||||||
myUpdater.pause();
|
|
||||||
myFreezeName.set(reason);
|
|
||||||
context.ping();
|
context.ping();
|
||||||
}
|
}
|
||||||
}, InvokeAfterUpdateMode.SILENT_CALLBACK_POOLED, "", ModalityState.NON_MODAL);
|
}, InvokeAfterUpdateMode.SILENT_CALLBACK_POOLED, "", ModalityState.NON_MODAL);
|
||||||
context.suspend();
|
context.suspend();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void freezeImmediately(@Nullable String reason) {
|
||||||
|
myUpdater.setIgnoreBackgroundOperation(false);
|
||||||
|
myUpdater.pause();
|
||||||
|
myFreezeName.set(reason);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void letGo() {
|
public void letGo() {
|
||||||
myUpdater.go();
|
myUpdater.go();
|
||||||
|
|||||||
@@ -19,8 +19,7 @@ import com.intellij.ide.SaveAndSyncHandler;
|
|||||||
import com.intellij.openapi.fileEditor.FileDocumentManager;
|
import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||||
import com.intellij.openapi.project.Project;
|
import com.intellij.openapi.project.Project;
|
||||||
import com.intellij.openapi.project.ex.ProjectManagerEx;
|
import com.intellij.openapi.project.ex.ProjectManagerEx;
|
||||||
import com.intellij.openapi.vcs.changes.ChangeListManager;
|
import com.intellij.openapi.vcs.changes.ChangeListManagerImpl;
|
||||||
import com.intellij.util.continuation.GatheringContinuationContext;
|
|
||||||
import com.intellij.util.ui.UIUtil;
|
import com.intellij.util.ui.UIUtil;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
@@ -35,12 +34,12 @@ public class GitFreezingProcess {
|
|||||||
|
|
||||||
@NotNull private final String myOperationTitle;
|
@NotNull private final String myOperationTitle;
|
||||||
@NotNull private final Runnable myRunnable;
|
@NotNull private final Runnable myRunnable;
|
||||||
@NotNull private final ChangeListManager myChangeListManager;
|
@NotNull private final ChangeListManagerImpl myChangeListManager;
|
||||||
|
|
||||||
public GitFreezingProcess(@NotNull Project project, @NotNull String operationTitle, @NotNull Runnable runnable) {
|
public GitFreezingProcess(@NotNull Project project, @NotNull String operationTitle, @NotNull Runnable runnable) {
|
||||||
myOperationTitle = operationTitle;
|
myOperationTitle = operationTitle;
|
||||||
myRunnable = runnable;
|
myRunnable = runnable;
|
||||||
myChangeListManager = ChangeListManager.getInstance(project);
|
myChangeListManager = ChangeListManagerImpl.getInstanceImpl(project);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
@@ -93,8 +92,7 @@ public class GitFreezingProcess {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void freeze() {
|
private void freeze() {
|
||||||
myChangeListManager.freeze(new GatheringContinuationContext(),
|
myChangeListManager.freezeImmediately("Local changes are not available until Git " + myOperationTitle + " is finished.");
|
||||||
"Local changes are not available until Git " + myOperationTitle + " is finished.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void unfreeze() {
|
private void unfreeze() {
|
||||||
|
|||||||
Reference in New Issue
Block a user