Collection<VirtualFile> (@NotNull SvnVcs vcs, @NotNull VirtualFile file, @NotNull SvnWCRootCrawler callback, @Nullable ProgressIndicator progress) { Set<VirtualFile> result = new HashSet<>(); // TODO: Actually it is not OK to call getParent() if file is invalid. VirtualFile parent = !file.isDirectory() || !file.isValid() ? file.getParent() : file; if (isSvnVersioned(vcs, virtualToIoFile(parent))) { checkCanceled(progress); callback.handleWorkingCopyRoot(virtualToIoFile(file), progress); checkCanceled(progress); result.add(parent); } else if (file.isDirectory()) { checkCanceled(progress); for (VirtualFile child : parent.getChildren()) { checkCanceled(progress); if (child.isDirectory()) { result.addAll(crawlWCRoots(vcs, child, callback, progress)); } } } return result; }