tests/readlink.py
author Pierre-Yves David <pierre-yves.david@logilab.fr>
Thu, 18 Oct 2012 22:12:15 +0200
changeset 17811 a8aba2921456
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
amend: add noise in extra to avoid creating obsolescence cycle (issue3664) Obsolescence cycle are bad and should be avoided as much as possible. The current amend implemented touch changeset meta data as few as possible. This make is easy for amend to result in the same node than a precursors. We add some deterministic noise in extra to avoid this. In practice, the hex of the amended changeset is stored in 'amend_source' extra key.

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