##// END OF EJS Templates
rhg: [encode] and [decode] config sections are not supported...
Simon Sapin -
r49162:a2e278b5 default
parent child Browse files
Show More
@@ -403,6 +403,13 b' impl Config {'
403 .collect()
403 .collect()
404 }
404 }
405
405
406 /// Returns whether any key is defined in the given section
407 pub fn has_non_empty_section(&self, section: &[u8]) -> bool {
408 self.layers
409 .iter()
410 .any(|layer| layer.has_non_empty_section(section))
411 }
412
406 /// Get raw values bytes from all layers (even untrusted ones) in order
413 /// Get raw values bytes from all layers (even untrusted ones) in order
407 /// of precedence.
414 /// of precedence.
408 #[cfg(test)]
415 #[cfg(test)]
@@ -127,6 +127,13 b' impl ConfigLayer {'
127 .flat_map(|section| section.keys().map(|vec| &**vec))
127 .flat_map(|section| section.keys().map(|vec| &**vec))
128 }
128 }
129
129
130 /// Returns whether any key is defined in the given section
131 pub fn has_non_empty_section(&self, section: &[u8]) -> bool {
132 self.sections
133 .get(section)
134 .map_or(false, |section| !section.is_empty())
135 }
136
130 pub fn is_empty(&self) -> bool {
137 pub fn is_empty(&self) -> bool {
131 self.sections.is_empty()
138 self.sections.is_empty()
132 }
139 }
@@ -626,5 +626,13 b' fn check_unsupported(config: &Config) ->'
626 Err(CommandError::unsupported("$HG_PENDING"))?
626 Err(CommandError::unsupported("$HG_PENDING"))?
627 }
627 }
628
628
629 if config.has_non_empty_section(b"encode") {
630 Err(CommandError::unsupported("[encode] config"))?
631 }
632
633 if config.has_non_empty_section(b"decode") {
634 Err(CommandError::unsupported("[decode] config"))?
635 }
636
629 Ok(())
637 Ok(())
630 }
638 }
@@ -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 Test encode/decode filters
1 Test encode/decode filters
6
2
7 $ hg init
3 $ hg init
General Comments 0
You need to be logged in to leave comments. Login now