From f64c70049ef5f5ec1735ea0288b0b97559abb342 Mon Sep 17 00:00:00 2001 From: Nadya Zabrodina Date: Tue, 5 Nov 2013 14:41:06 +0400 Subject: [PATCH] (IDEA-115964) Fix root scanner and errors notification for vcs without RootChecker --- .../openapi/vcs/roots/VcsRootErrorsFinder.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/roots/VcsRootErrorsFinder.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/roots/VcsRootErrorsFinder.java index 3c2c494c7f97..8674333d4ca5 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/roots/VcsRootErrorsFinder.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/roots/VcsRootErrorsFinder.java @@ -60,8 +60,11 @@ public class VcsRootErrorsFinder { private Collection findExtraMappings(@NotNull List mappings, boolean isEmptyVcsRoots) { Collection errors = new ArrayList(); for (VcsDirectoryMapping mapping : mappings) { + if (!hasVcsChecker(mapping.getVcs())) { + continue; + } if (mapping.isDefaultMapping()) { - if (isEmptyVcsRoots && !StringUtil.isEmptyOrSpaces(mapping.getVcs())) { + if (isEmptyVcsRoots) { errors.add(new VcsRootError(VcsRootError.Type.EXTRA_MAPPING, VcsDirectoryMapping.PROJECT_CONSTANT, mapping.getVcs())); } } @@ -75,6 +78,19 @@ public class VcsRootErrorsFinder { return errors; } + private static boolean hasVcsChecker(String vcs) { + if (StringUtil.isEmptyOrSpaces(vcs)) { + return false; + } + VcsRootChecker[] checkers = Extensions.getExtensions(VcsRootChecker.EXTENSION_POINT_NAME); + for (VcsRootChecker checker : checkers) { + if (vcs.equalsIgnoreCase(checker.getSupportedVcs().getName())) { + return true; + } + } + return false; + } + @NotNull public static Collection vcsRootsToVirtualFiles(@NotNull Collection vcsRoots) { return ContainerUtil.map(vcsRoots, new Function() {