json output using mercurial templates
Haszlakiewicz, Eric
EHASZLA at transunion.com
Tue Nov 23 17:02:08 UTC 2010
>-----Original Message-----
>From: djc.ochtman at gmail.com [mailto:djc.ochtman at gmail.com] On Behalf Of
>Dirkjan Ochtman
>
>On Fri, Nov 19, 2010 at 23:04, Haszlakiewicz, Eric
><EHASZLA at transunion.com> wrote:
>> Has anyone thought about trying to create templates that create output
>like this?
>
>Yes, I've tried it a couple of times. Unfortunately, some things about
>the JSON format are relatively hard to get right with our current
>templater. Notably, the requirement that the last element of a JSON
>list or object is not followed by a comma.
For this you can use "last_<foo>", at least for some things. Unfortunately, not all of the various properties are handled consistently, which is the real problem with the templater.
e.g. you can't use "start_extra" and "end_extra" with the "extras" values.
How far were you able to get with this? Do you have a partially working template map file that you can share?
eric
More information about the Mercurial
mailing list