Details
Details
- Reviewers
pulkit - Group Reviewers
hg-reviewers - Commits
- rHG9d71bd25554b: templatefilters: convert arguments to sysstrs for unicode() ctor
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
pulkit |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/templatefilters.py (2 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Abandoned | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Abandoned | durin42 |
"""Any text. Returns '(none)' if the string is empty.""" | """Any text. Returns '(none)' if the string is empty.""" | ||||
return text or "(none)" | return text or "(none)" | ||||
@templatefilter('obfuscate') | @templatefilter('obfuscate') | ||||
def obfuscate(text): | def obfuscate(text): | ||||
"""Any text. Returns the input text rendered as a sequence of | """Any text. Returns the input text rendered as a sequence of | ||||
XML entities. | XML entities. | ||||
""" | """ | ||||
text = unicode(text, encoding.encoding, 'replace') | text = unicode(text, pycompat.sysstr(encoding.encoding), r'replace') | ||||
return ''.join(['&#%d;' % ord(c) for c in text]) | return ''.join(['&#%d;' % ord(c) for c in text]) | ||||
@templatefilter('permissions') | @templatefilter('permissions') | ||||
def permissions(flags): | def permissions(flags): | ||||
if "l" in flags: | if "l" in flags: | ||||
return "lrwxrwxrwx" | return "lrwxrwxrwx" | ||||
if "x" in flags: | if "x" in flags: | ||||
return "-rwxr-xr-x" | return "-rwxr-xr-x" |