Skip to content
Snippets Groups Projects
Commit dad8a507 authored by Yuya Nishihara's avatar Yuya Nishihara
Browse files

templatefilters: add slashpath() to convert path separator to slash

Prepares for deprecating the ui.slash option, which isn't always respected.
parent a8478b80
No related branches found
No related tags found
No related merge requests found
......@@ -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."""
......
......@@ -151,4 +151,13 @@
$ hg files .
[1]
Convert native path separator to slash (issue5572)
$ hg files -T '{path|slashpath}\n'
../b
../dir.h/foo
../t.h
../t/e.h
../t/x
$ cd ../..
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment