mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
backingstore: do not require remotefilelog.reponame to be set
Summary: Some repos do not have `remotefilelog.reponame` set, so this shouldn't be a required config item. Reviewed By: fanzeyi Differential Revision: D22553141 fbshipit-source-id: a0fe9c289a1a32650572a4c123cda60af90e79ec
This commit is contained in:
parent
aa3e38ac78
commit
165f387df5
@ -36,10 +36,9 @@ impl BackingStore {
|
||||
config.load_user();
|
||||
config.load_hgrc(hg.join("hgrc"), "repository");
|
||||
|
||||
let repo_name: RepoName = config
|
||||
let repo_name: Option<RepoName> = config
|
||||
.get_opt("remotefilelog", "reponame")
|
||||
.context("Invalid repo name")?
|
||||
.context("No repo name specified in remotefilelog.reponame")?;
|
||||
.context("Invalid repo name")?;
|
||||
|
||||
let store_path = hg.join("store");
|
||||
let mut blobstore = ContentStoreBuilder::new(&config).local_path(&store_path);
|
||||
@ -55,7 +54,8 @@ impl BackingStore {
|
||||
Err(e) => warn!("couldn't initialize Memcache: {}", e),
|
||||
}
|
||||
|
||||
let (blobstore, treestore) = if use_edenapi {
|
||||
let (blobstore, treestore) = if use_edenapi && repo_name.is_some() {
|
||||
let repo_name = repo_name.unwrap();
|
||||
let edenapi = EdenApiBuilder::from_config(&config)?.build()?;
|
||||
let edenapi: Arc<dyn EdenApi> = Arc::new(edenapi);
|
||||
let fileremotestore = EdenApiFileStore::new(repo_name.clone(), edenapi.clone());
|
||||
|
Loading…
Reference in New Issue
Block a user