tests/notcapable
changeset 33806 dedab036215d
parent 17192 1ac628cd7113
child 41068 28a4fb793ba1
equal deleted inserted replaced
33805:f913e90f15a0 33806:dedab036215d
     4 then
     4 then
     5     echo "CAP environment variable not set."
     5     echo "CAP environment variable not set."
     6 fi
     6 fi
     7 
     7 
     8 cat > notcapable-$CAP.py << EOF
     8 cat > notcapable-$CAP.py << EOF
     9 from mercurial import extensions, peer, localrepo
     9 from mercurial import extensions, localrepo, repository
    10 def extsetup():
    10 def extsetup():
    11     extensions.wrapfunction(peer.peerrepository, 'capable', wrapcapable)
    11     extensions.wrapfunction(repository.peer, 'capable', wrapcapable)
    12     extensions.wrapfunction(localrepo.localrepository, 'peer', wrappeer)
    12     extensions.wrapfunction(localrepo.localrepository, 'peer', wrappeer)
    13 def wrapcapable(orig, self, name, *args, **kwargs):
    13 def wrapcapable(orig, self, name, *args, **kwargs):
    14     if name in '$CAP'.split(' '):
    14     if name in '$CAP'.split(' '):
    15         return False
    15         return False
    16     return orig(self, name, *args, **kwargs)
    16     return orig(self, name, *args, **kwargs)