##// END OF EJS Templates
tests: add b'' to notcapable...
Gregory Szorc -
r41344:15fd3069 default
parent child Browse files
Show More
@@ -1,24 +1,24
1 # Disable the $CAP wire protocol capability.
1 # Disable the $CAP wire protocol capability.
2
2
3 if test -z "$CAP"
3 if test -z "$CAP"
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, localrepo, repository
9 from mercurial import extensions, localrepo, repository
10 def extsetup(ui):
10 def extsetup(ui):
11 extensions.wrapfunction(repository.peer, '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 b'$CAP'.split(b' '):
15 return False
15 return False
16 return orig(self, name, *args, **kwargs)
16 return orig(self, name, *args, **kwargs)
17 def wrappeer(orig, self):
17 def wrappeer(orig, self):
18 # Since we're disabling some newer features, we need to make sure local
18 # Since we're disabling some newer features, we need to make sure local
19 # repos add in the legacy features again.
19 # repos add in the legacy features again.
20 return localrepo.locallegacypeer(self)
20 return localrepo.locallegacypeer(self)
21 EOF
21 EOF
22
22
23 echo '[extensions]' >> $HGRCPATH
23 echo '[extensions]' >> $HGRCPATH
24 echo "notcapable-$CAP = `pwd`/notcapable-$CAP.py" >> $HGRCPATH
24 echo "notcapable-$CAP = `pwd`/notcapable-$CAP.py" >> $HGRCPATH
General Comments 0
You need to be logged in to leave comments. Login now