martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  For PyOxidizer, we'll need to read the default configs using the
  `resources` module. This prepares for putting that call in rcutil.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D7628

AFFECTED FILES
  mercurial/rcutil.py

CHANGE DETAILS

diff --git a/mercurial/rcutil.py b/mercurial/rcutil.py
--- a/mercurial/rcutil.py
+++ b/mercurial/rcutil.py
@@ -10,6 +10,7 @@
 import os
 
 from . import (
+    config,
     encoding,
     pycompat,
     util,
@@ -90,10 +91,20 @@
                 continue
             _rccomponents.extend((b'path', p) for p in _expandrcpath(p))
     else:
+        default_entries = []
+        for path in defaultrcpath():
+            cfg = config.config()
+            cfg.read(path)
+            for section in cfg:
+                for name, value in cfg.items(section):
+                    source = cfg.source(section, name)
+                    default_entries.append((section, name, value, source))
+        _rccomponents = [(b'items', default_entries)]
+
         normpaths = lambda paths: [
             (b'path', os.path.normpath(p)) for p in paths
         ]
-        _rccomponents = normpaths(defaultrcpath() + systemrcpath())
+        _rccomponents.extend(normpaths(systemrcpath()))
         _rccomponents.append(envrc)
         _rccomponents.extend(normpaths(userrcpath()))
     return _rccomponents



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to