diff rust/rhg/src/blackbox.rs @ 46665:7284b524b441

rhg: Make configuration available as early as possible in main() Differential Revision: https://phab.mercurial-scm.org/D10090
author Simon Sapin <simon.sapin@octobus.net>
date Mon, 01 Mar 2021 13:51:35 +0100
parents 755c31a1caf9
children abbecb5cd6f3
line wrap: on
line diff
--- a/rust/rhg/src/blackbox.rs	Tue Mar 02 09:55:52 2021 +0100
+++ b/rust/rhg/src/blackbox.rs	Mon Mar 01 13:51:35 2021 +0100
@@ -52,20 +52,22 @@
         process_start_time: &'a ProcessStartTime,
     ) -> Result<Self, HgError> {
         let configured = if let Ok(repo) = invocation.repo {
-            let config = invocation.config();
-            if config.get(b"extensions", b"blackbox").is_none() {
+            if invocation.config.get(b"extensions", b"blackbox").is_none() {
                 // The extension is not enabled
                 None
             } else {
                 Some(ConfiguredBlackbox {
                     repo,
-                    max_size: config
+                    max_size: invocation
+                        .config
                         .get_byte_size(b"blackbox", b"maxsize")?
                         .unwrap_or(DEFAULT_MAX_SIZE),
-                    max_files: config
+                    max_files: invocation
+                        .config
                         .get_u32(b"blackbox", b"maxfiles")?
                         .unwrap_or(DEFAULT_MAX_FILES),
-                    date_format: config
+                    date_format: invocation
+                        .config
                         .get_str(b"blackbox", b"date-format")?
                         .unwrap_or(DEFAULT_DATE_FORMAT),
                 })