tests/readlink.py
author Pierre-Yves David <pierre-yves.david@octobus.net>
Mon, 15 May 2023 08:59:38 +0200
changeset 50483 60e613f6a229
parent 48875 6000f5b25c9b
permissions -rwxr-xr-x
store: add a `target_id` attribute on RevlogStoreEntry This hold the "target" (file, directory, etc) of a revlog. Having this available will help a lot of code to avoid direct file path access.

#!/usr/bin/env python3


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)