tests/readlink.py
author Gregory Szorc <gregory.szorc@gmail.com>
Sat, 02 Nov 2019 13:30:23 -0700
branchstable
changeset 43391 ffdf0bf28212
parent 29485 6a98f9408a50
child 45849 c102b704edb5
permissions -rwxr-xr-x
fsmonitor: access repo.root There is no repo._root. It looks like fsmonitor has been busted since this access was introduced in ab1900323b1 in July 2019! Differential Revision: https://phab.mercurial-scm.org/D7207

#!/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)