76 let opt_rc_path = env::var_os("HGRCPATH"); |
76 let opt_rc_path = env::var_os("HGRCPATH"); |
77 // HGRCPATH replaces system config |
77 // HGRCPATH replaces system config |
78 if opt_rc_path.is_none() { |
78 if opt_rc_path.is_none() { |
79 config.add_system_config()? |
79 config.add_system_config()? |
80 } |
80 } |
|
81 |
81 config.add_for_environment_variable("EDITOR", b"ui", b"editor"); |
82 config.add_for_environment_variable("EDITOR", b"ui", b"editor"); |
82 config.add_for_environment_variable("VISUAL", b"ui", b"editor"); |
83 config.add_for_environment_variable("VISUAL", b"ui", b"editor"); |
83 config.add_for_environment_variable("PAGER", b"pager", b"pager"); |
84 config.add_for_environment_variable("PAGER", b"pager", b"pager"); |
|
85 |
|
86 // These are set by `run-tests.py --rhg` to enable fallback for the |
|
87 // entire test suite. Alternatives would be setting configuration |
|
88 // through `$HGRCPATH` but some tests override that, or changing the |
|
89 // `hg` shell alias to include `--config` but that disrupts tests that |
|
90 // print command lines and check expected output. |
|
91 config.add_for_environment_variable( |
|
92 "RHG_ON_UNSUPPORTED", |
|
93 b"rhg", |
|
94 b"on-unsupported", |
|
95 ); |
|
96 config.add_for_environment_variable( |
|
97 "RHG_FALLBACK_EXECUTABLE", |
|
98 b"rhg", |
|
99 b"fallback-executable", |
|
100 ); |
|
101 |
84 // HGRCPATH replaces user config |
102 // HGRCPATH replaces user config |
85 if opt_rc_path.is_none() { |
103 if opt_rc_path.is_none() { |
86 config.add_user_config()? |
104 config.add_user_config()? |
87 } |
105 } |
88 if let Some(rc_path) = &opt_rc_path { |
106 if let Some(rc_path) = &opt_rc_path { |