tests/readlink.py
author Gregory Szorc <gregory.szorc@gmail.com>
Sat, 03 Oct 2015 09:53:56 -0700
changeset 26460 79ef867538ea
parent 25660 328739ea70c3
child 29175 7bcfb9090c86
permissions -rwxr-xr-x
branchmap: move branch cache code out of streamclone.py This is low-level branch map and cache manipulation code. It deserves to live next to similar code in branchmap.py. Moving it also paves the road for multiple consumers, such as a bundle2 part handler that receives branch mappings from a remote. This is largely a mechanical move, with only variable names and indentation being changed.

#!/usr/bin/env python

import errno, os, 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, 'not a symlink'

sys.exit(0)