tests/readlink.py
author Levi Bard <levi@unity3d.com>
Sat, 07 Jan 2012 19:11:31 +0100
changeset 15795 8bed8551d535
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
largefiles: add precommit hook to check for inappropriate locking This tests for inappropriate locking (issue3182) by running hg status as a precommit hook.

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