tests/svnurlof.py
author Raphaël Gomès <rgomes@octobus.net>
Thu, 06 Jul 2023 11:17:55 +0200
changeset 50805 58aa5ee9c846
parent 48966 6000f5b25c9b
permissions -rw-r--r--
rust-blackbox: use `is_extension_enabled` config helper It's there, may as well use it to make the code clearer and less bug-prone.

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)