[Request] [+ ] D8795: config: re-calculate absolute %include path in `include` callback

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Wed Jul 22 17:40:25 UTC 2020


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

REVISION SUMMARY
  This removes the last user of the `abs` argument for the `include`
  callback. The next patch will remove the argument.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/config.py

CHANGE DETAILS

diff --git a/mercurial/config.py b/mercurial/config.py
--- a/mercurial/config.py
+++ b/mercurial/config.py
@@ -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(



To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20200722/36d8070d/attachment.html>


More information about the Mercurial-patches mailing list