tests/svnurlof.py
author Yuya Nishihara <yuya@tcha.org>
Wed, 15 Apr 2020 23:11:55 +0900
changeset 44712 a825bfbf6642
parent 43076 2372284d9457
child 48875 6000f5b25c9b
permissions -rw-r--r--
templatekw: cache mergestate even if merge is not ongoing While playing with eBPF, I noticed .hg/merge/state{,2} files were tried to open() for each revision. That's not healthy. Let's cache the "inactive" state as well.

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)