Patchwork D8793: config: remove now-unused support for "includepaths"

login
register
mail settings
Submitter phabricator
Date July 22, 2020, 5:40 p.m.
Message ID <differential-rev-PHID-DREV-rafsgvt7krt6qj7k7w7g-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46837/
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 effectively undoes 081b08e4ea13 <https://phab.mercurial-scm.org/rHG081b08e4ea1350f5c501b0ae0915547b8acc5503> (templater: look for mapfiles in
  template paths, 2015-05-15).

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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
@@ -21,10 +21,9 @@ 
 
 
 class config(object):
-    def __init__(self, data=None, includepaths=None):
+    def __init__(self, data=None):
         self._data = {}
         self._unset = []
-        self._includepaths = includepaths or []
         if data:
             for k in data._data:
                 self._data[k] = data[k].copy()
@@ -162,21 +161,18 @@ 
 
             if m and include:
                 expanded = util.expandpath(m.group(1))
-                includepaths = [os.path.dirname(src)] + self._includepaths
-
-                for base in includepaths:
-                    inc = os.path.normpath(os.path.join(base, expanded))
-
-                    try:
-                        include(expanded, inc, remap=remap, sections=sections)
-                        break
-                    except IOError as inst:
-                        if inst.errno != errno.ENOENT:
-                            raise error.ParseError(
-                                _(b"cannot include %s (%s)")
-                                % (inc, encoding.strtolocal(inst.strerror)),
-                                b"%s:%d" % (src, line),
-                            )
+                inc = os.path.normpath(
+                    os.path.join(os.path.dirname(src), expanded)
+                )
+                try:
+                    include(expanded, inc, 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)),
+                            b"%s:%d" % (src, line),
+                        )
                 continue
             if emptyre.match(l):
                 continue