Patchwork D8795: config: re-calculate absolute %include path in `include` callback

login
register
mail settings
Submitter phabricator
Date July 22, 2020, 5:40 p.m.
Message ID <differential-rev-PHID-DREV-wv6xrxxunstj4tz6ivdn-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46839/
State Superseded
Headers show

Comments

phabricator - July 22, 2020, 5:40 p.m.
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




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

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(