rhg: Add support for the HGRCSKIPREPO environment variable
It’s easy enough and affects tests, well, that test that feature.
Differential Revision: https://phab.mercurial-scm.org/D10139
--- a/rust/hg-core/src/config/config.rs Mon Mar 08 08:35:43 2021 +0100
+++ b/rust/hg-core/src/config/config.rs Mon Mar 08 08:55:48 2021 +0100
@@ -24,6 +24,7 @@
/// Holds the config values for the current repository
/// TODO update this docstring once we support more sources
+#[derive(Clone)]
pub struct Config {
layers: Vec<layer::ConfigLayer>,
}
--- a/rust/hg-core/src/repo.rs Mon Mar 08 08:35:43 2021 +0100
+++ b/rust/hg-core/src/repo.rs Mon Mar 08 08:55:48 2021 +0100
@@ -169,7 +169,11 @@
reqs.extend(requirements::load(Vfs { base: &store_path })?);
}
- let repo_config = config.combine_with_repo(&repo_config_files)?;
+ let repo_config = if std::env::var_os("HGRCSKIPREPO").is_none() {
+ config.combine_with_repo(&repo_config_files)?
+ } else {
+ config.clone()
+ };
let repo = Self {
requirements: reqs,