tests/svnurlof.py
author Matt Harbison <matt_harbison@yahoo.com>
Wed, 04 May 2022 16:01:55 -0400
changeset 49173 90f7d8276e26
parent 48875 6000f5b25c9b
permissions -rw-r--r--
contrib: migrate off of a couple of bitbucket URLs I noticed this when diffing the thg installer against Mercurial to see what was missing. There are a handful of other URLs in i18n and extension example help text if anyone cares to update those. Differential Revision: https://phab.mercurial-scm.org/D12606

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)