tests/readlink.py
author Pierre-Yves David <pierre-yves.david@logilab.fr>
Fri, 21 Sep 2012 19:24:31 +0200
changeset 17644 9ae073f10572
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
histedit: fold in memory Update the folding code to works in memory instead of applying patches on the working directory. This is cleaner, faster and prepare the removal of the whole patching logic. This new collapse function will probably move into core sooner or later. A lot of other rewriting operation may benefit from it.

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