##// END OF EJS Templates
tests: make and use a new `svnurlof.py` helper for constructing svn urls...
tests: make and use a new `svnurlof.py` helper for constructing svn urls The previous trick of a Python oneliner and some subshells is too hard to make portable, and this lets us consolidate some Windows-specific logic down to a single place. Differential Revision: https://phab.mercurial-scm.org/D5766

File last commit:

r41526:d6b76d62 default
r41621:eb6700e6 default
Show More
svnurlof.py
18 lines | 365 B | text/x-python | PythonLexer
from __future__ import absolute_import, print_function
import sys
from mercurial import (
pycompat,
util,
)
def main(argv):
enc = util.urlreq.quote(pycompat.sysbytes(argv[1]))
if pycompat.iswindows:
fmt = 'file:///%s'
else:
fmt = 'file://%s'
print(fmt % pycompat.sysstr(enc))
if __name__ == '__main__':
main(sys.argv)