diff --git a/tests/test-push-cgi.t b/tests/test-push-cgi.t --- a/tests/test-push-cgi.t +++ b/tests/test-push-cgi.t @@ -59,7 +59,7 @@ successful force push adding file changes added 0 changesets with 0 changes to 1 files -successful push +successful push, list of heads $ QUERY_STRING="cmd=unbundle&heads=f7b1eb17ad24730a1651fccd46c43826d1bbc2ac"; export QUERY_STRING $ python hgweb.cgi page3 2>&1 @@ -72,3 +72,17 @@ successful push adding manifests adding file changes added 0 changesets with 0 changes to 1 files + +successful push, SHA1 hash of heads (unbundlehash capability) + + $ QUERY_STRING="cmd=unbundle&heads=686173686564 5a785a5f9e0d433b88ed862b206b011b0c3a9d13"; export QUERY_STRING + $ python hgweb.cgi page4 2>&1 + $ cat page4 + Status: 200 Script output follows\r (esc) + Content-Type: application/mercurial-0.1\r (esc) + \r (esc) + 1 + adding changesets + adding manifests + adding file changes + added 0 changesets with 0 changes to 1 files 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 @@ -66,6 +66,32 @@ expect success repository tip rolled back to revision 0 (undo serve) working directory now based on revision 0 +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 + $ req + pushing to http://localhost:$HGPORT/ + searching for changes + remote: adding changesets + remote: adding manifests + remote: adding file changes + remote: added 1 changesets with 1 changes to 1 files + remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:*: (glob) + % serve errors + $ hg rollback + repository tip rolled back to revision 0 (undo serve) + working directory now based on revision 0 + expect authorization error: all users denied $ echo '[web]' > .hg/hgrc