tests/readlink.py
author Pierre-Yves David <pierre-yves.david@octobus.net>
Mon, 06 Nov 2023 23:15:58 +0100
changeset 51121 5d740f920640
parent 48966 6000f5b25c9b
permissions -rwxr-xr-x
unstable: use the `_mutablerevs` function when computing content divergent This is a useful function to get the revision relevant to these computation, lets make sure all code use it, so that we can improve that `_mutablerevs` function in a later changeset.

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