Show More
@@ -2165,6 +2165,14 b' The pure Rust fast-path for Mercurial. S' | |||
|
2165 | 2165 | Path to the executable to run in a sub-process when falling back to |
|
2166 | 2166 | another implementation of Mercurial. |
|
2167 | 2167 | |
|
2168 | ``fallback-immediately`` | |
|
2169 | Fall back to ``fallback-executable`` as soon as possible, regardless of | |
|
2170 | the `rhg.on-unsupported` configuration. Useful for debugging, for example to | |
|
2171 | bypass `rhg` if the deault `hg` points to `rhg`. | |
|
2172 | ||
|
2173 | Note that because this requires loading the configuration, it is possible | |
|
2174 | that `rhg` error out before being able to fall back. | |
|
2175 | ||
|
2168 | 2176 | ``ignored-extensions`` |
|
2169 | 2177 | Controls which extensions should be ignored by `rhg`. By default, `rhg` |
|
2170 | 2178 | triggers the `rhg.on-unsupported` behavior any unsupported extensions. |
@@ -348,6 +348,24 b' fn rhg_main(argv: Vec<OsString>) -> ! {' | |||
|
348 | 348 | let config = config_cow.as_ref(); |
|
349 | 349 | let ui = Ui::new(&config) |
|
350 | 350 | .unwrap_or_else(|error| early_exit(&config, error.into())); |
|
351 | ||
|
352 | if let Ok(true) = config.get_bool(b"rhg", b"fallback-immediately") { | |
|
353 | exit( | |
|
354 | &argv, | |
|
355 | &initial_current_dir, | |
|
356 | &ui, | |
|
357 | OnUnsupported::Fallback { | |
|
358 | executable: config | |
|
359 | .get(b"rhg", b"fallback-executable") | |
|
360 | .map(ToOwned::to_owned), | |
|
361 | }, | |
|
362 | Err(CommandError::unsupported( | |
|
363 | "`rhg.fallback-immediately is true`", | |
|
364 | )), | |
|
365 | false, | |
|
366 | ) | |
|
367 | } | |
|
368 | ||
|
351 | 369 | let result = main_with_result( |
|
352 | 370 | argv.iter().map(|s| s.to_owned()).collect(), |
|
353 | 371 | &process_start_time, |
@@ -168,6 +168,10 b' Fallback to Python' | |||
|
168 | 168 | $ rhg cat original --exclude="*.rs" |
|
169 | 169 | original content |
|
170 | 170 | |
|
171 | Check that `fallback-immediately` overrides `$NO_FALLBACK` | |
|
172 | $ $NO_FALLBACK rhg cat original --exclude="*.rs" --config rhg.fallback-immediately=1 | |
|
173 | original content | |
|
174 | ||
|
171 | 175 | $ (unset RHG_FALLBACK_EXECUTABLE; rhg cat original --exclude="*.rs") |
|
172 | 176 | abort: 'rhg.on-unsupported=fallback' without 'rhg.fallback-executable' set. |
|
173 | 177 | [255] |
General Comments 0
You need to be logged in to leave comments.
Login now