tests/readlink.py
author Anton Shestakov <engored@ya.ru>
Mon, 09 Mar 2015 14:32:17 +0800
changeset 24232 f9e8739018d5
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
histedit: use better meta-variable names than VALUE in help text Before this change hg help histedit would use the default variable label: --commands VALUE ... -r --rev VALUE [+] With this change the text will be in the usual help text style and a bit more explanatory: --commands FILE ... -r --rev REV [+]

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