tests/readlink.py
author Robert Bachmann <rbachm@gmail.com>
Mon, 28 Dec 2009 16:48:57 +0100
changeset 10153 000546ec7ced
parent 5683 396c7010b0cd
child 10282 08a0f04b56bd
permissions -rwxr-xr-x
Added XML output for hg log The XML format is based on the one used by Subversion. Currently the closing "</log>" tag is not written, since cmdutil.py does not support the "footer" template variable.

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