tests/notcapable
author Greg Ward <greg@gerg.ca>
Thu, 13 Oct 2011 21:42:54 -0400
changeset 15255 7ab05d752405
parent 14409 9ff996ba00b4
child 17192 1ac628cd7113
permissions -rw-r--r--
largefiles: cosmetics, whitespace, code style This is mainly about keeping code under the 80-column limit with as few backslashes as possible. I am deliberately not making any logic or behaviour changes here and have restrained myself to a few "peephole" refactorings.

# Disable the $CAP wire protocol capability.

if test -z "$CAP"
then
    echo "CAP environment variable not set."
fi

cat > notcapable-$CAP.py << EOF
from mercurial import extensions, repo
def extsetup():
    extensions.wrapfunction(repo.repository, 'capable', wrapper)
def wrapper(orig, self, name, *args, **kwargs):
    if name in '$CAP'.split(' '):
        return False
    return orig(self, name, *args, **kwargs)
EOF

echo '[extensions]' >> $HGRCPATH
echo "notcapable-$CAP = `pwd`/notcapable-$CAP.py" >> $HGRCPATH