Mercurial > hg > mercurial-source
changeset 36227:dad8a5071b0a
templatefilters: add slashpath() to convert path separator to slash
Prepares for deprecating the ui.slash option, which isn't always respected.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 21 Oct 2017 17:19:02 +0900 (2017-10-21) |
parents | a8478b808f17 |
children | b86f52426396 |
files | mercurial/templatefilters.py tests/test-locate.t |
diffstat | 2 files changed, 14 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/templatefilters.py +++ b/mercurial/templatefilters.py @@ -349,6 +349,11 @@ """Date. Returns a date like "2006-09-18".""" return util.shortdate(text) +@templatefilter('slashpath') +def slashpath(path): + """Any text. Replaces the native path separator with slash.""" + return util.pconvert(path) + @templatefilter('splitlines') def splitlines(text): """Any text. Split text into a list of lines."""