# HG changeset patch
# User David Soria Parra <davi...@fb.com>
# Date 1489349206 25200
#      Sun Mar 12 13:06:46 2017 -0700
# Node ID 9eca95dec659b3ff37608fd257d888520599124d
# Parent  2dfa752cf0751010867944aa707bd7a722d3ea87
dispatch: modernize the ui after finalizing config loading

We have to carefuly load the defaults layer in the ui object after we have read
configurations and set --config, as we are modifying configurations based on a
config settings. In our case we have to ensure that 'ui.compat=' can be set from
--config or any hgrc, but when we detect it have to add our setting as early as
possible. Therefore we choose dispatch to add it, right after we finalize
--config parsing.

diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -26,6 +26,7 @@
     cmdutil,
     color,
     commands,
+    compat,
     debugcommands,
     demandimport,
     encoding,
@@ -178,6 +179,7 @@
                 for sec, name, val in cfgs:
                     req.repo.ui.setconfig(sec, name, val, source='--config')
 
+            compat.modernize(ui)
             # developer config: ui.debugger
             debugger = ui.config("ui", "debugger")
             debugmod = pdb
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to