mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
no need to freeze the CLM for the whole AbstractCommonUpdateAction
Originally (d7ecb297) there was freeze of VcsDirtyScopeManager, later (c84760e) it was changed to the freeze of CLM which happened to be incorrect (6646f04IDEA-156339). However, it seems that there is no reason to freeze the VDSM here: *d7ecb297states "refresh of local changes is buffered while updating", but VDSM will cause CLM update only after VFS refresh events, which should be triggered by refresh() calls only after update procedure is completed. * In git a large part of Update Project procedure duration is fetch, and there is no harm to edit during the fetch. When it comes to change of the working tree (stash + merge/rebase), GitUpdateProcess performs the freeze itself.
This commit is contained in:
+3
-40
@@ -331,36 +331,9 @@ public abstract class AbstractCommonUpdateAction extends AbstractVcsAction {
|
||||
++ myUpdateNumber;
|
||||
}
|
||||
|
||||
private void suspendIfNeeded() {
|
||||
if (! myActionInfo.canChangeFileStatus()) {
|
||||
// i.e. for update but not for integrate or status
|
||||
myChangeListManager.freezeImmediately(null);
|
||||
}
|
||||
}
|
||||
|
||||
private void releaseIfNeeded() {
|
||||
if (! myActionInfo.canChangeFileStatus()) {
|
||||
// i.e. for update but not for integrate or status
|
||||
myChangeListManager.letGo();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(@NotNull final ProgressIndicator indicator) {
|
||||
suspendIfNeeded();
|
||||
try {
|
||||
runImpl();
|
||||
}
|
||||
catch (Throwable t) {
|
||||
releaseIfNeeded();
|
||||
if (t instanceof Error) {
|
||||
throw ((Error)t);
|
||||
}
|
||||
else if (t instanceof RuntimeException) {
|
||||
throw ((RuntimeException)t);
|
||||
}
|
||||
throw new RuntimeException(t);
|
||||
}
|
||||
runImpl();
|
||||
}
|
||||
|
||||
private void runImpl() {
|
||||
@@ -475,12 +448,7 @@ public abstract class AbstractCommonUpdateAction extends AbstractVcsAction {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
try {
|
||||
onSuccessImpl(false);
|
||||
}
|
||||
finally {
|
||||
releaseIfNeeded();
|
||||
}
|
||||
onSuccessImpl(false);
|
||||
}
|
||||
|
||||
private void onSuccessImpl(final boolean wasCanceled) {
|
||||
@@ -621,12 +589,7 @@ public abstract class AbstractCommonUpdateAction extends AbstractVcsAction {
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
try {
|
||||
onSuccessImpl(true);
|
||||
}
|
||||
finally {
|
||||
releaseIfNeeded();
|
||||
}
|
||||
onSuccessImpl(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user