tests/readlink.py
author Patrick Mezard <pmezard@gmail.com>
Tue, 28 Sep 2010 00:41:07 +0200
branchstable
changeset 12575 9b3913baba0c
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
patch: upgrade to git patch when removing binary file Otherwise it may cause data loss when removing binary files in mq with --git=auto.

#!/usr/bin/env python

import errno, os, sys

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

sys.exit(0)