changeset 46741:25e3dac511f0

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
author Simon Sapin <simon.sapin@octobus.net>
date Mon, 08 Mar 2021 08:55:48 +0100
parents 97ac588b6d9e
children 91ab5190a3de
files rust/hg-core/src/config/config.rs rust/hg-core/src/repo.rs
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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,