tests/readlink.py
author Joerg Sonnenberger <joerg@bec.de>
Wed, 08 Jul 2020 00:36:36 +0200
changeset 45131 61e7464477ac
parent 29485 6a98f9408a50
child 45830 c102b704edb5
permissions -rwxr-xr-x
phases: sparsify phaseroots and phasesets As final step of dealing with the holes in the phase numbers, make phaseroots and phasesets both dictionaries indexed by the phase number. Further adjust the interface of the C module by pushing the node to revision mapping down as it is cheaper on the C side to deal with revision numbers. Overall, the patch series improves a no-change "hg up" for my NetBSD test repository from 4.7s to 1.3s. Differential Revision: https://phab.mercurial-scm.org/D8698

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