diff tests/test-command-template @ 6174:434139080ed4

Permit XML entities to be escaped in template output. Useful for creating XML documents directly from Hg logging. Can also be used for HTML. For use in content, will escape '&', '<', and for completeness '>' (although it is not strictly necessary). For use in attributes, will also escape ' and ". Will also replace nonprinting (ASCII) control characters with spaces, since these are illegal in XML.
author Jesse Glick <jesse.glick@sun.com>
date Mon, 28 Jan 2008 22:19:12 -0500
parents db6633f11d59
children 9a9b02bcbcf4
line wrap: on
line diff
--- a/tests/test-command-template	Sun Feb 24 17:58:55 2008 +0100
+++ b/tests/test-command-template	Mon Jan 28 22:19:12 2008 -0500
@@ -106,6 +106,7 @@
 hg log --template '{date|rfc822date}\n'
 hg log --template '{desc|firstline}\n'
 hg log --template '{node|short}\n'
+hg log --template '<changeset author="{author|xmlescape}"/>\n'
 
 echo '# formatnode filter works'
 echo '#  quiet'