void (final VirtualFile repo) { final Map<HgFile, HgResolveStatusEnum> resolves = new HgResolveCommand(myProject).getListSynchronously(repo); final List<File> conflictFiles = new ArrayList<>(); for (HgFile hgFile : resolves.keySet()) { File file = hgFile.getFile(); if (resolves.get(hgFile) == HgResolveStatusEnum.UNRESOLVED) { conflictFiles.add(file); updateUpdatedFiles(file, true); } else { updateUpdatedFiles(file, false); } } if (conflictFiles.isEmpty()) return; final HgVcs vcs = HgVcs.getInstance(myProject); if (vcs == null) return; final List<VirtualFile> conflicts = sortVirtualFilesByPresentation(findVirtualFilesWithRefresh(conflictFiles)); ApplicationManager.getApplication().invokeAndWait( () -> AbstractVcsHelper.getInstance(myProject).showMergeDialog(conflicts, vcs.getMergeProvider())); }