diff mercurial/ui.py @ 31679:0f8ba0bc1154

rcutil: move scmutil.*rcpath to rcutil (API) As discussed at [1], the logic around "actual config"s seem to be non-trivial enough that it's worth a new module. This patch creates the module and move "scmutil.*rcpath" functions there as the first step. More methods will be moved to the module in the future. The module is different from config.py because the latter only cares about data structure and parsing, and does not care about special case, or system config paths, or environment variables. [1]: https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-March/095503.html
author Jun Wu <quark@fb.com>
date Sun, 26 Mar 2017 20:18:42 -0700
parents c60091fa1426
children 07d62fa518a4
line wrap: on
line diff
--- a/mercurial/ui.py	Sat Mar 25 17:25:23 2017 +0900
+++ b/mercurial/ui.py	Sun Mar 26 20:18:42 2017 -0700
@@ -33,6 +33,7 @@
     formatter,
     progress,
     pycompat,
+    rcutil,
     scmutil,
     util,
 )
@@ -211,7 +212,7 @@
         """Create a ui and load global and user configs"""
         u = cls()
         # we always trust global config files
-        for f in scmutil.rcpath():
+        for f in rcutil.rcpath():
             u.readconfig(f, trust=True)
         return u