mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-76795 vcs: do not allow multiple processes to load same committed change details
This commit is contained in:
@@ -669,6 +669,12 @@ public class AbstractVcsHelperImpl extends AbstractVcsHelper {
|
||||
final CommittedChangeList[] list = new CommittedChangeList[1];
|
||||
final FilePath[] targetPath = new FilePath[1];
|
||||
final VcsException[] exc = new VcsException[1];
|
||||
|
||||
final BackgroundableActionLock lock = BackgroundableActionLock.getLock(project, VcsBackgroundableActions.COMMITTED_CHANGES_DETAILS,
|
||||
revision, virtualFile.getPath());
|
||||
if (lock.isLocked()) return;
|
||||
lock.lock();
|
||||
|
||||
Task.Backgroundable task = new Task.Backgroundable(project, title, true, BackgroundFromStartOption.getInstance()) {
|
||||
@Override
|
||||
public void run(@NotNull ProgressIndicator indicator) {
|
||||
@@ -700,8 +706,14 @@ public class AbstractVcsHelperImpl extends AbstractVcsHelper {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
lock.unlock();
|
||||
if (exc[0] != null) {
|
||||
showError(exc[0], failedText(virtualFile, revision));
|
||||
}
|
||||
|
||||
@@ -22,7 +22,8 @@ public enum VcsBackgroundableActions {
|
||||
ANNOTATE,
|
||||
COMPARE_WITH, // common for compare with (selected/latest/same) revision
|
||||
CREATE_HISTORY_SESSION,
|
||||
HISTORY_FOR_SELECTION;
|
||||
HISTORY_FOR_SELECTION,
|
||||
COMMITTED_CHANGES_DETAILS;
|
||||
|
||||
public static Object keyFrom(final FilePath filePath) {
|
||||
return filePath.getPath();
|
||||
|
||||
Reference in New Issue
Block a user