##// END OF EJS Templates
templater: add hex filter.
Dan Villiom Podlaski Christiansen -
r12371:48a4acd1 default
parent child Browse files
Show More
@@ -106,6 +106,9 b' List of filters:'
106 106 :escape: Any text. Replaces the special XML/XHTML characters "&", "<"
107 107 and ">" with XML entities.
108 108
109 :hex: Any text. Convert a binary Mercurial node identifier into
110 its long hexadecimal representation.
111
109 112 :fill68: Any text. Wraps the text to fit in 68 columns.
110 113
111 114 :fill76: Any text. Wraps the text to fit in 76 columns.
@@ -6,7 +6,7 b''
6 6 # GNU General Public License version 2 or any later version.
7 7
8 8 import cgi, re, os, time, urllib
9 import util, encoding
9 import encoding, node, util
10 10
11 11 def stringify(thing):
12 12 '''turn nested template iterator into string.'''
@@ -216,6 +216,7 b' filters = {'
216 216 "person": person,
217 217 "rfc822date": lambda x: util.datestr(x, "%a, %d %b %Y %H:%M:%S %1%2"),
218 218 "rfc3339date": lambda x: util.datestr(x, "%Y-%m-%dT%H:%M:%S%1:%2"),
219 "hex": node.hex,
219 220 "short": lambda x: x[:12],
220 221 "shortdate": util.shortdate,
221 222 "stringify": stringify,
General Comments 0
You need to be logged in to leave comments. Login now