@Override
 public boolean dvcsUsedInProject() {
   AbstractVcs[] allActiveVcss = getAllActiveVcss();
   for (AbstractVcs activeVcs : allActiveVcss) {
     if (VcsType.distributed.equals(activeVcs.getType())) {
       return true;
     }
   }
   return false;
 }
 public void unregisterVcs(@NotNull AbstractVcs vcs) {
   if (!ApplicationManager.getApplication().isUnitTestMode()
       && myMappings.haveActiveVcs(vcs.getName())) {
     // unlikely
     LOG.warn(
         "Active vcs '" + vcs.getName() + "' is being unregistered. Remove from mappings first.");
   }
   myMappings.beingUnregistered(vcs.getName());
   AllVcses.getInstance(myProject).unregisterManually(vcs);
 }
  public void readDirectoryMappings(final Element element) {
    myMappings.clear();

    final List<VcsDirectoryMapping> mappingsList = new ArrayList<VcsDirectoryMapping>();
    boolean haveNonEmptyMappings = false;
    for (Element child : element.getChildren(ELEMENT_MAPPING)) {
      final String vcs = child.getAttributeValue(ATTRIBUTE_VCS);
      if (vcs != null && !vcs.isEmpty()) {
        haveNonEmptyMappings = true;
      }
      VcsDirectoryMapping mapping =
          new VcsDirectoryMapping(child.getAttributeValue(ATTRIBUTE_DIRECTORY), vcs);
      mappingsList.add(mapping);

      Element rootSettingsElement = child.getChild(ELEMENT_ROOT_SETTINGS);
      if (rootSettingsElement != null) {
        String className = rootSettingsElement.getAttributeValue(ATTRIBUTE_CLASS);
        AbstractVcs vcsInstance = findVcsByName(mapping.getVcs());
        if (vcsInstance != null && className != null) {
          final VcsRootSettings rootSettings = vcsInstance.createEmptyVcsRootSettings();
          if (rootSettings != null) {
            try {
              rootSettings.readExternal(rootSettingsElement);
              mapping.setRootSettings(rootSettings);
            } catch (InvalidDataException e) {
              LOG.error(
                  "Failed to load VCS root settings class "
                      + className
                      + " for VCS "
                      + vcsInstance.getClass().getName(),
                  e);
            }
          }
        }
      }
    }
    boolean defaultProject =
        Boolean.TRUE.toString().equals(element.getAttributeValue(ATTRIBUTE_DEFAULT_PROJECT));
    // run autodetection if there's no VCS in default project and
    if (haveNonEmptyMappings || !defaultProject) {
      myMappingsLoaded = true;
    }
    myMappings.setDirectoryMappings(mappingsList);
  }
 @Override
 public List<VcsDirectoryMapping> getDirectoryMappings(final AbstractVcs vcs) {
   return myMappings.getDirectoryMappings(vcs.getName());
 }
 @Override
 public boolean checkVcsIsActive(AbstractVcs vcs) {
   return checkVcsIsActive(vcs.getName());
 }