Patchwork D8796: config: remove now-unused `abs` argument from `include` callback

login
register
mail settings
Submitter phabricator
Date July 22, 2020, 5:40 p.m.
Message ID <differential-rev-PHID-DREV-qjjuxojvipla44hniuqq-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46841/
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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/config.py
  mercurial/subrepoutil.py
  mercurial/templater.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -825,7 +825,7 @@ 
     base = os.path.dirname(mapfile)
     conf = config.config()
 
-    def include(rel, abs, remap, sections):
+    def include(rel, remap, sections):
         templatedirs = [base, templatedir()]
         for dir in templatedirs:
             abs = os.path.normpath(os.path.join(dir, rel))
diff --git a/mercurial/subrepoutil.py b/mercurial/subrepoutil.py
--- a/mercurial/subrepoutil.py
+++ b/mercurial/subrepoutil.py
@@ -36,7 +36,7 @@ 
     p = config.config()
     repo = ctx.repo()
 
-    def read(f, abs, sections=None, remap=None):
+    def read(f, sections=None, remap=None):
         if f in ctx:
             try:
                 data = ctx[f].data()
@@ -56,7 +56,7 @@ 
             )
 
     if b'.hgsub' in ctx:
-        read(b'.hgsub', b'.hgsub')
+        read(b'.hgsub')
 
     for path, src in ui.configitems(b'subpaths'):
         p.set(b'subpaths', path, src, ui.configsource(b'subpaths', path))
diff --git a/mercurial/config.py b/mercurial/config.py
--- a/mercurial/config.py
+++ b/mercurial/config.py
@@ -161,16 +161,13 @@ 
 
             if m and include:
                 expanded = util.expandpath(m.group(1))
-                inc = os.path.normpath(
-                    os.path.join(os.path.dirname(src), expanded)
-                )
                 try:
-                    include(expanded, inc, remap=remap, sections=sections)
+                    include(expanded, remap=remap, sections=sections)
                 except IOError as inst:
                     if inst.errno != errno.ENOENT:
                         raise error.ParseError(
                             _(b"cannot include %s (%s)")
-                            % (inc, encoding.strtolocal(inst.strerror)),
+                            % (expanded, encoding.strtolocal(inst.strerror)),
                             b"%s:%d" % (src, line),
                         )
                 continue
@@ -215,7 +212,7 @@ 
 
         dir = os.path.dirname(path)
 
-        def include(rel, abs, remap, sections):
+        def include(rel, remap, sections):
             abs = os.path.normpath(os.path.join(dir, rel))
             self.read(abs, remap=remap, sections=sections)