mercurial/templatefilters.py
changeset 36563 9d71bd25554b
parent 36552 a185b1af207c
child 36573 9b6b02a5b589
equal deleted inserted replaced
36562:247e9bf4ecdc 36563:9d71bd25554b
   271 @templatefilter('obfuscate')
   271 @templatefilter('obfuscate')
   272 def obfuscate(text):
   272 def obfuscate(text):
   273     """Any text. Returns the input text rendered as a sequence of
   273     """Any text. Returns the input text rendered as a sequence of
   274     XML entities.
   274     XML entities.
   275     """
   275     """
   276     text = unicode(text, encoding.encoding, 'replace')
   276     text = unicode(text, pycompat.sysstr(encoding.encoding), r'replace')
   277     return ''.join(['&#%d;' % ord(c) for c in text])
   277     return ''.join(['&#%d;' % ord(c) for c in text])
   278 
   278 
   279 @templatefilter('permissions')
   279 @templatefilter('permissions')
   280 def permissions(flags):
   280 def permissions(flags):
   281     if "l" in flags:
   281     if "l" in flags: