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 (6646f04 IDEA-156339).

However, it seems that there is no reason to freeze the VDSM here:
* d7ecb297 states "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:
Kirill Likhodedov
2016-06-25 18:52:48 +03:00
parent 255c2fc912
commit 4221f2f52b
@@ -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);
}
}
}