view tests/svnurlof.py @ 44687:bca57ad9e630

histedit: add test that an invalid editor doesn't bork client state We had a report of a situation like this borking a user at Google, but I can't reproduce it in a test. Let's at least backstop the issue with a test, so we don't accidentally introduce such a bug... Differential Revision: https://phab.mercurial-scm.org/D8391
author Augie Fackler <augie@google.com>
date Thu, 09 Apr 2020 15:44:21 -0400
parents 2372284d9457
children 6000f5b25c9b
line wrap: on
line source

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)