tests/readlink.py
author Pierre-Yves David <pierre-yves.david@logilab.fr>
Mon, 24 Dec 2012 02:22:04 +0100
changeset 18130 1b05ffce47bd
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
branchmap: make update responsible to update the cache key The update function have all necessary data to keep the branchcache key up to date with its value. This saves assignment to the cache key that each caller of update had to do by hand. The strip case is a bit more complicated to handles from inside the function but I do not expect any impact.

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