view tests/svnurlof.py @ 50236:53f196622699 stable

dirstate: abstract the reading of the data file in v2 in a method We will need more changes to avoid some race conditions during read, so we first isolate the simple logic before making it more complicated.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 01 Mar 2023 16:05:28 +0100
parents 6000f5b25c9b
children
line wrap: on
line source

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)