mirror of
https://github.com/facebook/sapling.git
synced 2025-01-08 14:46:47 +03:00
templatefilters: add slashpath() to convert path separator to slash
Prepares for deprecating the ui.slash option, which isn't always respected.
This commit is contained in:
parent
3a0cd26f9a
commit
e9a3f998f1
@ -349,6 +349,11 @@ def shortdate(text):
|
||||
"""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 @@ Issue294: hg remove --after dir fails when dir.* also exists
|
||||
$ 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 ../..
|
||||
|
Loading…
Reference in New Issue
Block a user