tests/readlink.py
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Sun, 20 Dec 2020 15:47:02 +0100
changeset 46182 dc4564ee57dc
parent 45849 c102b704edb5
child 48966 6000f5b25c9b
permissions -rwxr-xr-x
tags: describe all abnormal tag types in `hg tags -v` In particular, this affects `git` and `git-remote` tags when using hg-git. Test Plan: I have not included an explicit test, as this is much more easily tested within the `hg-git` test suite. Differential Revision: https://phab.mercurial-scm.org/D9639

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