void (@NotNull Collection<HgFile> hgFiles) { for( Map.Entry<VirtualFile, List<String>> entry : HgUtil.getRelativePathsByRepository(hgFiles).entrySet()) { List<String> filePaths = entry.getValue(); for (List<String> chunkFiles : VcsFileUtil.chunkArguments(filePaths)) { List<String> parameters = new LinkedList<>(); parameters.addAll(chunkFiles); parameters.add(0, "--after"); new HgCommandExecutor(myProject).executeInCurrentThread(entry.getKey(), "remove", parameters); } } }