config: re-calculate absolute %include path in `include` callback
authorMartin von Zweigbergk <martinvonz@google.com>
Wed, 22 Jul 2020 10:32:28 -0700
changeset 45256 83ca8d6f3206
parent 45255 0323972f78f3
child 45257 668af67bfd18
config: re-calculate absolute %include path in `include` callback This removes the last user of the `abs` argument for the `include` callback. The next patch will remove the argument. Differential Revision: https://phab.mercurial-scm.org/D8795
mercurial/config.py
--- a/mercurial/config.py	Wed Jul 22 10:25:28 2020 -0700
+++ b/mercurial/config.py	Wed Jul 22 10:32:28 2020 -0700
@@ -213,7 +213,10 @@
             % (fp, fp.mode,)
         )
 
+        dir = os.path.dirname(path)
+
         def include(rel, abs, remap, sections):
+            abs = os.path.normpath(os.path.join(dir, rel))
             self.read(abs, remap=remap, sections=sections)
 
         self.parse(