tests/readlink.py
author Boris Feld <boris.feld@octobus.net>
Fri, 23 Nov 2018 06:03:38 +0100
changeset 40817 e207f0d6c243
parent 29485 6a98f9408a50
child 45849 c102b704edb5
permissions -rwxr-xr-x
perf: update perfindex to be more realistic The previous code was creating a revlog manually, we now use the actual `localrepo` method to create it. We have to jump though extra hops to work around the impact of filecache.

#!/usr/bin/env python

from __future__ import absolute_import, print_function

import errno
import os
import sys

for f in sys.argv[1:]:
    try:
        print(f, '->', os.readlink(f))
    except OSError as err:
        if err.errno != errno.EINVAL:
            raise
        print(f, '->', f, 'not a symlink')

sys.exit(0)