public static @Nullable String getConfig(@NotNull Project project,
                                           @NotNull VirtualFile root,
                                           @NotNull String section,
                                           @Nullable String configName) {
    HgRepository hgRepository = getRepositoryManager(project).getRepositoryForRoot(root);
    assert hgRepository != null : "Repository can't be null for root " + root.getName();
    return hgRepository.getRepositoryConfig().getNamedConfig(section, configName);
  }
public static @Nullable String getConfig(@NotNull Project project,
                                           @NotNull VirtualFile root,
                                           @NotNull String section,
                                           @Nullable String configName)