final String name, final RepositoryConfig config) throws InvalidProject {
Preconditions.checkArgument(config.getType() == RepositoryType.hg);
final String url = config.getUrl();
if (url == null || url.isEmpty()) {
throw new InvalidProject("Hg repository config missing \"url\".");
}
Supplier<HgClonedRepository> freshSupplier = new Supplier<HgClonedRepository>() {
@Override public HgClonedRepository get() {
HgClonedRepository tipClone = new HgClonedRepository(name, config);