tests/readlink.py
author Eric Sumner <ericsumner@fb.com>
Wed, 14 Jan 2015 16:14:19 -0800
changeset 24037 f0b498cfc5c8
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
bundle2.unbundlepart: implement seek() This implements a seek() method for unbundlepart. This allows on-disk bundle2 parts to behave enough like files for bundlerepo to handle them. A future patch will add support for bundlerepo to read the bundle2 files that are written when the experimental.strip-bundle2-version config option is used.

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