diff rust/rhg/src/main.rs @ 50764:8ff187fbbfea

rust-config: add config getters that don't fall back to defaults This is useful in cases where we access config items that are more... lenient with their types than a fresh new system would allow. For now there is only a single use of this, but we might get more later.
author Raphaël Gomès <rgomes@octobus.net>
date Mon, 13 Feb 2023 18:11:48 +0100
parents 14b57943ae6d
children 53d77f96e049
line wrap: on
line diff
--- a/rust/rhg/src/main.rs	Thu Jul 06 14:32:07 2023 +0200
+++ b/rust/rhg/src/main.rs	Mon Feb 13 18:11:48 2023 +0100
@@ -86,7 +86,8 @@
         // Mercurial allows users to define generic hooks for commands,
         // fallback if any are detected
         let item = format!("{}-{}", prefix, subcommand_name);
-        let hook_for_command = config.get_str(b"hooks", item.as_bytes())?;
+        let hook_for_command =
+            config.get_str_no_default(b"hooks", item.as_bytes())?;
         if hook_for_command.is_some() {
             let msg = format!("{}-{} hook defined", prefix, subcommand_name);
             return Err(CommandError::unsupported(msg));