public void detectCopyRoots(final VirtualFile[] roots, final boolean clearState) {
      final Getter<Boolean> cancelGetter =
          new Getter<Boolean>() {
            public Boolean get() {
              return myVcs.getProject().isDisposed();
            }
          };

      for (final VirtualFile vcsRoot : roots) {
        final List<Real> foundRoots =
            ForNestedRootChecker.getAllNestedWorkingCopies(vcsRoot, myVcs, false, cancelGetter);
        if (foundRoots.isEmpty()) {
          myLonelyRoots.add(vcsRoot);
        }
        // filter out bad(?) items
        for (Real foundRoot : foundRoots) {
          final SVNURL repoRoot = foundRoot.getInfo().getRepositoryRootURL();
          if (repoRoot == null) {
            LOG.info(
                "Error: cannot find repository URL for versioned folder: "
                    + foundRoot.getFile().getPath());
          } else {
            myRepositoryRoots.register(repoRoot);
            myTopRoots.add(
                new RootUrlInfo(
                    repoRoot,
                    foundRoot.getInfo().getURL(),
                    SvnFormatSelector.getWorkingCopyFormat(foundRoot.getInfo().getFile()),
                    foundRoot.getFile(),
                    vcsRoot));
          }
        }
      }

      if (!SvnConfiguration.getInstance(myVcs.getProject()).DETECT_NESTED_COPIES) {
        myApplier.apply(myVcs, myTopRoots, myLonelyRoots);
      } else {
        addNestedRoots(clearState);
      }
    }
  private void fillMapping(final SvnMapping mapping, final List<SvnCopyRootSimple> list) {
    final LocalFileSystem lfs = LocalFileSystem.getInstance();

    for (SvnCopyRootSimple simple : list) {
      final VirtualFile copyRoot = lfs.findFileByIoFile(new File(simple.myCopyRoot));
      final VirtualFile vcsRoot = lfs.findFileByIoFile(new File(simple.myVcsRoot));

      if (copyRoot == null || vcsRoot == null) continue;

      final SvnVcs vcs = SvnVcs.getInstance(myProject);
      final SVNInfo svnInfo = vcs.getInfo(copyRoot);
      if ((svnInfo == null) || (svnInfo.getRepositoryRootURL() == null)) continue;

      final RootUrlInfo info =
          new RootUrlInfo(
              svnInfo.getRepositoryRootURL(),
              svnInfo.getURL(),
              SvnFormatSelector.getWorkingCopyFormat(svnInfo.getFile()),
              copyRoot,
              vcsRoot);
      mapping.add(info);
    }
  }