tests/readlink.py
author Sean Farley <sean.michael.farley@gmail.com>
Thu, 16 Oct 2014 21:49:28 -0700
changeset 23775 885c0290f7d5
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
localrepo: add ignoremissing parameter to branchtip Previously, in the namespaces api, the only caller of branchtip was singlenode which happened to raise the same exception that branchtip raised: KeyError. This is a minor change but will allow upcoming patches to use repo.branchtip to not raise an exception if a branch doesn't exist. After that, it will be possible for extensions to use the namespace api in a stable way.

#!/usr/bin/env python

import errno, os, sys

for f in sys.argv[1:]:
    try:
        print f, '->', os.readlink(f)
    except OSError, err:
        if err.errno != errno.EINVAL:
            raise
        print f, 'not a symlink'

sys.exit(0)