void (final @NotNull List<FilePath> filesToDelete) { List<HgFile> deletes = new ArrayList<>(); for (FilePath file : filesToDelete) { VirtualFile root = VcsUtil.getVcsRootFor(myProject, file); if (root != null) { deletes.add(new HgFile(root, file)); } } if (!deletes.isEmpty()) { new HgRemoveCommand(myProject).executeInCurrentThread(deletes); } for (HgFile file : deletes) { dirtyScopeManager.fileDirty(file.toFilePath()); } }