tests/readlink.py
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Tue, 27 Dec 2011 20:45:46 +0100
changeset 15736 306e84e8bbe9
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
rebase: allow --detach when --rev is used --rev is only a more specific --source and there is no reason to refuse to use detach with it.

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