tests/readlink.py
author Siddharth Agarwal <sid0@fb.com>
Fri, 15 Nov 2013 18:06:01 -0800
changeset 20097 85d9200ba9f0
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
commands.bookmark: use unsetcurrent instead of setcurrent with None There are currently two different ways we can have no active bookmark: .hg/bookmarks.current being missing and it being an empty file. This patch and upcoming ones make an empty file the only way to represent no active bookmarks. This is the right choice because it matches the state that a new repository without bookmarks will be in.

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