void (@NotNull AnActionEvent e) { final MyChecker checker = new MyChecker(); checker.execute(e); if (!checker.isEnabled()) return; final Project project = checker.getProject(); final VirtualFile baseDir = project.getBaseDir(); if (baseDir == null) return; boolean success = false; boolean excThrown = false; try { success = ShareProjectAction.share(project, baseDir); } catch (VcsException exc) { AbstractVcsHelper.getInstance(project).showError(exc, message("tab.title.failed.to.share.project")); excThrown = true; } finally { // if success = false -> either action was cancelled or exception was thrown, so also check for exception if (success || excThrown) { baseDir.refresh(true, true, () -> ApplicationManager.getApplication().invokeLater(() -> { VcsDirtyScopeManager.getInstance(project).dirDirtyRecursively(project.getBaseDir()); if (checker.isHadNoMappings() && SvnUtil.seemsLikeVersionedDir(baseDir)) { final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(project); vcsManager.setDirectoryMappings(Collections.singletonList(VcsDirectoryMapping.createDefault(SvnVcs.VCS_NAME))); } }, ModalityState.nonModal(), project.getDisposed())); } } }