From 4221f2f52bc3b214a2fc3f97782d47654fc35ad7 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Sat, 25 Jun 2016 18:52:48 +0300 Subject: [PATCH] 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. --- .../update/AbstractCommonUpdateAction.java | 43 ++----------------- 1 file changed, 3 insertions(+), 40 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/update/AbstractCommonUpdateAction.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/update/AbstractCommonUpdateAction.java index 585292076104..04b5532e25ef 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/update/AbstractCommonUpdateAction.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/update/AbstractCommonUpdateAction.java @@ -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); } } }