diff rust/hg-core/src/config/layer.rs @ 50760:f8412da86d05

rust-config: add support for default config items Now that configitems.toml exists, we can read from it the default values for all core config items. We will add the devel-warning for use of undeclared config items in a later patch when we're done adding the missing entries for `rhg`.
author Rapha?l Gom?s <rgomes@octobus.net>
date Thu, 06 Jul 2023 14:32:07 +0200
parents e98fd81bb151
children 532e74ad3ff6
line wrap: on
line diff
--- a/rust/hg-core/src/config/layer.rs	Mon Jan 23 18:08:11 2023 +0100
+++ b/rust/hg-core/src/config/layer.rs	Thu Jul 06 14:32:07 2023 +0200
@@ -304,8 +304,9 @@
     CommandLineColor,
     /// From environment variables like `$PAGER` or `$EDITOR`
     Environment(Vec<u8>),
-    /* TODO defaults (configitems.py)
-     * TODO extensions
+    /// From configitems.toml
+    Defaults,
+    /* TODO extensions
      * TODO Python resources?
      * Others? */
 }
@@ -323,6 +324,9 @@
             ConfigOrigin::Tweakdefaults => {
                 write_bytes!(out, b"ui.tweakdefaults")
             }
+            ConfigOrigin::Defaults => {
+                write_bytes!(out, b"configitems.toml")
+            }
         }
     }
 }