##// END OF EJS Templates
config: pass both relative and absolute paths to `include` callback...
Martin von Zweigbergk -
r45768:f7f142d7 default
parent child Browse files
Show More
@@ -168,7 +168,7 b' class config(object):'
168 inc = os.path.normpath(os.path.join(base, expanded))
168 inc = os.path.normpath(os.path.join(base, expanded))
169
169
170 try:
170 try:
171 include(inc, remap=remap, sections=sections)
171 include(expanded, inc, remap=remap, sections=sections)
172 break
172 break
173 except IOError as inst:
173 except IOError as inst:
174 if inst.errno != errno.ENOENT:
174 if inst.errno != errno.ENOENT:
@@ -216,8 +216,12 b' class config(object):'
216 b'config files must be opened in binary mode, got fp=%r mode=%r'
216 b'config files must be opened in binary mode, got fp=%r mode=%r'
217 % (fp, fp.mode,)
217 % (fp, fp.mode,)
218 )
218 )
219
220 def include(rel, abs, remap, sections):
221 self.read(abs, remap=remap, sections=sections)
222
219 self.parse(
223 self.parse(
220 path, fp.read(), sections=sections, remap=remap, include=self.read
224 path, fp.read(), sections=sections, remap=remap, include=include
221 )
225 )
222
226
223
227
@@ -36,7 +36,7 b' def state(ctx, ui):'
36 p = config.config()
36 p = config.config()
37 repo = ctx.repo()
37 repo = ctx.repo()
38
38
39 def read(f, sections=None, remap=None):
39 def read(rel, f, sections=None, remap=None):
40 if f in ctx:
40 if f in ctx:
41 try:
41 try:
42 data = ctx[f].data()
42 data = ctx[f].data()
@@ -56,7 +56,7 b' def state(ctx, ui):'
56 )
56 )
57
57
58 if b'.hgsub' in ctx:
58 if b'.hgsub' in ctx:
59 read(b'.hgsub')
59 read(b'.hgsub', b'.hgsub')
60
60
61 for path, src in ui.configitems(b'subpaths'):
61 for path, src in ui.configitems(b'subpaths'):
62 p.set(b'subpaths', path, src, ui.configsource(b'subpaths', path))
62 p.set(b'subpaths', path, src, ui.configsource(b'subpaths', path))
General Comments 0
You need to be logged in to leave comments. Login now