void (final @NotNull List<? extends VcsFullCommitDetails> commits) { Map<HgRepository, List<VcsFullCommitDetails>> commitsInRoots = DvcsUtil.groupCommitsByRoots( HgUtil.getRepositoryManager(myProject), commits); for (Map.Entry<HgRepository, List<VcsFullCommitDetails>> entry : commitsInRoots.entrySet()) { processGrafting(entry.getKey(), ContainerUtil.map(entry.getValue(), commitDetails -> commitDetails.getId().asString())); } }