tests/svnurlof.py
author Martin von Zweigbergk <martinvonz@google.com>
Wed, 03 Apr 2019 17:41:58 -0700
changeset 42092 91cc8dc866ed
parent 41480 eb6700e6c5ea
child 43076 2372284d9457
permissions -rw-r--r--
remotefilelog: fix crash on `hg addremove` of added-but-deleted file If you `hg add` a file and then delete it from disk, and then run `hg addremove`, the file ends up in the "removed" set that gets passed to the findrenames() override. We then crash because the file is not in the working copy parent. This patch fixes that. Differential Revision: https://phab.mercurial-scm.org/D6194

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)