[PATCH 2 of 2] hgweb: Use "nonempty" filter in templates for the changelog message (v2)

Martin Geisler mg at lazybytes.net
Sat Apr 25 15:08:58 CDT 2009


Rocco Rutte <pdmef at gmx.net> writes:

> Hi,
>
> * Rocco Rutte wrote:
>
>> So no, not that I know except I can try whether a static var that the
>> templater expands to '(none)' does work.
>
> Yes, a change like this does the trick (while the templater doesn't
> complain about undefined items).
>
> diff --git a/templates/paper/graph.tmpl b/templates/paper/graph.tmpl
> --- a/templates/paper/graph.tmpl
> +++ b/templates/paper/graph.tmpl
> @@ -56,6 +56,7 @@ files, or words in the commit message</d
>  
>  var data = {jsdata|json};
>  var graph = new Graph();
> +var empty = '{nonexistent|nonempty}';

Hehe, this is slightly evil :-) But I guess it's better than putting
'(none)' directly into the template. Could you put a comment in the
JavaScript so that the next guy who looks at it has a chance of
understanding why we use a non-existing variable.

And about the translation, then you're right -- we have no real support
for translating the templates yet. We'll have to eventually fix this,
but not for this patch, I think.

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial-devel/attachments/20090425/ecbec399/attachment.pgp 


More information about the Mercurial-devel mailing list