tests/readlink.py
author Pierre-Yves David <pierre-yves.david@fb.com>
Tue, 07 Oct 2014 00:12:56 -0700
changeset 22803 31a591c3fecc
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
mq: use `revs.sort()` to ensure the set is ascending Sorting is super-cheap with the new smartset class, so we can use it to enforce the order. Otherwise all smartset classes would have to allow direct indexing.

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