comparison mercurial/config.py @ 45254: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 f7f142d74df3
children 83ca8d6f3206
comparison
equal deleted inserted replaced
45251:0041a42c6f28 45254:3f54242781e9
19 util, 19 util,
20 ) 20 )
21 21
22 22
23 class config(object): 23 class config(object):
24 def __init__(self, data=None, includepaths=None): 24 def __init__(self, data=None):
25 self._data = {} 25 self._data = {}
26 self._unset = [] 26 self._unset = []
27 self._includepaths = includepaths or []
28 if data: 27 if data:
29 for k in data._data: 28 for k in data._data:
30 self._data[k] = data[k].copy() 29 self._data[k] = data[k].copy()
31 self._source = data._source.copy() 30 self._source = data._source.copy()
32 else: 31 else:
160 cont = False 159 cont = False
161 m = includere.match(l) 160 m = includere.match(l)
162 161
163 if m and include: 162 if m and include:
164 expanded = util.expandpath(m.group(1)) 163 expanded = util.expandpath(m.group(1))
165 includepaths = [os.path.dirname(src)] + self._includepaths 164 inc = os.path.normpath(
166 165 os.path.join(os.path.dirname(src), expanded)
167 for base in includepaths: 166 )
168 inc = os.path.normpath(os.path.join(base, expanded)) 167 try:
169 168 include(expanded, inc, remap=remap, sections=sections)
170 try: 169 except IOError as inst:
171 include(expanded, inc, remap=remap, sections=sections) 170 if inst.errno != errno.ENOENT:
172 break 171 raise error.ParseError(
173 except IOError as inst: 172 _(b"cannot include %s (%s)")
174 if inst.errno != errno.ENOENT: 173 % (inc, encoding.strtolocal(inst.strerror)),
175 raise error.ParseError( 174 b"%s:%d" % (src, line),
176 _(b"cannot include %s (%s)") 175 )
177 % (inc, encoding.strtolocal(inst.strerror)),
178 b"%s:%d" % (src, line),
179 )
180 continue 176 continue
181 if emptyre.match(l): 177 if emptyre.match(l):
182 continue 178 continue
183 m = sectionre.match(l) 179 m = sectionre.match(l)
184 if m: 180 if m: