Show More
@@ -28,7 +28,7 b' fn main_with_result(' | |||
|
28 | 28 | repo: Result<&Repo, &NoRepoInCwdError>, |
|
29 | 29 | config: &Config, |
|
30 | 30 | ) -> Result<(), CommandError> { |
|
31 | check_unsupported(config)?; | |
|
31 | check_unsupported(config, ui)?; | |
|
32 | 32 | |
|
33 | 33 | let app = App::new("rhg") |
|
34 | 34 | .global_setting(AppSettings::AllowInvalidUtf8) |
@@ -617,7 +617,10 b' fn check_extensions(config: &Config) -> ' | |||
|
617 | 617 | } |
|
618 | 618 | } |
|
619 | 619 | |
|
620 | fn check_unsupported(config: &Config) -> Result<(), CommandError> { | |
|
620 | fn check_unsupported( | |
|
621 | config: &Config, | |
|
622 | ui: &ui::Ui, | |
|
623 | ) -> Result<(), CommandError> { | |
|
621 | 624 | check_extensions(config)?; |
|
622 | 625 | |
|
623 | 626 | if std::env::var_os("HG_PENDING").is_some() { |
@@ -634,5 +637,11 b' fn check_unsupported(config: &Config) ->' | |||
|
634 | 637 | Err(CommandError::unsupported("[decode] config"))? |
|
635 | 638 | } |
|
636 | 639 | |
|
640 | if let Some(color) = config.get(b"ui", b"color") { | |
|
641 | if (color == b"always" || color == b"debug") && !ui.plain() { | |
|
642 | Err(CommandError::unsupported("colored output"))? | |
|
643 | } | |
|
644 | } | |
|
645 | ||
|
637 | 646 | Ok(()) |
|
638 | 647 | } |
General Comments 0
You need to be logged in to leave comments.
Login now