Submitter | phabricator |
---|---|
Date | Nov. 26, 2021, 2:12 p.m. |
Message ID | <differential-rev-PHID-DREV-fj47zqc7il2yjy7m5jja-req@mercurial-scm.org> |
Download | mbox | patch |
Permalink | /patch/50138/ |
State | Superseded |
Headers | show |
Comments
Patch
diff --git a/rust/hg-core/src/config/config.rs b/rust/hg-core/src/config/config.rs --- a/rust/hg-core/src/config/config.rs +++ b/rust/hg-core/src/config/config.rs @@ -361,6 +361,15 @@ Ok(self.get_option(section, item)?.unwrap_or(false)) } + /// Returns `true` if the extension is enabled, `false` otherwise + pub fn is_extension_enabled(&self, extension: &[u8]) -> bool { + let value = self.get(b"extensions", extension); + match value { + Some(c) => !c.starts_with(b"!"), + None => false, + } + } + /// If there is an `item` value in `section`, parse and return a list of /// byte strings. pub fn get_list(