Mercurial > hg
changeset 46722:08a35cec14d4
rhg: Add environment variables for fallback configuration
For the `rust-tests.py --rhg` we want every `hg` command in tests
to run `rhg` with fallback enabled, but other methods of setting
configuration are limited or disruptive as discussed in code comment.
Differential Revision: https://phab.mercurial-scm.org/D10186
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Fri, 12 Mar 2021 18:45:32 +0100 |
parents | e3f15c553522 |
children | a6553ba1c598 |
files | rust/hg-core/src/config/config.rs |
diffstat | 1 files changed, 18 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/rust/hg-core/src/config/config.rs Thu Mar 11 11:22:54 2021 +0100 +++ b/rust/hg-core/src/config/config.rs Fri Mar 12 18:45:32 2021 +0100 @@ -78,9 +78,27 @@ if opt_rc_path.is_none() { config.add_system_config()? } + config.add_for_environment_variable("EDITOR", b"ui", b"editor"); config.add_for_environment_variable("VISUAL", b"ui", b"editor"); config.add_for_environment_variable("PAGER", b"pager", b"pager"); + + // These are set by `run-tests.py --rhg` to enable fallback for the + // entire test suite. Alternatives would be setting configuration + // through `$HGRCPATH` but some tests override that, or changing the + // `hg` shell alias to include `--config` but that disrupts tests that + // print command lines and check expected output. + config.add_for_environment_variable( + "RHG_ON_UNSUPPORTED", + b"rhg", + b"on-unsupported", + ); + config.add_for_environment_variable( + "RHG_FALLBACK_EXECUTABLE", + b"rhg", + b"fallback-executable", + ); + // HGRCPATH replaces user config if opt_rc_path.is_none() { config.add_user_config()?