Show More
@@ -113,6 +113,13 b' def extdata(context, mapping, args):' | |||
|
113 | 113 | raise error.ParseError(_('extdata expects one argument')) |
|
114 | 114 | |
|
115 | 115 | source = evalstring(context, mapping, args['source']) |
|
116 | if not source: | |
|
117 | sym = templateutil.findsymbolicname(args['source']) | |
|
118 | if sym: | |
|
119 | raise error.ParseError(_('empty data source specified'), | |
|
120 | hint=_("did you mean extdata('%s')?") % sym) | |
|
121 | else: | |
|
122 | raise error.ParseError(_('empty data source specified')) | |
|
116 | 123 | cache = context.resource(mapping, 'cache').setdefault('extdata', {}) |
|
117 | 124 | ctx = context.resource(mapping, 'ctx') |
|
118 | 125 | if source in cache: |
@@ -82,6 +82,13 b' test bad extdata() template source' | |||
|
82 | 82 | $ hg log -T "{extdata('unknown')}\n" |
|
83 | 83 | abort: unknown extdata source 'unknown' |
|
84 | 84 | [255] |
|
85 | $ hg log -T "{extdata(unknown)}\n" | |
|
86 | hg: parse error: empty data source specified | |
|
87 | (did you mean extdata('unknown')?) | |
|
88 | [255] | |
|
89 | $ hg log -T "{extdata('{unknown}')}\n" | |
|
90 | hg: parse error: empty data source specified | |
|
91 | [255] | |
|
85 | 92 | |
|
86 | 93 | we don't fix up relative file URLs, but we do run shell commands in repo root |
|
87 | 94 |
General Comments 0
You need to be logged in to leave comments.
Login now