@Override
  public void loadState(@NotNull Element element) {
    final List<VcsDirectoryMapping> mappingsList = new ArrayList<>();
    boolean haveNonEmptyMappings = false;
    for (Element child : element.getChildren(ELEMENT_MAPPING)) {
      String vcsName = child.getAttributeValue(ATTRIBUTE_VCS);
      String directory = child.getAttributeValue(ATTRIBUTE_DIRECTORY);
      if (directory == null) continue;

      VcsRootSettings rootSettings = null;
      Element rootSettingsElement = child.getChild(ELEMENT_ROOT_SETTINGS);
      if (rootSettingsElement != null) {
        String className = rootSettingsElement.getAttributeValue(ATTRIBUTE_CLASS);
        AbstractVcs vcsInstance = vcsName == null ? null : AllVcses.getInstance(myProject).getByName(vcsName);
        if (vcsInstance != null && className != null) {
          rootSettings = vcsInstance.createEmptyVcsRootSettings();
          if (rootSettings != null) {
            try {
              rootSettings.readExternal(rootSettingsElement);
            }
            catch (InvalidDataException e) {
              LOG.error("Failed to load VCS root settings class " + className + " for VCS " + vcsInstance.getClass().getName(), e);
            }
          }
        }
      }

      VcsDirectoryMapping mapping = new VcsDirectoryMapping(directory, vcsName, rootSettings);
      mappingsList.add(mapping);

      haveNonEmptyMappings |= !mapping.isDefaultMapping();
    }
    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.setDirectoryMappingsFromConfig(mappingsList);
  }
@Override
  public void loadState(@NotNull Element element)