diff mercurial/templatefilters.py @ 12371:48a4acd1ccf1

templater: add hex filter.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Wed, 22 Sep 2010 00:14:57 +0200
parents 0bedf3a2062a
children 57150dc5a9c7
line wrap: on
line diff
--- a/mercurial/templatefilters.py	Tue Sep 21 18:40:33 2010 +0200
+++ b/mercurial/templatefilters.py	Wed Sep 22 00:14:57 2010 +0200
@@ -6,7 +6,7 @@
 # GNU General Public License version 2 or any later version.
 
 import cgi, re, os, time, urllib
-import util, encoding
+import encoding, node, util
 
 def stringify(thing):
     '''turn nested template iterator into string.'''
@@ -216,6 +216,7 @@
     "person": person,
     "rfc822date": lambda x: util.datestr(x, "%a, %d %b %Y %H:%M:%S %1%2"),
     "rfc3339date": lambda x: util.datestr(x, "%Y-%m-%dT%H:%M:%S%1:%2"),
+    "hex": node.hex,
     "short": lambda x: x[:12],
     "shortdate": util.shortdate,
     "stringify": stringify,