@NotNull private List<AbstractVcs> getVcsListFor(@NotNull VirtualFile dir) { VcsRootChecker[] checkers = Extensions.getExtensions(VcsRootChecker.EXTENSION_POINT_NAME); List<AbstractVcs> vcsList = new ArrayList<AbstractVcs>(); for (VcsRootChecker checker : checkers) { if (checker.isRoot(dir.getPath())) { vcsList.add(myVcsManager.findVcsByName(checker.getSupportedVcs().getName())); } } return vcsList; }
@Nullable public static HgVcs getInstance(Project project) { if (project == null || project.isDisposed()) { return null; } final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(project); if (vcsManager == null) { return null; } return (HgVcs) vcsManager.findVcsByName(VCS_NAME); }