Show More
@@ -1,24 +1,24 | |||
|
1 | 1 | # Disable the $CAP wire protocol capability. |
|
2 | 2 | |
|
3 | 3 | if test -z "$CAP" |
|
4 | 4 | then |
|
5 | 5 | echo "CAP environment variable not set." |
|
6 | 6 | fi |
|
7 | 7 | |
|
8 | 8 | cat > notcapable-$CAP.py << EOF |
|
9 | 9 | from mercurial import extensions, localrepo, repository |
|
10 | 10 | def extsetup(ui): |
|
11 | 11 | extensions.wrapfunction(repository.peer, 'capable', wrapcapable) |
|
12 | 12 | extensions.wrapfunction(localrepo.localrepository, 'peer', wrappeer) |
|
13 | 13 | def wrapcapable(orig, self, name, *args, **kwargs): |
|
14 | if name in '$CAP'.split(' '): | |
|
14 | if name in b'$CAP'.split(b' '): | |
|
15 | 15 | return False |
|
16 | 16 | return orig(self, name, *args, **kwargs) |
|
17 | 17 | def wrappeer(orig, self): |
|
18 | 18 | # Since we're disabling some newer features, we need to make sure local |
|
19 | 19 | # repos add in the legacy features again. |
|
20 | 20 | return localrepo.locallegacypeer(self) |
|
21 | 21 | EOF |
|
22 | 22 | |
|
23 | 23 | echo '[extensions]' >> $HGRCPATH |
|
24 | 24 | echo "notcapable-$CAP = `pwd`/notcapable-$CAP.py" >> $HGRCPATH |
General Comments 0
You need to be logged in to leave comments.
Login now