tests/notcapable
author Pierre-Yves David <pierre-yves.david@logilab.fr>
Tue, 15 Jan 2013 12:11:18 +0100
changeset 18389 82572533bc00
parent 17192 1ac628cd7113
child 33806 dedab036215d
permissions -rw-r--r--
hgweb: move the `seq` function out of the revnavgen scope There is not reason for it to be a in there. And this function could use a major reworks.

# 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, peer, localrepo
def extsetup():
    extensions.wrapfunction(peer.peerrepository, 'capable', wrapcapable)
    extensions.wrapfunction(localrepo.localrepository, 'peer', wrappeer)
def wrapcapable(orig, self, name, *args, **kwargs):
    if name in '$CAP'.split(' '):
        return False
    return orig(self, name, *args, **kwargs)
def wrappeer(orig, self):
    # Since we're disabling some newer features, we need to make sure local
    # repos add in the legacy features again.
    return localrepo.locallegacypeer(self)
EOF

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