mercurial/templatefilters.py
changeset 48934 06de08b36c82
parent 48932 176f1a0d15dc
child 49020 1138674ecdb8
equal deleted inserted replaced
48933:78f1de3f4be7 48934:06de08b36c82
   370 @templatefilter(b'obfuscate', intype=bytes)
   370 @templatefilter(b'obfuscate', intype=bytes)
   371 def obfuscate(text):
   371 def obfuscate(text):
   372     """Any text. Returns the input text rendered as a sequence of
   372     """Any text. Returns the input text rendered as a sequence of
   373     XML entities.
   373     XML entities.
   374     """
   374     """
   375     text = pycompat.unicode(
   375     text = str(text, pycompat.sysstr(encoding.encoding), r'replace')
   376         text, pycompat.sysstr(encoding.encoding), r'replace'
       
   377     )
       
   378     return b''.join([b'&#%d;' % ord(c) for c in text])
   376     return b''.join([b'&#%d;' % ord(c) for c in text])
   379 
   377 
   380 
   378 
   381 @templatefilter(b'permissions', intype=bytes)
   379 @templatefilter(b'permissions', intype=bytes)
   382 def permissions(flags):
   380 def permissions(flags):