mirror of
https://github.com/facebook/sapling.git
synced 2024-10-04 13:57:13 +03:00
config/set: provide the "primary" layer
Summary: Provide the ConfigSet content as a layer so it can be inspected. Reviewed By: muirdm Differential Revision: D56592490 fbshipit-source-id: d443f85c477568e6bf5210e9dc8a96bd2ed6a0c4
This commit is contained in:
parent
2b248450d2
commit
385c056c48
@ -198,7 +198,14 @@ impl Config for ConfigSet {
|
||||
|
||||
fn layers(&self) -> Vec<Arc<dyn Config>> {
|
||||
if let Some(secondary) = &self.secondary {
|
||||
secondary.layers()
|
||||
let mut layers = secondary.layers();
|
||||
if !self.sections.is_empty() {
|
||||
// PERF: This clone can be slow.
|
||||
let mut primary = self.clone().named("primary");
|
||||
primary.secondary = None;
|
||||
layers.push(Arc::new(primary))
|
||||
}
|
||||
layers
|
||||
} else {
|
||||
Vec::new()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user