[PATCH 2 of 6] config: allow remapping the default section

Yuya Nishihara yuya at tcha.org
Sat Oct 14 06:41:11 EDT 2017


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1507970501 -32400
#      Sat Oct 14 17:41:41 2017 +0900
# Node ID f9e359b56a221e7cd9a83ee4c65cb3eae9f0d814
# Parent  4725df3708cfa2117b12c9e1ee0d1a6143d7e87d
config: allow remapping the default section

The next patch depends on it. It doesn't make sense that the default section
can't be remapped with {'': whatever}.

diff --git a/mercurial/config.py b/mercurial/config.py
--- a/mercurial/config.py
+++ b/mercurial/config.py
@@ -118,6 +118,9 @@ class config(object):
         line = 0
         cont = False
 
+        if remap:
+            section = remap.get(section, section)
+
         for l in data.splitlines(True):
             line += 1
             if line == 1 and l.startswith('\xef\xbb\xbf'):


More information about the Mercurial-devel mailing list