public static void readCommitMetadata(@NotNull Project project,
                                        @NotNull VirtualFile root,
                                        @NotNull List<String> hashes,
                                        @NotNull Consumer<? super VcsCommitMetadata> consumer) throws VcsException {
    final VcsLogObjectsFactory factory = getObjectsFactoryWithDisposeCheck(project);
    if (factory == null) return;

    HgVcs hgvcs = HgVcs.getInstance(project);
    assert hgvcs != null;
    final HgVersion version = hgvcs.getVersion();
    List<String> templateList = HgBaseLogParser.constructDefaultTemplate(version);
    templateList.add("{desc}");
    final String[] templates = ArrayUtilRt.toStringArray(templateList);

    HgBaseLogParser<VcsCommitMetadata> parser = createMetadataParser(root, factory);

    readLog(project, root, hgvcs.getVersion(), -1,
            prepareHashes(hashes),
            HgChangesetUtil.makeTemplate(templates),
            stringBuilder -> {
              VcsCommitMetadata metadata = parser.convert(stringBuilder.toString());
              if (metadata != null) {
                consumer.consume(metadata);
              }
            });
  }
public static void readCommitMetadata(@NotNull Project project,
                                        @NotNull VirtualFile root,
                                        @NotNull List<String> hashes,
                                        @NotNull Consumer<? super VcsCommitMetadata> consumer)