tests/readlink.py
author Boris Feld <boris.feld@octobus.net>
Fri, 09 Nov 2018 18:45:23 +0100
changeset 40706 0650be877a37
parent 29485 6a98f9408a50
child 45830 c102b704edb5
permissions -rwxr-xr-x
sparse-revlog: add a `trim_endidx` function in C We are about to implement a native version of `slicechunktodensity`. For clarity, we introduce the helper functions first. This function implement a subpart of the python function `_trimchunk` in `mercurial/revlogutils/deltas.py`. Handling of actual Python objects is left to the caller function.

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