mercurial/config.py
changeset 45208 f7f142d74df3
parent 43506 9f70512ae2cf
child 45254 3f54242781e9
--- a/mercurial/config.py	Wed Jul 22 22:38:42 2020 -0700
+++ b/mercurial/config.py	Tue Jul 21 23:50:42 2020 -0700
@@ -168,7 +168,7 @@
                     inc = os.path.normpath(os.path.join(base, expanded))
 
                     try:
-                        include(inc, remap=remap, sections=sections)
+                        include(expanded, inc, remap=remap, sections=sections)
                         break
                     except IOError as inst:
                         if inst.errno != errno.ENOENT:
@@ -216,8 +216,12 @@
             b'config files must be opened in binary mode, got fp=%r mode=%r'
             % (fp, fp.mode,)
         )
+
+        def include(rel, abs, remap, sections):
+            self.read(abs, remap=remap, sections=sections)
+
         self.parse(
-            path, fp.read(), sections=sections, remap=remap, include=self.read
+            path, fp.read(), sections=sections, remap=remap, include=include
         )