mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
configs: make backingstore load hg configs through the approved path
Summary: Previously the backing store was loading configs manually. Now that system, dynamic, user, and repo config loading are unified, let's go through that approved path. Reviewed By: kulshrax Differential Revision: D22736338 fbshipit-source-id: 232023e660107a096691e9d99bf89c04c218dfbd
This commit is contained in:
parent
6da00020eb
commit
0cf7ebeffe
@ -9,7 +9,6 @@ use crate::remotestore::FakeRemoteStore;
|
||||
use crate::treecontentstore::TreeContentStore;
|
||||
use crate::utils::key_from_path_node_slice;
|
||||
use anyhow::Result;
|
||||
use configparser::config::{ConfigSet, Options};
|
||||
use configparser::hg::ConfigSetHgExt;
|
||||
use edenapi::{Builder as EdenApiBuilder, EdenApi};
|
||||
use log::warn;
|
||||
@ -31,11 +30,7 @@ pub struct BackingStore {
|
||||
impl BackingStore {
|
||||
pub fn new<P: AsRef<Path>>(repository: P, use_edenapi: bool) -> Result<Self> {
|
||||
let hg = repository.as_ref().join(".hg");
|
||||
let options = Options::new();
|
||||
let mut config = ConfigSet::new();
|
||||
config.load_system(options.clone());
|
||||
config.load_user(options.clone());
|
||||
config.load_hgrc(hg.join("hgrc"), "repository");
|
||||
let config = configparser::hg::load::<String, String>(Some(&hg), None)?;
|
||||
|
||||
let store_path = hg.join("store");
|
||||
let mut blobstore = ContentStoreBuilder::new(&config).local_path(&store_path);
|
||||
|
Loading…
Reference in New Issue
Block a user