<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-size:12.8px">It seems you missed the point of fm.condwrite(). It does</span><br style="font-size:12.8px"><span style="font-size:12.8px"> - print if condition met in plain output<br></span><span style="font-size:12.8px"> - assign variable to JSON or templated formatter unconditionally, which<br></span><span style="font-size:12.8px">   allows us to use that variable in template if we want</span></blockquote><div><br></div><div>You were right, i totally missed the point :P I <span style="font-size:12.8px">suppressed it in machine-readable and templated output using fm.plain() as You suggested in Patch V3.</span></div><div><span style="font-size:12.8px"><br></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-size:12.8px">No whitespace, no uppercase letter, and perhaps no underscore. They should<br></span><span style="font-size:12.8px">look like template keywords.</span></blockquote><div><br></div><div>Changed as requested in Patch V3</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-size:12.8px">I think the simplest way is to print the original space-separated testedwith<br></span><span style="font-size:12.8px">string. If you don't like it, you can use fm.plain() and fm.data().</span></blockquote><div><br></div><div>In V3 it prints space separated testedwith versions as string </div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-09-23 5:40 GMT+02:00 Yuya Nishihara <span dir="ltr"><<a href="mailto:yuya@tcha.org" target="_blank">yuya@tcha.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, 22 Sep 2015 21:37:20 +0200, Piotr Listkiewicz wrote:<br>
> > This 'tested with' field will be overwritten by the subsequent condwrite().<br>
> > We could<br>
> >  a) suppress it in machine-readable and templated output: use fm.plain()<br>
> >  b) or give different field name<br>
><br>
>  It won't, for verbose it will only be written by fm.condwrite , for<br>
> normal(not verbose and not quiet) it will only be written in if stm and for<br>
> quiet it will not be written.<br>
<br>
</span>It seems you missed the point of fm.condwrite(). It does<br>
<br>
 - print if condition met in plain output<br>
 - assign variable to JSON or templated formatter unconditionally, which<br>
   allows us to use that variable in template if we want<br>
<br>
For details, see formatter.py, e8075329c5fb, the wiki page, etc.<br>
<br>
<a href="https://mercurial.selenic.com/wiki/GenericTemplatingPlan" rel="noreferrer" target="_blank">https://mercurial.selenic.com/wiki/GenericTemplatingPlan</a><br>
<span class=""><br>
> It should be something like this:<br>
> >   fm.condwrite(ui.verbose and extbuglink, 'buglink',<br>
> >                _('  bug reporting: %s\n'), extbuglink)<br>
> > because<br>
> >  - we probably don't want to see raw representation like "None" in plain<br>
> > output<br>
> >  - plain output should be translated, so wrap it by _()<br>
> >  - field names are space-separated list, and they are used as template<br>
> > keywords,<br>
> >    e.g. -T '{name} ({testedwith})\n  <{buglink}>\n'<br>
><br>
> So field names should not have space inside?<br>
<br>
</span>No whitespace, no uppercase letter, and perhaps no underscore. They should<br>
look like template keywords.<br>
<span class=""><br>
> > Can we avoid raw list representation "['...']" ?<br>
><br>
> How it should look like instead? I added in formatter._jsonifyobj case for<br>
> showing the list same way at it shows tuple in this patch and from there it<br>
> is not problem for changing how the list is shown. What would you suggest<br>
> to do?<br>
<br>
</span>I think the simplest way is to print the original space-separated testedwith<br>
string. If you don't like it, you can use fm.plain() and fm.data().<br>
<br>
FWIW, I didn't add isinstance(v, list) to _jsonifyobj at 17eeda31e52b because<br>
a list is mutable, but that isn't important.<br>
<br>
Regards,<br>
</blockquote></div><br></div>