##// END OF EJS Templates
rhg: Colored output is not supported...
Simon Sapin -
r49163:d71b9902 default
parent child Browse files
Show More
@@ -28,7 +28,7 b' fn main_with_result('
28 repo: Result<&Repo, &NoRepoInCwdError>,
28 repo: Result<&Repo, &NoRepoInCwdError>,
29 config: &Config,
29 config: &Config,
30 ) -> Result<(), CommandError> {
30 ) -> Result<(), CommandError> {
31 check_unsupported(config)?;
31 check_unsupported(config, ui)?;
32
32
33 let app = App::new("rhg")
33 let app = App::new("rhg")
34 .global_setting(AppSettings::AllowInvalidUtf8)
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 check_extensions(config)?;
624 check_extensions(config)?;
622
625
623 if std::env::var_os("HG_PENDING").is_some() {
626 if std::env::var_os("HG_PENDING").is_some() {
@@ -634,5 +637,11 b' fn check_unsupported(config: &Config) ->'
634 Err(CommandError::unsupported("[decode] config"))?
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 Ok(())
646 Ok(())
638 }
647 }
@@ -1,7 +1,3 b''
1 TODO: fix rhg bugs that make this test fail when status is enabled
2 $ unset RHG_STATUS
3
4
5 $ cat <<EOF >> $HGRCPATH
1 $ cat <<EOF >> $HGRCPATH
6 > [ui]
2 > [ui]
7 > color = always
3 > color = always
General Comments 0
You need to be logged in to leave comments. Login now