D10139: rhg: Add support for the HGRCSKIPREPO environment variable
SimonSapin
phabricator at mercurial-scm.org
Tue Mar 9 09:42:43 UTC 2021
SimonSapin created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D10139
AFFECTED FILES
rust/hg-core/src/config/config.rs
rust/hg-core/src/repo.rs
CHANGE DETAILS
diff --git a/rust/hg-core/src/repo.rs b/rust/hg-core/src/repo.rs
--- a/rust/hg-core/src/repo.rs
+++ b/rust/hg-core/src/repo.rs
@@ -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,
diff --git a/rust/hg-core/src/config/config.rs b/rust/hg-core/src/config/config.rs
--- a/rust/hg-core/src/config/config.rs
+++ b/rust/hg-core/src/config/config.rs
@@ -23,6 +23,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>,
}
To: SimonSapin, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
More information about the Mercurial-devel
mailing list