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) |