@Nullable
  private static HgRepository chooseRepository(@NotNull List<? extends HgRepository> repositories) {
    assert !repositories.isEmpty();
    return repositories.size() > 1 ? null : repositories.get(0);
  }
@Nullable
  private static HgRepository chooseRepository(@NotNull List<? extends HgRepository> repositories)