comparison mercurial/config.py @ 45257:668af67bfd18

config: remove now-unused `abs` argument from `include` callback Differential Revision: https://phab.mercurial-scm.org/D8796
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 22 Jul 2020 10:34:24 -0700
parents 83ca8d6f3206
children 0883413e09bc
comparison
equal deleted inserted replaced
45256:83ca8d6f3206 45257:668af67bfd18
159 cont = False 159 cont = False
160 m = includere.match(l) 160 m = includere.match(l)
161 161
162 if m and include: 162 if m and include:
163 expanded = util.expandpath(m.group(1)) 163 expanded = util.expandpath(m.group(1))
164 inc = os.path.normpath(
165 os.path.join(os.path.dirname(src), expanded)
166 )
167 try: 164 try:
168 include(expanded, inc, remap=remap, sections=sections) 165 include(expanded, remap=remap, sections=sections)
169 except IOError as inst: 166 except IOError as inst:
170 if inst.errno != errno.ENOENT: 167 if inst.errno != errno.ENOENT:
171 raise error.ParseError( 168 raise error.ParseError(
172 _(b"cannot include %s (%s)") 169 _(b"cannot include %s (%s)")
173 % (inc, encoding.strtolocal(inst.strerror)), 170 % (expanded, encoding.strtolocal(inst.strerror)),
174 b"%s:%d" % (src, line), 171 b"%s:%d" % (src, line),
175 ) 172 )
176 continue 173 continue
177 if emptyre.match(l): 174 if emptyre.match(l):
178 continue 175 continue
213 % (fp, fp.mode,) 210 % (fp, fp.mode,)
214 ) 211 )
215 212
216 dir = os.path.dirname(path) 213 dir = os.path.dirname(path)
217 214
218 def include(rel, abs, remap, sections): 215 def include(rel, remap, sections):
219 abs = os.path.normpath(os.path.join(dir, rel)) 216 abs = os.path.normpath(os.path.join(dir, rel))
220 self.read(abs, remap=remap, sections=sections) 217 self.read(abs, remap=remap, sections=sections)
221 218
222 self.parse( 219 self.parse(
223 path, fp.read(), sections=sections, remap=remap, include=include 220 path, fp.read(), sections=sections, remap=remap, include=include