tests/readlink.py
author Matt Harbison <matt_harbison@yahoo.com>
Fri, 27 Dec 2019 13:42:52 -0500
changeset 43979 a2ad5aeedfdf
parent 29485 6a98f9408a50
child 45849 c102b704edb5
permissions -rwxr-xr-x
perf: fix the time measurement for pathcopies relative to p2 PyCharm flagged this as unused. But it seems more likely that it was intended to reset the time for the p2 path. Differential Revision: https://phab.mercurial-scm.org/D7742

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