mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 16:31:02 +03:00
scmstore: add method for getting local-only TreeStore
Summary: Add a `local` method to `TreeStore` like the one on `FileStore` which returns a `TreeStore` with only the local subset of backends. Required for `BackingStore` implementation. Reviewed By: kulshrax Differential Revision: D30253980 fbshipit-source-id: 142f2d88454826ff9cb9c34f30b7d21bf62b297c
This commit is contained in:
parent
47fd500315
commit
c5b59696e9
@ -245,6 +245,20 @@ impl TreeStore {
|
||||
}))
|
||||
}
|
||||
|
||||
/// Returns a TreeStore with only the local subset of backends
|
||||
pub fn local(&self) -> TreeStore {
|
||||
TreeStore {
|
||||
indexedlog_local: self.indexedlog_local.clone(),
|
||||
indexedlog_cache: self.indexedlog_cache.clone(),
|
||||
cache_to_local_cache: false,
|
||||
memcache: None,
|
||||
cache_to_memcache: false,
|
||||
edenapi: None,
|
||||
contentstore: None,
|
||||
creation_time: Instant::now(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn empty() -> Self {
|
||||
TreeStore {
|
||||
indexedlog_local: None,
|
||||
|
Loading…
Reference in New Issue
Block a user