*/
protected abstract LocalClone cloneAtLocalRoot(String localroot);
@Override
public Codebase create(Map<String, String> options) throws CodebaseCreationError {
LocalClone headClone;
File archiveLocation;
String localRoot = options.get("localroot");
if (Strings.isNullOrEmpty(localRoot)) {
Revision rev = revisionHistory.findHighestRevision(options.get("revision"));
headClone = headCloneSupplier.get();
archiveLocation = headClone.archiveAtRevision(rev.revId);
} else {
// TODO(user): Archive only (don't clone) if localroot is set.
headClone = cloneAtLocalRoot(localRoot);
archiveLocation = headClone.archiveAtRevision(null);
}
// Filter files in the codebase by RepositoryConfig#ignoreFileRes.
Predicate<CharSequence> nonIgnoredFilePred =
Utils.nonMatchingPredicateFromRes(headClone.getConfig().getIgnoreFileRes());
Utils.filterFiles(archiveLocation, nonIgnoredFilePred);
return new Codebase(
archiveLocation,
projectSpace,
new RepositoryExpression(new Term(headClone.getRepositoryName(), options)));
}