[PATCH 1 of 5 mainline] test: spread capabilities replies in 'test-hgweb-commands'
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Thu Nov 12 19:29:37 UTC 2015
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1445336709 -7200
# Tue Oct 20 12:25:09 2015 +0200
# Node ID 8aea4597c85f4595c9ee3d2117417fe2915d8eac
# Parent c94b9591b95fe6580f5d8455da2c90806d8ccf28
# EXP-Topic generaldelta
# Available At http://hg.netv6.net/marmoute-wip/mercurial/
# hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r 8aea4597c85f
test: spread capabilities replies in 'test-hgweb-commands'
Any changes to the capabilities string was very hard to review. So we introduce two
tests. A small one that validate the format and a second one to validate the
content, where each capability is on its own line to make changes simpler to
review.
diff --git a/tests/test-hgweb-commands.t b/tests/test-hgweb-commands.t
--- a/tests/test-hgweb-commands.t
+++ b/tests/test-hgweb-commands.t
@@ -2096,14 +2096,38 @@ Graph json escape of multibyte character
... print line,
var data = [["061dd13ba3c3", [0, 1], [[0, 0, 1, -1, ""]], "\u80fd", "test", "1970-01-01", ["unstable", true], ["tip"], ["something"]], ["cad8025a2e87", [0, 1], [[0, 0, 1, 3, "FF0000"]], "branch commit with null character: \u0000", "test", "1970-01-01", ["unstable", false], [], []], ["1d22e65f027e", [0, 1], [[0, 0, 1, 3, ""]], "branch", "test", "1970-01-01", ["stable", true], [], []], ["a4f92ed23982", [0, 1], [[0, 0, 1, 3, ""]], "Added tag 1.0 for changeset 2ef0ac749a14", "test", "1970-01-01", ["default", true], [], []], ["2ef0ac749a14", [0, 1], [], "base", "test", "1970-01-01", ["default", false], ["1.0"], ["anotherthing"]]];
capabilities
- $ get-with-headers.py 127.0.0.1:$HGPORT '?cmd=capabilities'; echo
+(plain version to check the format)
+
+ $ get-with-headers.py 127.0.0.1:$HGPORT '?cmd=capabilities' | dd ibs=75 count=1 2> /dev/null; echo
200 Script output follows
- lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch stream-preferred stream bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1*%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024 (glob)
+ lookup changegroupsubset branchmap pushkey known
+
+(spread version to check the content)
+
+ $ get-with-headers.py 127.0.0.1:$HGPORT '?cmd=capabilities' | tr ' ' '\n'; echo
+ 200
+ Script
+ output
+ follows
+
+ lookup
+ changegroupsubset
+ branchmap
+ pushkey
+ known
+ getbundle
+ unbundlehash
+ batch
+ stream-preferred
+ stream
+ bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps
+ unbundle=HG10GZ,HG10BZ,HG10UN
+ httpheader=1024
heads
ERRORS ENCOUNTERED
More information about the Mercurial-devel
mailing list