Set<HgFile> (VirtualFile repo, Set<HgFile> selectedFiles) { List<HgRevisionNumber> parents = new HgWorkingCopyRevisionsCommand(myProject).parents(repo); HgStatusCommand statusCommand = new HgStatusCommand.Builder(true).unknown(false).ignored(false).baseRevision(parents.get(0)).build(myProject); Set<HgChange> allChangedFilesInRepo = statusCommand.executeInCurrentThread(repo); Set<HgFile> filesNotIncluded = new HashSet<>(); for (HgChange change : allChangedFilesInRepo) { HgFile beforeFile = change.beforeFile(); HgFile afterFile = change.afterFile(); if (!selectedFiles.contains(beforeFile)) { filesNotIncluded.add(beforeFile); } else if (!selectedFiles.contains(afterFile)) { filesNotIncluded.add(afterFile); } } return filesNotIncluded; }