Show More
@@ -7,7 +7,7 b'' | |||
|
7 | 7 | |
|
8 | 8 | from i18n import _ |
|
9 | 9 | import re, sys, os |
|
10 | from mercurial import util | |
|
10 | from mercurial import util, config | |
|
11 | 11 | |
|
12 | 12 | path = ['templates', '../templates'] |
|
13 | 13 | |
@@ -63,24 +63,18 b' class templater(object):' | |||
|
63 | 63 | if not os.path.exists(mapfile): |
|
64 | 64 | raise util.Abort(_('style not found: %s') % mapfile) |
|
65 | 65 | |
|
66 | i = 0 | |
|
67 |
|
|
|
68 | l = l.strip() | |
|
69 | i += 1 | |
|
70 | if not l or l[0] in '#;': continue | |
|
71 | m = re.match(r'([a-zA-Z_][a-zA-Z0-9_]*)\s*=\s*(.+)$', l) | |
|
72 | if m: | |
|
73 | key, val = m.groups() | |
|
66 | conf = config.config() | |
|
67 | conf.read(mapfile) | |
|
68 | ||
|
69 | for key, val in conf[''].items(): | |
|
74 | 70 |
|
|
75 | 71 |
|
|
76 | 72 |
|
|
77 | 73 |
|
|
78 |
|
|
|
79 |
|
|
|
74 | raise SyntaxError('%s: %s' % | |
|
75 | (conf.getsource('', key), inst.args[0])) | |
|
80 | 76 |
|
|
81 | 77 |
|
|
82 | else: | |
|
83 | raise SyntaxError(_("%s:%s: parse error") % (mapfile, i)) | |
|
84 | 78 | |
|
85 | 79 | def __contains__(self, key): |
|
86 | 80 | return key in self.cache or key in self.map |
General Comments 0
You need to be logged in to leave comments.
Login now