comparison mercurial/templatefilters.py @ 43094:e8cf9ad52a78

formatting: run black on all file again Apparently, since the blackgnarok, we divergence from the expected formatting. Formatted using:: grey.py -S $(hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**" - hgext/fsmonitor/pywatchman/** - contrib/grey.py') # skip-blame mass-reformatting only # no-check-commit reformats foo_bar functions
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 07 Oct 2019 10:58:51 -0400
parents bbcbb82e3589
children d783f945a701
comparison
equal deleted inserted replaced
43093:9002f4a3dde6 43094:e8cf9ad52a78
365 @templatefilter(b'obfuscate', intype=bytes) 365 @templatefilter(b'obfuscate', intype=bytes)
366 def obfuscate(text): 366 def obfuscate(text):
367 """Any text. Returns the input text rendered as a sequence of 367 """Any text. Returns the input text rendered as a sequence of
368 XML entities. 368 XML entities.
369 """ 369 """
370 text = pycompat.unicode(text, pycompat.sysstr(encoding.encoding), r'replace') 370 text = pycompat.unicode(
371 text, pycompat.sysstr(encoding.encoding), r'replace'
372 )
371 return b''.join([b'&#%d;' % ord(c) for c in text]) 373 return b''.join([b'&#%d;' % ord(c) for c in text])
372 374
373 375
374 @templatefilter(b'permissions', intype=bytes) 376 @templatefilter(b'permissions', intype=bytes)
375 def permissions(flags): 377 def permissions(flags):