Mercurial > hg
comparison tests/test-http-bad-server.t @ 35792:1d118f9f4f57
bundle2: always advertise client support for stream parts
Previously, enabling of stream clone over bundle2 was a server-side
only change. And clients would only advertise bundle2 support for
stream clones if an experimental config option was set.
This situation wasn't forward compatible because in the future
(when the feature is enabled on servers by default), an old client
would send a request to the server but it wouldn't send its own
bundle2 capability support for stream parts. Servers would have to
infer that clients not sending this capability were old Mercurial
clients that only sent the capability if the feature was
explicitly enabled. Implicit and inferred behavior makes implementing
servers hard. It's much better to be explicit about client features.
We should either make the config option for bundle2 stream clones
disable the feature client-side as well (so a server doesn't see
a request from a client not advertising stream support). Or we
should always advertise stream support if a client is willing
to accept stream parts.
Since I anticipating stabilizing stream clone support in bundle2
quickly, I think it's safe to always advertise client support
in the bundle2 capabilities. So this commit changes things to
do that.
Because capabilities now vary between client and server, we had
to create variations of the variable substitutions for those
strings.
Differential Revision: https://phab.mercurial-scm.org/D1931
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 22 Jan 2018 12:23:47 -0800 |
parents | 44b8b5ad30eb |
children | e89959970a08 |
comparison
equal
deleted
inserted
replaced
35791:9adae6a20e1f | 35792:1d118f9f4f57 |
---|---|
447 write(2 from 2) -> (171) \r\n | 447 write(2 from 2) -> (171) \r\n |
448 write(42 from 42) -> (129) 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n; | 448 write(42 from 42) -> (129) 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n; |
449 readline(65537) -> (30) GET /?cmd=getbundle HTTP/1.1\r\n | 449 readline(65537) -> (30) GET /?cmd=getbundle HTTP/1.1\r\n |
450 readline(-1) -> (27) Accept-Encoding: identity\r\n | 450 readline(-1) -> (27) Accept-Encoding: identity\r\n |
451 readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n | 451 readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n |
452 readline(-1) -> (422) x-hgarg-1: bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=96ee1d7354c4ad7372047672c36a1f561e3a6a4c&listkeys=phases%2Cbookmarks\r\n | 452 readline(-1) -> (440) x-hgarg-1: bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Astream%253Dv2&cg=1&common=0000000000000000000000000000000000000000&heads=96ee1d7354c4ad7372047672c36a1f561e3a6a4c&listkeys=phases%2Cbookmarks\r\n |
453 readline(-1) -> (48) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$\r\n | 453 readline(-1) -> (48) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$\r\n |
454 readline(-1) -> (35) accept: application/mercurial-0.1\r\n | 454 readline(-1) -> (35) accept: application/mercurial-0.1\r\n |
455 readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob) | 455 readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob) |
456 readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n | 456 readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n |
457 readline(-1) -> (2) \r\n | 457 readline(-1) -> (2) \r\n |
508 write(2 from 2) -> (209) \r\n | 508 write(2 from 2) -> (209) \r\n |
509 write(42 from 42) -> (167) 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n; | 509 write(42 from 42) -> (167) 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n; |
510 readline(65537) -> (30) GET /?cmd=getbundle HTTP/1.1\r\n | 510 readline(65537) -> (30) GET /?cmd=getbundle HTTP/1.1\r\n |
511 readline(-1) -> (27) Accept-Encoding: identity\r\n | 511 readline(-1) -> (27) Accept-Encoding: identity\r\n |
512 readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n | 512 readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n |
513 readline(-1) -> (422) x-hgarg-1: bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=96ee1d7354c4ad7372047672c36a1f561e3a6a4c&listkeys=phases%2Cbookmarks\r\n | 513 readline(-1) -> (440) x-hgarg-1: bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Astream%253Dv2&cg=1&common=0000000000000000000000000000000000000000&heads=96ee1d7354c4ad7372047672c36a1f561e3a6a4c&listkeys=phases%2Cbookmarks\r\n |
514 readline(-1) -> (48) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$\r\n | 514 readline(-1) -> (48) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$\r\n |
515 readline(-1) -> (35) accept: application/mercurial-0.1\r\n | 515 readline(-1) -> (35) accept: application/mercurial-0.1\r\n |
516 readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob) | 516 readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob) |
517 readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n | 517 readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n |
518 readline(-1) -> (2) \r\n | 518 readline(-1) -> (2) \r\n |
571 write(2 from 2) -> (233) \r\n | 571 write(2 from 2) -> (233) \r\n |
572 write(42 from 42) -> (191) 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n; | 572 write(42 from 42) -> (191) 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n; |
573 readline(65537) -> (30) GET /?cmd=getbundle HTTP/1.1\r\n | 573 readline(65537) -> (30) GET /?cmd=getbundle HTTP/1.1\r\n |
574 readline(-1) -> (27) Accept-Encoding: identity\r\n | 574 readline(-1) -> (27) Accept-Encoding: identity\r\n |
575 readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n | 575 readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n |
576 readline(-1) -> (422) x-hgarg-1: bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=96ee1d7354c4ad7372047672c36a1f561e3a6a4c&listkeys=phases%2Cbookmarks\r\n | 576 readline(-1) -> (440) x-hgarg-1: bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Astream%253Dv2&cg=1&common=0000000000000000000000000000000000000000&heads=96ee1d7354c4ad7372047672c36a1f561e3a6a4c&listkeys=phases%2Cbookmarks\r\n |
577 readline(-1) -> (48) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$\r\n | 577 readline(-1) -> (48) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$\r\n |
578 readline(-1) -> (35) accept: application/mercurial-0.1\r\n | 578 readline(-1) -> (35) accept: application/mercurial-0.1\r\n |
579 readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob) | 579 readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob) |
580 readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n | 580 readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n |
581 readline(-1) -> (2) \r\n | 581 readline(-1) -> (2) \r\n |