tests/readlink.py
author Yuya Nishihara <yuya@tcha.org>
Sun, 10 Dec 2017 18:22:06 +0900
changeset 35683 ea3320015d54
parent 29485 6a98f9408a50
child 45849 c102b704edb5
permissions -rwxr-xr-x
log: remove dead code to follow descendants if ascending revisions specified It's been disabled since 8b4b9ee6001a "log: make -fr show complete history from the given revs" 2015-02-06, and we've got no bug report regarding this exact behavior. For details what the heck "followdescendants" is, please see the issue comment: https://bz.mercurial-scm.org/show_bug.cgi?id=4959#c72 "'rev(%d)' % startrev" can be replaced with '.' since revs are 'reversed(:.)'.

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