CheckinHandler (@NotNull CheckinProjectPanel panel, @NotNull CommitContext commitContext) { final Project project = panel.getProject(); return new CheckinHandler() { @Override public RefreshableOnComponent getBeforeCheckinConfigurationPanel() { return null; } @Override public ReturnResult beforeCheckin(@Nullable CommitExecutor executor, PairConsumer<Object, Object> additionalDataConsumer) { if (executor instanceof LocalCommitExecutor) return ReturnResult.COMMIT; final SvnVcs vcs = SvnVcs.getInstance(project); MultiMap<Url, WorkingCopyFormat> copiesInfo = splitIntoCopies(vcs, panel.getSelectedChanges()); List<Url> repoUrls = new ArrayList<>(); for (Map.Entry<Url, Collection<WorkingCopyFormat>> entry : copiesInfo.entrySet()) { if (entry.getValue().size() > 1) { repoUrls.add(entry.getKey()); } } if (! repoUrls.isEmpty()) { String join = StringUtil.join(repoUrls, Url::toDecodedString, ",\n"); final int isOk = showOkCancelDialog( project, message("checkin.different.formats.involved", repoUrls.size() > 1 ? 1 : 0, join), message("dialog.title.commit.will.split"), Messages.getWarningIcon() ); return Messages.OK == isOk ? ReturnResult.COMMIT : ReturnResult.CANCEL; } return ReturnResult.COMMIT; } @Override public void checkinSuccessful() { if (SvnConfiguration.getInstance(project).isAutoUpdateAfterCommit()) { final VirtualFile[] roots = ProjectLevelVcsManager.getInstance(project).getRootsUnderVcs(SvnVcs.getInstance(project)); final List<FilePath> paths = new ArrayList<>(); for (VirtualFile root : roots) { boolean take = false; for (VirtualFile commitRoot : panel.getRoots()) { if (VfsUtilCore.isAncestor(root, commitRoot, false)) { take = true; break; } } if (take) { paths.add(VcsUtil.getFilePath(root)); } } if (paths.isEmpty()) return; ApplicationManager.getApplication().invokeLater( () -> AutoSvnUpdater .run(new AutoSvnUpdater(project, paths.toArray(new FilePath[0])), VcsBundle.message("action.name.update")), ModalityState.nonModal()); } } }; }