tests/readlink.py
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Mon, 31 Dec 2012 17:44:18 -0600
changeset 18163 c5bd753c5bc6
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
amend: allow amend of non-head when obsolete is enabled Obsolescence marker can represent this situation just fine. The old version is marked as precursor of the new changeset. All its descendants become "unstable". If obsolescence is not enabled we keep the current behavior of aborting. This new behavior only applies when obsolete is enabled and is subject to future discussion and changes.

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