Mercurial > public > mercurial-scm > hg-stable
diff mercurial/hgweb/webcommands.py @ 8236:9f53e203a09b
webcommands: move nonempty logic from JavaScript to Python
This avoids hard-coding the '(none)' string in the JavaScript for each
style and avoids the {nonexisting|nonempty} hack which only works
since the template system don't complain about undefined variables.
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Tue, 28 Apr 2009 17:28:00 +0200 |
parents | 46293a0c7e9f |
children | eefcb59d44d6 |
line wrap: on
line diff
--- a/mercurial/hgweb/webcommands.py Mon Apr 20 12:10:04 2009 +0200 +++ b/mercurial/hgweb/webcommands.py Tue Apr 28 17:28:00 2009 +0200 @@ -646,7 +646,7 @@ node = short(ctx.node()) age = templatefilters.age(ctx.date()) desc = templatefilters.firstline(ctx.description()) - desc = cgi.escape(desc) + desc = cgi.escape(templatefilters.nonempty(desc)) user = cgi.escape(templatefilters.person(ctx.user())) branch = ctx.branch() branch = branch, web.repo.branchtags().get(branch) == ctx.node()