diff --git a/tests/notcapable b/tests/notcapable new file mode 100644 --- /dev/null +++ b/tests/notcapable @@ -0,0 +1,19 @@ +# Disable the $CAP wire protocol capability. + +if test -z "$CAP" +then + echo "CAP environment variable not set." +fi + +cat > notcapable-$CAP.py << EOF +from mercurial import extensions, repo +def extsetup(): + extensions.wrapfunction(repo.repository, 'capable', wrapper) +def wrapper(orig, self, name, *args, **kwargs): + if name == '$CAP': + return False + return orig(self, name, *args, **kwargs) +EOF + +echo '[extensions]' >> $HGRCPATH +echo "notcapable-$CAP = `pwd`/notcapable-$CAP.py" >> $HGRCPATH diff --git a/tests/test-push-http.t b/tests/test-push-http.t --- a/tests/test-push-http.t +++ b/tests/test-push-http.t @@ -68,17 +68,8 @@ expect success expect success, server lacks the unbundlehash capability - $ cat > unbundlehash-off.py << EOF - > from mercurial import extensions, repo - > def extsetup(): - > extensions.wrapfunction(repo.repository, 'capable', wrapper) - > def wrapper(orig, self, name, *args, **kwargs): - > if name == 'unbundlehash': - > return False - > return orig(self, name, *args, **kwargs) - > EOF - $ echo '[extensions]' >> .hg/hgrc - $ echo "unbundlehash-off = `pwd`/unbundlehash-off.py" >> .hg/hgrc + $ CAP=unbundlehash + $ . "$TESTDIR/notcapable" $ req pushing to http://localhost:$HGPORT/ searching for changes