Show More
@@ -0,0 +1,19 b'' | |||||
|
1 | # Disable the $CAP wire protocol capability. | |||
|
2 | ||||
|
3 | if test -z "$CAP" | |||
|
4 | then | |||
|
5 | echo "CAP environment variable not set." | |||
|
6 | fi | |||
|
7 | ||||
|
8 | cat > notcapable-$CAP.py << EOF | |||
|
9 | from mercurial import extensions, repo | |||
|
10 | def extsetup(): | |||
|
11 | extensions.wrapfunction(repo.repository, 'capable', wrapper) | |||
|
12 | def wrapper(orig, self, name, *args, **kwargs): | |||
|
13 | if name == '$CAP': | |||
|
14 | return False | |||
|
15 | return orig(self, name, *args, **kwargs) | |||
|
16 | EOF | |||
|
17 | ||||
|
18 | echo '[extensions]' >> $HGRCPATH | |||
|
19 | echo "notcapable-$CAP = `pwd`/notcapable-$CAP.py" >> $HGRCPATH |
@@ -68,17 +68,8 b' expect success' | |||||
68 |
|
68 | |||
69 | expect success, server lacks the unbundlehash capability |
|
69 | expect success, server lacks the unbundlehash capability | |
70 |
|
70 | |||
71 | $ cat > unbundlehash-off.py << EOF |
|
71 | $ CAP=unbundlehash | |
72 | > from mercurial import extensions, repo |
|
72 | $ . "$TESTDIR/notcapable" | |
73 | > def extsetup(): |
|
|||
74 | > extensions.wrapfunction(repo.repository, 'capable', wrapper) |
|
|||
75 | > def wrapper(orig, self, name, *args, **kwargs): |
|
|||
76 | > if name == 'unbundlehash': |
|
|||
77 | > return False |
|
|||
78 | > return orig(self, name, *args, **kwargs) |
|
|||
79 | > EOF |
|
|||
80 | $ echo '[extensions]' >> .hg/hgrc |
|
|||
81 | $ echo "unbundlehash-off = `pwd`/unbundlehash-off.py" >> .hg/hgrc |
|
|||
82 |
$ |
|
73 | $ req | |
83 | pushing to http://localhost:$HGPORT/ |
|
74 | pushing to http://localhost:$HGPORT/ | |
84 | searching for changes |
|
75 | searching for changes |
General Comments 0
You need to be logged in to leave comments.
Login now