annotate tests/test-wireproto-command-listkeys.t @ 42415:c767e655ffda

narrow: use narrow_widen wireproto command to widen in case of ellipses Few releases ago, we introduce narrow_widen wireproto command to be used to widen narrow repositories. Before this patch, that was used in non-ellipses cases only. In ellipses cases, we still do exchange.pull() which can pull more data than required. After this patch, the client will first check whether server supports doing ellipses widening using wireproto command or not by checking server's wireproto capability. If the server is upto date and support latest ellipses capability, we call the wireproto command. Otherwise we fallback to exchange.pull() like before. The compat code make sure that things works even if one of the client or server is old. The initial version of this patch does not had this compat code. It's added to help Google release things smoothly internally. I plan to drop the compat code before the upcoming major release. Due to change to wireproto command, the code looks a bit dirty, next patches will clean that up. Differential Revision: https://phab.mercurial-scm.org/D6436
author Pulkit Goyal <7895pulkit@gmail.com>
date Wed, 22 May 2019 02:59:48 +0530
parents a732d70253b0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
37487
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
1 $ . $TESTDIR/wireprotohelpers.sh
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
2
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
3 $ hg init server
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
4 $ enablehttpv2 server
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
5 $ cd server
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
6 $ hg debugdrawdag << EOF
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
7 > C D
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
8 > |/
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
9 > B
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
10 > |
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
11 > A
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
12 > EOF
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
13
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
14 $ hg phase --public -r C
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
15 $ hg book -r C @
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
16
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
17 $ hg log -T '{rev}:{node} {desc}\n'
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
18 3:be0ef73c17ade3fc89dc41701eb9fc3a91b58282 D
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
19 2:26805aba1e600a82e93661149f2313866a221a7b C
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
20 1:112478962961147124edd43549aedd1a335e44bf B
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
21 0:426bada5c67598ca65036d57d9e4b64b0c1ce7a0 A
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
22
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
23 $ hg serve -p $HGPORT -d --pid-file hg.pid -E error.log
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
24 $ cat hg.pid > $DAEMON_PIDS
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
25
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
26 Request for namespaces works
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
27
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
28 $ sendhttpv2peer << EOF
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
29 > command listkeys
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
30 > namespace namespaces
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
31 > EOF
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
32 creating http peer for wire protocol version 2
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
33 sending listkeys command
39378
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37725
diff changeset
34 response: {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37725
diff changeset
35 b'bookmarks': b'',
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37725
diff changeset
36 b'namespaces': b'',
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37725
diff changeset
37 b'phases': b''
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37725
diff changeset
38 }
37487
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
39
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
40 Request for phases works
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
41
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
42 $ sendhttpv2peer << EOF
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
43 > command listkeys
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
44 > namespace phases
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
45 > EOF
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
46 creating http peer for wire protocol version 2
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
47 sending listkeys command
39378
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37725
diff changeset
48 response: {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37725
diff changeset
49 b'be0ef73c17ade3fc89dc41701eb9fc3a91b58282': b'1',
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37725
diff changeset
50 b'publishing': b'True'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37725
diff changeset
51 }
37487
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
52
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
53 Request for bookmarks works
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
54
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
55 $ sendhttpv2peer << EOF
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
56 > command listkeys
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
57 > namespace bookmarks
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
58 > EOF
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
59 creating http peer for wire protocol version 2
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
60 sending listkeys command
39378
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37725
diff changeset
61 response: {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37725
diff changeset
62 b'@': b'26805aba1e600a82e93661149f2313866a221a7b'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37725
diff changeset
63 }
37487
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
64
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
65 $ cat error.log