tests/svnurlof.py
author Arseniy Alekseyev <aalekseyev@janestreet.com>
Fri, 09 Jun 2023 14:32:09 +0100
branchstable
changeset 50691 ba602ddcb296
parent 48875 6000f5b25c9b
permissions -rw-r--r--
ui: fix crash in `hg paths` when pulled-delta-reuse-policy is in use The crash is a result of [value] being an int, but being used as a bytestring.

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)