Show More
@@ -161,16 +161,13 b' class config(object):' | |||||
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 |
|
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 |
% ( |
|
170 | % (expanded, encoding.strtolocal(inst.strerror)), | |
174 | b"%s:%d" % (src, line), |
|
171 | b"%s:%d" % (src, line), | |
175 | ) |
|
172 | ) | |
176 | continue |
|
173 | continue | |
@@ -215,7 +212,7 b' class config(object):' | |||||
215 |
|
212 | |||
216 | dir = os.path.dirname(path) |
|
213 | dir = os.path.dirname(path) | |
217 |
|
214 | |||
218 |
def include(rel, |
|
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 |
@@ -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 |
|
39 | def read(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') | |
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)) |
@@ -825,7 +825,7 b' def _readmapfile(mapfile):' | |||||
825 | base = os.path.dirname(mapfile) |
|
825 | base = os.path.dirname(mapfile) | |
826 | conf = config.config() |
|
826 | conf = config.config() | |
827 |
|
827 | |||
828 |
def include(rel, |
|
828 | def include(rel, remap, sections): | |
829 | templatedirs = [base, templatedir()] |
|
829 | templatedirs = [base, templatedir()] | |
830 | for dir in templatedirs: |
|
830 | for dir in templatedirs: | |
831 | if dir is None: |
|
831 | if dir is None: |
General Comments 0
You need to be logged in to leave comments.
Login now