tests/readlink.py
author Anton Shestakov <av6@dwimlabs.net>
Thu, 12 May 2022 13:52:10 +0400
branchstable
changeset 49314 ec3f88480dbf
parent 45830 c102b704edb5
child 48875 6000f5b25c9b
permissions -rwxr-xr-x
tests: show that hg log --debug output differs from {file*} template keywords hg log --debug -T xml doesn't differ, but let's test it because we can.

#!/usr/bin/env python3

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)