tests/svnurlof.py
author Yuya Nishihara <yuya@tcha.org>
Tue, 05 Nov 2019 21:29:40 +0900
branchstable
changeset 43417 822202e72f69
parent 43076 2372284d9457
child 48875 6000f5b25c9b
permissions -rw-r--r--
py3: do not reimplement Abort.__str__() on Python 2 It isn't necessary on Python 2, and the default implementation should be better than our BaseException_str() clone.

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)