Patchwork [02,of,10,RFC,v2] ui: add a defaults layer to the config

login
register
mail settings
Submitter David Soria Parra
Date March 12, 2017, 10:40 p.m.
Message ID <084a30b54810d05c8b44.1489358425@davidsp-mbp.dhcp.thefacebook.com>
Download mbox | patch
Permalink /patch/19244/
State Changes Requested
Headers show

Comments

David Soria Parra - March 12, 2017, 10:40 p.m.
# HG changeset patch
# User David Soria Parra <davidsp@fb.com>
# Date 1489349206 25200
#      Sun Mar 12 13:06:46 2017 -0700
# Node ID 084a30b54810d05c8b44d22fcab2ef6f783a9f7c
# Parent  99514a82d5b23c75bd6da38e522acfd14a618c14
ui: add a defaults layer to the config

Add a defaults layer to the config that has the least precedence. This will
allow us to load defaults based on compatibility settings without interferring
with trusted or user.

Patch

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -304,7 +304,8 @@ 
     def cfg(self):
         # Ordered in ascneding order of preference.
         return util.sortdict(
-            [('user', config.config()),
+            [('defaults', config.config()),
+            ('user', config.config()),
             ('trusted', config.config()),
             ('overlay', config.config())])