From 66e40647a09070fb29bec59fc4815b4549e1e7fe Mon Sep 17 00:00:00 2001 From: Nadya Zabrodina Date: Thu, 16 Feb 2017 18:27:15 +0300 Subject: [PATCH] [vcs]: deprecate getRepositoryForFileQuick, add one missing usage * use this deprecated method only as a deadlock quick fix solution; * todo: if repository not found, but vcs vf root exists, add log.warn and start backgroundable repository creation process instead of using EDT; if mappings were changed and EDT started repository constructions -> we should manage this properly. --- .../com/intellij/dvcs/repo/AbstractRepositoryManager.java | 6 +++++- .../src/com/intellij/dvcs/repo/VcsRepositoryManager.java | 4 ++++ .../src/org/jetbrains/plugins/github/util/GithubUtil.java | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/platform/dvcs-impl/src/com/intellij/dvcs/repo/AbstractRepositoryManager.java b/platform/dvcs-impl/src/com/intellij/dvcs/repo/AbstractRepositoryManager.java index fc2182042a93..8f42d7be7c1d 100644 --- a/platform/dvcs-impl/src/com/intellij/dvcs/repo/AbstractRepositoryManager.java +++ b/platform/dvcs-impl/src/com/intellij/dvcs/repo/AbstractRepositoryManager.java @@ -57,8 +57,12 @@ public abstract class AbstractRepositoryManager public T getRepositoryForFile(@NotNull VirtualFile file) { return validateAndGetRepository(myGlobalRepositoryManager.getRepositoryForFile(file)); } - + + /** + * @Deprecated to delete in 2017.X + */ @Nullable + @Deprecated public T getRepositoryForFileQuick(@NotNull VirtualFile file) { return validateAndGetRepository(myGlobalRepositoryManager.getRepositoryForFileQuick(file)); } diff --git a/platform/dvcs-impl/src/com/intellij/dvcs/repo/VcsRepositoryManager.java b/platform/dvcs-impl/src/com/intellij/dvcs/repo/VcsRepositoryManager.java index eb0a6cbd8aca..1baf48752ae8 100644 --- a/platform/dvcs-impl/src/com/intellij/dvcs/repo/VcsRepositoryManager.java +++ b/platform/dvcs-impl/src/com/intellij/dvcs/repo/VcsRepositoryManager.java @@ -94,7 +94,11 @@ public class VcsRepositoryManager extends AbstractProjectComponent implements Di return getRepositoryForFile(file, false); } + /** + * @Deprecated to delete in 2017.X + */ @Nullable + @Deprecated public Repository getRepositoryForFileQuick(@NotNull VirtualFile file) { return getRepositoryForFile(file, true); } diff --git a/plugins/github/src/org/jetbrains/plugins/github/util/GithubUtil.java b/plugins/github/src/org/jetbrains/plugins/github/util/GithubUtil.java index f0168fce3058..40cd228358d7 100644 --- a/plugins/github/src/org/jetbrains/plugins/github/util/GithubUtil.java +++ b/plugins/github/src/org/jetbrains/plugins/github/util/GithubUtil.java @@ -422,7 +422,7 @@ public class GithubUtil { return repository; } } - return manager.getRepositoryForFile(project.getBaseDir()); + return manager.getRepositoryForFileQuick(project.getBaseDir()); } public static boolean addGithubRemote(@NotNull Project project,