Mercurial > hg-stable
changeset 45278:3f54242781e9
config: remove now-unused support for "includepaths"
This effectively undoes 081b08e4ea13 (templater: look for mapfiles in
template paths, 2015-05-15).
Differential Revision: https://phab.mercurial-scm.org/D8793
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 22 Jul 2020 00:13:02 -0700 |
parents | 0041a42c6f28 |
children | 0323972f78f3 |
files | mercurial/config.py |
diffstat | 1 files changed, 13 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/config.py Sat Jul 25 15:37:05 2020 +0200 +++ b/mercurial/config.py Wed Jul 22 00:13:02 2020 -0700 @@ -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