tests/svnurlof.py
author Raphaël Gomès <rgomes@octobus.net>
Fri, 17 May 2019 09:36:29 -0400
changeset 42350 94f3a73b6672
parent 41494 eb6700e6c5ea
child 43076 2372284d9457
permissions -rw-r--r--
rust-filepatterns: add `rust-cpython` bindings for `filepatterns` This change adds the `rust-cpython` interface for top-level functions and exceptions in the filepatterns module. Contrary to the Python implementation, this tries to have finer-grained exceptions to allow for better readability and flow control down the line. Differential Revision: https://phab.mercurial-scm.org/D6272

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)