tests/readlink.py
author Durham Goode <durham@fb.com>
Mon, 11 Nov 2013 16:40:02 -0800
changeset 20073 eeba4eaf0716
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
revlog: return lazy set from findcommonmissing When computing the commonmissing, it greedily computes the entire set immediately. On a large repo where the majority of history is irrelevant, this causes a significant slow down. Replacing it with a lazy set makes amend go from 11 seconds to 8.7 seconds.

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