Mercurial > hg
comparison tests/svnurlof.py @ 41480:eb6700e6c5ea
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
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 30 Jan 2019 18:49:17 -0500 |
parents | |
children | 2372284d9457 |
comparison
equal
deleted
inserted
replaced
41479:6bbb12cba5a8 | 41480:eb6700e6c5ea |
---|---|
1 from __future__ import absolute_import, print_function | |
2 import sys | |
3 | |
4 from mercurial import ( | |
5 pycompat, | |
6 util, | |
7 ) | |
8 | |
9 def main(argv): | |
10 enc = util.urlreq.quote(pycompat.sysbytes(argv[1])) | |
11 if pycompat.iswindows: | |
12 fmt = 'file:///%s' | |
13 else: | |
14 fmt = 'file://%s' | |
15 print(fmt % pycompat.sysstr(enc)) | |
16 | |
17 if __name__ == '__main__': | |
18 main(sys.argv) |