changeset 45256:83ca8d6f3206

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
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 22 Jul 2020 10:32:28 -0700
parents 0323972f78f3
children 668af67bfd18
files mercurial/config.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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(