void () { final List<VirtualFile> addedVFiles = new ArrayList<>(); final Map<VirtualFile, File> copyFromMap = new HashMap<>(); final Set<VirtualFile> recursiveItems = new HashSet<>(); fillAddedFiles(addedVFiles, copyFromMap, recursiveItems); if (addedVFiles.isEmpty()) return; final VcsShowConfirmationOption.Value value = myAddConfirmation.getValue(); if (value != VcsShowConfirmationOption.Value.DO_NOTHING_SILENTLY) { // Current method could be invoked under write action (for instance, during project import). So we explicitly use // Application.invokeLater() in such cases to prevent deadlocks (while accessing vcs root mappings) and also not to show dialog under // write action. runNotUnderWriteAction(() -> { final AbstractVcsHelper vcsHelper = AbstractVcsHelper.getInstance(myVcs.getProject()); final Collection<VirtualFile> filesToProcess = promptAboutAddition(addedVFiles, value, vcsHelper); if (filesToProcess != null && !filesToProcess.isEmpty()) { final List<VcsException> exceptions = new ArrayList<>(); runInBackground(message("progress.title.adding.files.to.subversion"), createAdditionRunnable(copyFromMap, filesToProcess, exceptions)); if (!exceptions.isEmpty()) { vcsHelper.showErrors(exceptions, message("add.files.errors.title")); } } }); } }