rust/rhg/src/ui.rs
changeset 50539 74e4dbb0fcd5
parent 49981 364e78389653
child 51120 532e74ad3ff6
equal deleted inserted replaced
50538:a7513d0d451b 50539:74e4dbb0fcd5
   217     if let Some(formatted) = config.get_option(b"ui", b"formatted")? {
   217     if let Some(formatted) = config.get_option(b"ui", b"formatted")? {
   218         Ok(formatted)
   218         Ok(formatted)
   219     } else {
   219     } else {
   220         isatty(config)
   220         isatty(config)
   221     }
   221     }
       
   222 }
       
   223 
       
   224 pub enum RelativePaths {
       
   225     Legacy,
       
   226     Bool(bool),
       
   227 }
       
   228 
       
   229 pub fn relative_paths(config: &Config) -> Result<RelativePaths, HgError> {
       
   230     Ok(match config.get(b"ui", b"relative-paths") {
       
   231         None | Some(b"legacy") => RelativePaths::Legacy,
       
   232         _ => RelativePaths::Bool(config.get_bool(b"ui", b"relative-paths")?),
       
   233     })
   222 }
   234 }
   223 
   235 
   224 fn isatty(config: &Config) -> Result<bool, HgError> {
   236 fn isatty(config: &Config) -> Result<bool, HgError> {
   225     Ok(if config.get_bool(b"ui", b"nontty")? {
   237     Ok(if config.get_bool(b"ui", b"nontty")? {
   226         false
   238         false