tests/readlink.py
author Gregory Szorc <gregory.szorc@gmail.com>
Mon, 24 Sep 2018 12:42:03 -0700
changeset 39879 9596cf2a550d
parent 29485 6a98f9408a50
child 45849 c102b704edb5
permissions -rwxr-xr-x
filelog: stop proxying "opener" (API) The last consumer of it in upgrade code was removed as part of the previous commit. This attribute is revlog specific (because it assumes the existence of a vfs for performing I/O on tracked file data) and therefore isn't appropriate for a generic storage interface. So nuke it. Differential Revision: https://phab.mercurial-scm.org/D4749

#!/usr/bin/env python

from __future__ import absolute_import, print_function

import errno
import os
import sys

for f in sys.argv[1:]:
    try:
        print(f, '->', os.readlink(f))
    except OSError as err:
        if err.errno != errno.EINVAL:
            raise
        print(f, '->', f, 'not a symlink')

sys.exit(0)