Mercurial > hg-stable
diff rust/rhg/src/main.rs @ 46747:1a036d33bc18
rhg: Add an allow-list of ignored extensions
Because rhg doesn’t know how a Python extension would affect
behavior it implements in Rust, when an unsupported extension
is enabled it conservatively falls back to Python-based hg.
However many users will have unsupported extensions enabled in practice.
Maybe they don’t actually affect rhg behavior, but we don’t know.
This adds a `rhg.ignored-extensions` configuration that lets
users list extensions that rhg can safely ignore and proceed even
if they’re not supported in Rust.
Differential Revision: https://phab.mercurial-scm.org/D10188
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Fri, 12 Mar 2021 22:38:40 +0100 |
parents | 1bac7764ceef |
children | 2255e7eb39e5 |
line wrap: on
line diff
--- a/rust/rhg/src/main.rs Thu Mar 04 10:58:43 2021 +0100 +++ b/rust/rhg/src/main.rs Fri Mar 12 22:38:40 2021 +0100 @@ -365,12 +365,20 @@ unsupported.remove(supported); } + if let Some(ignored_list) = + config.get_simple_list(b"rhg", b"ignored-extensions") + { + for ignored in ignored_list { + unsupported.remove(ignored); + } + } + if unsupported.is_empty() { Ok(()) } else { Err(CommandError::UnsupportedFeature { message: format_bytes!( - b"extensions: {}", + b"extensions: {} (consider adding them to 'rhg.ignored-extensions' config)", join(unsupported, b", ") ), })