Mercurial > hg
diff rust/rhg/src/main.rs @ 48734:3e2b4bb286e7
rhg: Colorize `rhg status` output when appropriate
Differential Revision: https://phab.mercurial-scm.org/D12168
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Tue, 08 Feb 2022 14:20:58 +0100 |
parents | 39c447e03dbc |
children | f19be290756a |
line wrap: on
line diff
--- a/rust/rhg/src/main.rs Thu Feb 10 12:59:32 2022 +0100 +++ b/rust/rhg/src/main.rs Tue Feb 08 14:20:58 2022 +0100 @@ -30,7 +30,7 @@ repo: Result<&Repo, &NoRepoInCwdError>, config: &Config, ) -> Result<(), CommandError> { - check_unsupported(config, repo, ui)?; + check_unsupported(config, repo)?; let app = App::new("rhg") .global_setting(AppSettings::AllowInvalidUtf8) @@ -679,7 +679,6 @@ fn check_unsupported( config: &Config, repo: Result<&Repo, &NoRepoInCwdError>, - ui: &ui::Ui, ) -> Result<(), CommandError> { check_extensions(config)?; @@ -703,13 +702,5 @@ Err(CommandError::unsupported("[decode] config"))? } - if let Some(color) = config.get(b"ui", b"color") { - if (color == b"always" || color == b"debug") - && !ui.plain(Some("color")) - { - Err(CommandError::unsupported("colored output"))? - } - } - Ok(()) }