Show More
@@ -1,636 +1,638 b'' | |||
|
1 | 1 | #require serve no-reposimplestore no-chg |
|
2 | 2 | |
|
3 | 3 | #testcases stream-legacy stream-bundle2 |
|
4 | 4 | |
|
5 | 5 | #if stream-legacy |
|
6 | 6 | $ cat << EOF >> $HGRCPATH |
|
7 | 7 | > [server] |
|
8 | 8 | > bundle2.stream = no |
|
9 | 9 | > EOF |
|
10 | 10 | #endif |
|
11 | 11 | |
|
12 | 12 | Initialize repository |
|
13 | 13 | the status call is to check for issue5130 |
|
14 | 14 | |
|
15 | 15 | $ hg init server |
|
16 | 16 | $ cd server |
|
17 | 17 | $ touch foo |
|
18 | 18 | $ hg -q commit -A -m initial |
|
19 | 19 | >>> for i in range(1024): |
|
20 | 20 | ... with open(str(i), 'wb') as fh: |
|
21 | 21 | ... fh.write(b"%d" % i) and None |
|
22 | 22 | $ hg -q commit -A -m 'add a lot of files' |
|
23 | 23 | $ hg st |
|
24 | 24 | $ hg --config server.uncompressed=false serve -p $HGPORT -d --pid-file=hg.pid |
|
25 | 25 | $ cat hg.pid > $DAEMON_PIDS |
|
26 | 26 | $ cd .. |
|
27 | 27 | |
|
28 | 28 | Cannot stream clone when server.uncompressed is set |
|
29 | 29 | |
|
30 | 30 | $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=stream_out' |
|
31 | 31 | 200 Script output follows |
|
32 | 32 | |
|
33 | 33 | 1 |
|
34 | 34 | |
|
35 | 35 | #if stream-legacy |
|
36 | 36 | $ hg debugcapabilities http://localhost:$HGPORT |
|
37 | 37 | Main capabilities: |
|
38 | 38 | batch |
|
39 | 39 | branchmap |
|
40 | 40 | $USUAL_BUNDLE2_CAPS_SERVER$ |
|
41 | 41 | changegroupsubset |
|
42 | 42 | compression=$BUNDLE2_COMPRESSIONS$ |
|
43 | 43 | getbundle |
|
44 | 44 | httpheader=1024 |
|
45 | 45 | httpmediatype=0.1rx,0.1tx,0.2tx |
|
46 | 46 | known |
|
47 | 47 | lookup |
|
48 | 48 | pushkey |
|
49 | 49 | unbundle=HG10GZ,HG10BZ,HG10UN |
|
50 | 50 | unbundlehash |
|
51 | 51 | Bundle2 capabilities: |
|
52 | 52 | HG20 |
|
53 | 53 | bookmarks |
|
54 | 54 | changegroup |
|
55 | 55 | 01 |
|
56 | 56 | 02 |
|
57 | 57 | checkheads |
|
58 | 58 | related |
|
59 | 59 | digests |
|
60 | 60 | md5 |
|
61 | 61 | sha1 |
|
62 | 62 | sha512 |
|
63 | 63 | error |
|
64 | 64 | abort |
|
65 | 65 | unsupportedcontent |
|
66 | 66 | pushraced |
|
67 | 67 | pushkey |
|
68 | 68 | hgtagsfnodes |
|
69 | 69 | listkeys |
|
70 | 70 | phases |
|
71 | 71 | heads |
|
72 | 72 | pushkey |
|
73 | 73 | remote-changegroup |
|
74 | 74 | http |
|
75 | 75 | https |
|
76 | 76 | |
|
77 | 77 | $ hg clone --stream -U http://localhost:$HGPORT server-disabled |
|
78 | 78 | warning: stream clone requested but server has them disabled |
|
79 | 79 | requesting all changes |
|
80 | 80 | adding changesets |
|
81 | 81 | adding manifests |
|
82 | 82 | adding file changes |
|
83 | 83 | added 2 changesets with 1025 changes to 1025 files |
|
84 | 84 | new changesets 96ee1d7354c4:c17445101a72 |
|
85 | 85 | |
|
86 | 86 | $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto 0.2 --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1" |
|
87 | 87 | 200 Script output follows |
|
88 | 88 | content-type: application/mercurial-0.2 |
|
89 | 89 | |
|
90 | 90 | |
|
91 | 91 | $ f --size body --hexdump --bytes 100 |
|
92 | 92 | body: size=232 |
|
93 | 93 | 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......| |
|
94 | 94 | 0010: cf 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |..ERROR:ABORT...| |
|
95 | 95 | 0020: 00 01 01 07 3c 04 72 6d 65 73 73 61 67 65 73 74 |....<.rmessagest| |
|
96 | 96 | 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques| |
|
97 | 97 | 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d| |
|
98 | 98 | 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th| |
|
99 | 99 | 0060: 69 73 20 66 |is f| |
|
100 | 100 | |
|
101 | 101 | #endif |
|
102 | 102 | #if stream-bundle2 |
|
103 | 103 | $ hg debugcapabilities http://localhost:$HGPORT |
|
104 | 104 | Main capabilities: |
|
105 | 105 | batch |
|
106 | 106 | branchmap |
|
107 | 107 | $USUAL_BUNDLE2_CAPS_SERVER$ |
|
108 | 108 | changegroupsubset |
|
109 | 109 | compression=$BUNDLE2_COMPRESSIONS$ |
|
110 | 110 | getbundle |
|
111 | 111 | httpheader=1024 |
|
112 | 112 | httpmediatype=0.1rx,0.1tx,0.2tx |
|
113 | 113 | known |
|
114 | 114 | lookup |
|
115 | 115 | pushkey |
|
116 | 116 | unbundle=HG10GZ,HG10BZ,HG10UN |
|
117 | 117 | unbundlehash |
|
118 | 118 | Bundle2 capabilities: |
|
119 | 119 | HG20 |
|
120 | 120 | bookmarks |
|
121 | 121 | changegroup |
|
122 | 122 | 01 |
|
123 | 123 | 02 |
|
124 | 124 | checkheads |
|
125 | 125 | related |
|
126 | 126 | digests |
|
127 | 127 | md5 |
|
128 | 128 | sha1 |
|
129 | 129 | sha512 |
|
130 | 130 | error |
|
131 | 131 | abort |
|
132 | 132 | unsupportedcontent |
|
133 | 133 | pushraced |
|
134 | 134 | pushkey |
|
135 | 135 | hgtagsfnodes |
|
136 | 136 | listkeys |
|
137 | 137 | phases |
|
138 | 138 | heads |
|
139 | 139 | pushkey |
|
140 | 140 | remote-changegroup |
|
141 | 141 | http |
|
142 | 142 | https |
|
143 | 143 | |
|
144 | 144 | $ hg clone --stream -U http://localhost:$HGPORT server-disabled |
|
145 | 145 | warning: stream clone requested but server has them disabled |
|
146 | 146 | requesting all changes |
|
147 | 147 | adding changesets |
|
148 | 148 | adding manifests |
|
149 | 149 | adding file changes |
|
150 | 150 | added 2 changesets with 1025 changes to 1025 files |
|
151 | 151 | new changesets 96ee1d7354c4:c17445101a72 |
|
152 | 152 | |
|
153 | 153 | $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto 0.2 --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1" |
|
154 | 154 | 200 Script output follows |
|
155 | 155 | content-type: application/mercurial-0.2 |
|
156 | 156 | |
|
157 | 157 | |
|
158 | 158 | $ f --size body --hexdump --bytes 100 |
|
159 | 159 | body: size=232 |
|
160 | 160 | 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......| |
|
161 | 161 | 0010: cf 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |..ERROR:ABORT...| |
|
162 | 162 | 0020: 00 01 01 07 3c 04 72 6d 65 73 73 61 67 65 73 74 |....<.rmessagest| |
|
163 | 163 | 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques| |
|
164 | 164 | 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d| |
|
165 | 165 | 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th| |
|
166 | 166 | 0060: 69 73 20 66 |is f| |
|
167 | 167 | |
|
168 | 168 | #endif |
|
169 | 169 | |
|
170 | 170 | $ killdaemons.py |
|
171 | 171 | $ cd server |
|
172 | $ hg serve -p $HGPORT -d --pid-file=hg.pid | |
|
172 | $ hg serve -p $HGPORT -d --pid-file=hg.pid --error errors.txt | |
|
173 | 173 | $ cat hg.pid > $DAEMON_PIDS |
|
174 | 174 | $ cd .. |
|
175 | 175 | |
|
176 | 176 | Basic clone |
|
177 | 177 | |
|
178 | 178 | #if stream-legacy |
|
179 | 179 | $ hg clone --stream -U http://localhost:$HGPORT clone1 |
|
180 | 180 | streaming all changes |
|
181 | 181 | 1027 files to transfer, 96.3 KB of data (no-zstd !) |
|
182 | 182 | transferred 96.3 KB in * seconds (*/sec) (glob) (no-zstd !) |
|
183 | 183 | 1027 files to transfer, 93.5 KB of data (zstd !) |
|
184 | 184 | transferred 93.5 KB in * seconds (* */sec) (glob) (zstd !) |
|
185 | 185 | searching for changes |
|
186 | 186 | no changes found |
|
187 | $ cat server/errors.txt | |
|
187 | 188 | #endif |
|
188 | 189 | #if stream-bundle2 |
|
189 | 190 | $ hg clone --stream -U http://localhost:$HGPORT clone1 |
|
190 | 191 | streaming all changes |
|
191 | 192 | 1030 files to transfer, 96.5 KB of data (no-zstd !) |
|
192 | 193 | transferred 96.5 KB in * seconds (*/sec) (glob) (no-zstd !) |
|
193 | 194 | 1030 files to transfer, 93.6 KB of data (zstd !) |
|
194 | 195 | transferred 93.6 KB in * seconds (* */sec) (glob) (zstd !) |
|
195 | 196 | |
|
196 | 197 | $ ls -1 clone1/.hg/cache |
|
197 | 198 | branch2-base |
|
198 | 199 | branch2-immutable |
|
199 | 200 | branch2-served |
|
200 | 201 | branch2-served.hidden |
|
201 | 202 | branch2-visible |
|
202 | 203 | branch2-visible-hidden |
|
203 | 204 | hgtagsfnodes1 |
|
204 | 205 | rbc-names-v1 |
|
205 | 206 | rbc-revs-v1 |
|
206 | 207 | tags2 |
|
207 | 208 | tags2-served |
|
209 | $ cat server/errors.txt | |
|
208 | 210 | #endif |
|
209 | 211 | |
|
210 | 212 | getbundle requests with stream=1 are uncompressed |
|
211 | 213 | |
|
212 | 214 | $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto '0.1 0.2 comp=zlib,none' --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1" |
|
213 | 215 | 200 Script output follows |
|
214 | 216 | content-type: application/mercurial-0.2 |
|
215 | 217 | |
|
216 | 218 | |
|
217 | 219 | $ f --size --hex --bytes 256 body |
|
218 | 220 | body: size=112262 (no-zstd !) |
|
219 | 221 | body: size=109410 (zstd no-rust !) |
|
220 | 222 | body: size=109431 (rust !) |
|
221 | 223 | 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......| |
|
222 | 224 | 0010: 7f 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |..STREAM2.......| (no-zstd !) |
|
223 | 225 | 0020: 05 09 04 0c 44 62 79 74 65 63 6f 75 6e 74 39 38 |....Dbytecount98| (no-zstd !) |
|
224 | 226 | 0030: 37 37 35 66 69 6c 65 63 6f 75 6e 74 31 30 33 30 |775filecount1030| (no-zstd !) |
|
225 | 227 | 0010: 99 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |..STREAM2.......| (zstd no-rust !) |
|
226 | 228 | 0010: ae 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |..STREAM2.......| (rust !) |
|
227 | 229 | 0020: 05 09 04 0c 5e 62 79 74 65 63 6f 75 6e 74 39 35 |....^bytecount95| (zstd no-rust !) |
|
228 | 230 | 0020: 05 09 04 0c 73 62 79 74 65 63 6f 75 6e 74 39 35 |....sbytecount95| (rust !) |
|
229 | 231 | 0030: 38 39 37 66 69 6c 65 63 6f 75 6e 74 31 30 33 30 |897filecount1030| (zstd !) |
|
230 | 232 | 0040: 72 65 71 75 69 72 65 6d 65 6e 74 73 64 6f 74 65 |requirementsdote| |
|
231 | 233 | 0050: 6e 63 6f 64 65 25 32 43 66 6e 63 61 63 68 65 25 |ncode%2Cfncache%| |
|
232 | 234 | 0060: 32 43 67 65 6e 65 72 61 6c 64 65 6c 74 61 25 32 |2Cgeneraldelta%2| |
|
233 | 235 | 0070: 43 72 65 76 6c 6f 67 76 31 25 32 43 73 70 61 72 |Crevlogv1%2Cspar| (no-zstd !) |
|
234 | 236 | 0080: 73 65 72 65 76 6c 6f 67 25 32 43 73 74 6f 72 65 |serevlog%2Cstore| (no-zstd !) |
|
235 | 237 | 0090: 00 00 80 00 73 08 42 64 61 74 61 2f 30 2e 69 00 |....s.Bdata/0.i.| (no-zstd !) |
|
236 | 238 | 00a0: 03 00 01 00 00 00 00 00 00 00 02 00 00 00 01 00 |................| (no-zstd !) |
|
237 | 239 | 00b0: 00 00 00 00 00 00 01 ff ff ff ff ff ff ff ff 80 |................| (no-zstd !) |
|
238 | 240 | 00c0: 29 63 a0 49 d3 23 87 bf ce fe 56 67 92 67 2c 69 |)c.I.#....Vg.g,i| (no-zstd !) |
|
239 | 241 | 00d0: d1 ec 39 00 00 00 00 00 00 00 00 00 00 00 00 75 |..9............u| (no-zstd !) |
|
240 | 242 | 00e0: 30 73 08 42 64 61 74 61 2f 31 2e 69 00 03 00 01 |0s.Bdata/1.i....| (no-zstd !) |
|
241 | 243 | 00f0: 00 00 00 00 00 00 00 02 00 00 00 01 00 00 00 00 |................| (no-zstd !) |
|
242 | 244 | 0070: 43 72 65 76 6c 6f 67 2d 63 6f 6d 70 72 65 73 73 |Crevlog-compress| (zstd no-rust !) |
|
243 | 245 | 0070: 43 70 65 72 73 69 73 74 65 6e 74 2d 6e 6f 64 65 |Cpersistent-node| (rust !) |
|
244 | 246 | 0080: 69 6f 6e 2d 7a 73 74 64 25 32 43 72 65 76 6c 6f |ion-zstd%2Crevlo| (zstd no-rust !) |
|
245 | 247 | 0080: 6d 61 70 25 32 43 72 65 76 6c 6f 67 2d 63 6f 6d |map%2Crevlog-com| (rust !) |
|
246 | 248 | 0090: 67 76 31 25 32 43 73 70 61 72 73 65 72 65 76 6c |gv1%2Csparserevl| (zstd no-rust !) |
|
247 | 249 | 0090: 70 72 65 73 73 69 6f 6e 2d 7a 73 74 64 25 32 43 |pression-zstd%2C| (rust !) |
|
248 | 250 | 00a0: 6f 67 25 32 43 73 74 6f 72 65 00 00 80 00 73 08 |og%2Cstore....s.| (zstd no-rust !) |
|
249 | 251 | 00a0: 72 65 76 6c 6f 67 76 31 25 32 43 73 70 61 72 73 |revlogv1%2Cspars| (rust !) |
|
250 | 252 | 00b0: 42 64 61 74 61 2f 30 2e 69 00 03 00 01 00 00 00 |Bdata/0.i.......| (zstd no-rust !) |
|
251 | 253 | 00b0: 65 72 65 76 6c 6f 67 25 32 43 73 74 6f 72 65 00 |erevlog%2Cstore.| (rust !) |
|
252 | 254 | 00c0: 00 00 00 00 02 00 00 00 01 00 00 00 00 00 00 00 |................| (zstd no-rust !) |
|
253 | 255 | 00c0: 00 80 00 73 08 42 64 61 74 61 2f 30 2e 69 00 03 |...s.Bdata/0.i..| (rust !) |
|
254 | 256 | 00d0: 01 ff ff ff ff ff ff ff ff 80 29 63 a0 49 d3 23 |..........)c.I.#| (zstd no-rust !) |
|
255 | 257 | 00d0: 00 01 00 00 00 00 00 00 00 02 00 00 00 01 00 00 |................| (rust !) |
|
256 | 258 | 00e0: 87 bf ce fe 56 67 92 67 2c 69 d1 ec 39 00 00 00 |....Vg.g,i..9...| (zstd no-rust !) |
|
257 | 259 | 00e0: 00 00 00 00 00 01 ff ff ff ff ff ff ff ff 80 29 |...............)| (rust !) |
|
258 | 260 | 00f0: 00 00 00 00 00 00 00 00 00 75 30 73 08 42 64 61 |.........u0s.Bda| (zstd no-rust !) |
|
259 | 261 | 00f0: 63 a0 49 d3 23 87 bf ce fe 56 67 92 67 2c 69 d1 |c.I.#....Vg.g,i.| (rust !) |
|
260 | 262 | |
|
261 | 263 | --uncompressed is an alias to --stream |
|
262 | 264 | |
|
263 | 265 | #if stream-legacy |
|
264 | 266 | $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed |
|
265 | 267 | streaming all changes |
|
266 | 268 | 1027 files to transfer, 96.3 KB of data (no-zstd !) |
|
267 | 269 | transferred 96.3 KB in * seconds (*/sec) (glob) (no-zstd !) |
|
268 | 270 | 1027 files to transfer, 93.5 KB of data (zstd !) |
|
269 | 271 | transferred 93.5 KB in * seconds (* */sec) (glob) (zstd !) |
|
270 | 272 | searching for changes |
|
271 | 273 | no changes found |
|
272 | 274 | #endif |
|
273 | 275 | #if stream-bundle2 |
|
274 | 276 | $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed |
|
275 | 277 | streaming all changes |
|
276 | 278 | 1030 files to transfer, 96.5 KB of data (no-zstd !) |
|
277 | 279 | transferred 96.5 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
278 | 280 | 1030 files to transfer, 93.6 KB of data (zstd !) |
|
279 | 281 | transferred 93.6 KB in * seconds (* */sec) (glob) (zstd !) |
|
280 | 282 | #endif |
|
281 | 283 | |
|
282 | 284 | Clone with background file closing enabled |
|
283 | 285 | |
|
284 | 286 | #if stream-legacy |
|
285 | 287 | $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding |
|
286 | 288 | using http://localhost:$HGPORT/ |
|
287 | 289 | sending capabilities command |
|
288 | 290 | sending branchmap command |
|
289 | 291 | streaming all changes |
|
290 | 292 | sending stream_out command |
|
291 | 293 | 1027 files to transfer, 96.3 KB of data (no-zstd !) |
|
292 | 294 | 1027 files to transfer, 93.5 KB of data (zstd !) |
|
293 | 295 | starting 4 threads for background file closing |
|
294 | 296 | updating the branch cache |
|
295 | 297 | transferred 96.3 KB in * seconds (*/sec) (glob) (no-zstd !) |
|
296 | 298 | transferred 93.5 KB in * seconds (* */sec) (glob) (zstd !) |
|
297 | 299 | query 1; heads |
|
298 | 300 | sending batch command |
|
299 | 301 | searching for changes |
|
300 | 302 | all remote heads known locally |
|
301 | 303 | no changes found |
|
302 | 304 | sending getbundle command |
|
303 | 305 | bundle2-input-bundle: with-transaction |
|
304 | 306 | bundle2-input-part: "listkeys" (params: 1 mandatory) supported |
|
305 | 307 | bundle2-input-part: "phase-heads" supported |
|
306 | 308 | bundle2-input-part: total payload size 24 |
|
307 | 309 | bundle2-input-bundle: 2 parts total |
|
308 | 310 | checking for updated bookmarks |
|
309 | 311 | updating the branch cache |
|
310 | 312 | (sent 5 HTTP requests and * bytes; received * bytes in responses) (glob) |
|
311 | 313 | #endif |
|
312 | 314 | #if stream-bundle2 |
|
313 | 315 | $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding |
|
314 | 316 | using http://localhost:$HGPORT/ |
|
315 | 317 | sending capabilities command |
|
316 | 318 | query 1; heads |
|
317 | 319 | sending batch command |
|
318 | 320 | streaming all changes |
|
319 | 321 | sending getbundle command |
|
320 | 322 | bundle2-input-bundle: with-transaction |
|
321 | 323 | bundle2-input-part: "stream2" (params: 3 mandatory) supported |
|
322 | 324 | applying stream bundle |
|
323 | 325 | 1030 files to transfer, 96.5 KB of data (no-zstd !) |
|
324 | 326 | 1030 files to transfer, 93.6 KB of data (zstd !) |
|
325 | 327 | starting 4 threads for background file closing |
|
326 | 328 | starting 4 threads for background file closing |
|
327 | 329 | updating the branch cache |
|
328 | 330 | transferred 96.5 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
329 | 331 | bundle2-input-part: total payload size 112094 (no-zstd !) |
|
330 | 332 | transferred 93.6 KB in * seconds (* */sec) (glob) (zstd !) |
|
331 | 333 | bundle2-input-part: total payload size 109216 (zstd !) |
|
332 | 334 | bundle2-input-part: "listkeys" (params: 1 mandatory) supported |
|
333 | 335 | bundle2-input-bundle: 2 parts total |
|
334 | 336 | checking for updated bookmarks |
|
335 | 337 | updating the branch cache |
|
336 | 338 | (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob) |
|
337 | 339 | #endif |
|
338 | 340 | |
|
339 | 341 | Cannot stream clone when there are secret changesets |
|
340 | 342 | |
|
341 | 343 | $ hg -R server phase --force --secret -r tip |
|
342 | 344 | $ hg clone --stream -U http://localhost:$HGPORT secret-denied |
|
343 | 345 | warning: stream clone requested but server has them disabled |
|
344 | 346 | requesting all changes |
|
345 | 347 | adding changesets |
|
346 | 348 | adding manifests |
|
347 | 349 | adding file changes |
|
348 | 350 | added 1 changesets with 1 changes to 1 files |
|
349 | 351 | new changesets 96ee1d7354c4 |
|
350 | 352 | |
|
351 | 353 | $ killdaemons.py |
|
352 | 354 | |
|
353 | 355 | Streaming of secrets can be overridden by server config |
|
354 | 356 | |
|
355 | 357 | $ cd server |
|
356 | 358 | $ hg serve --config server.uncompressedallowsecret=true -p $HGPORT -d --pid-file=hg.pid |
|
357 | 359 | $ cat hg.pid > $DAEMON_PIDS |
|
358 | 360 | $ cd .. |
|
359 | 361 | |
|
360 | 362 | #if stream-legacy |
|
361 | 363 | $ hg clone --stream -U http://localhost:$HGPORT secret-allowed |
|
362 | 364 | streaming all changes |
|
363 | 365 | 1027 files to transfer, 96.3 KB of data (no-zstd !) |
|
364 | 366 | transferred 96.3 KB in * seconds (*/sec) (glob) (no-zstd !) |
|
365 | 367 | 1027 files to transfer, 93.5 KB of data (zstd !) |
|
366 | 368 | transferred 93.5 KB in * seconds (* */sec) (glob) (zstd !) |
|
367 | 369 | searching for changes |
|
368 | 370 | no changes found |
|
369 | 371 | #endif |
|
370 | 372 | #if stream-bundle2 |
|
371 | 373 | $ hg clone --stream -U http://localhost:$HGPORT secret-allowed |
|
372 | 374 | streaming all changes |
|
373 | 375 | 1030 files to transfer, 96.5 KB of data (no-zstd !) |
|
374 | 376 | transferred 96.5 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
375 | 377 | 1030 files to transfer, 93.6 KB of data (zstd !) |
|
376 | 378 | transferred 93.6 KB in * seconds (* */sec) (glob) (zstd !) |
|
377 | 379 | #endif |
|
378 | 380 | |
|
379 | 381 | $ killdaemons.py |
|
380 | 382 | |
|
381 | 383 | Verify interaction between preferuncompressed and secret presence |
|
382 | 384 | |
|
383 | 385 | $ cd server |
|
384 | 386 | $ hg serve --config server.preferuncompressed=true -p $HGPORT -d --pid-file=hg.pid |
|
385 | 387 | $ cat hg.pid > $DAEMON_PIDS |
|
386 | 388 | $ cd .. |
|
387 | 389 | |
|
388 | 390 | $ hg clone -U http://localhost:$HGPORT preferuncompressed-secret |
|
389 | 391 | requesting all changes |
|
390 | 392 | adding changesets |
|
391 | 393 | adding manifests |
|
392 | 394 | adding file changes |
|
393 | 395 | added 1 changesets with 1 changes to 1 files |
|
394 | 396 | new changesets 96ee1d7354c4 |
|
395 | 397 | |
|
396 | 398 | $ killdaemons.py |
|
397 | 399 | |
|
398 | 400 | Clone not allowed when full bundles disabled and can't serve secrets |
|
399 | 401 | |
|
400 | 402 | $ cd server |
|
401 | 403 | $ hg serve --config server.disablefullbundle=true -p $HGPORT -d --pid-file=hg.pid |
|
402 | 404 | $ cat hg.pid > $DAEMON_PIDS |
|
403 | 405 | $ cd .. |
|
404 | 406 | |
|
405 | 407 | $ hg clone --stream http://localhost:$HGPORT secret-full-disabled |
|
406 | 408 | warning: stream clone requested but server has them disabled |
|
407 | 409 | requesting all changes |
|
408 | 410 | remote: abort: server has pull-based clones disabled |
|
409 | 411 | abort: pull failed on remote |
|
410 | 412 | (remove --pull if specified or upgrade Mercurial) |
|
411 | 413 | [100] |
|
412 | 414 | |
|
413 | 415 | Local stream clone with secrets involved |
|
414 | 416 | (This is just a test over behavior: if you have access to the repo's files, |
|
415 | 417 | there is no security so it isn't important to prevent a clone here.) |
|
416 | 418 | |
|
417 | 419 | $ hg clone -U --stream server local-secret |
|
418 | 420 | warning: stream clone requested but server has them disabled |
|
419 | 421 | requesting all changes |
|
420 | 422 | adding changesets |
|
421 | 423 | adding manifests |
|
422 | 424 | adding file changes |
|
423 | 425 | added 1 changesets with 1 changes to 1 files |
|
424 | 426 | new changesets 96ee1d7354c4 |
|
425 | 427 | |
|
426 | 428 | Stream clone while repo is changing: |
|
427 | 429 | |
|
428 | 430 | $ mkdir changing |
|
429 | 431 | $ cd changing |
|
430 | 432 | |
|
431 | 433 | extension for delaying the server process so we reliably can modify the repo |
|
432 | 434 | while cloning |
|
433 | 435 | |
|
434 | 436 | $ cat > delayer.py <<EOF |
|
435 | 437 | > import time |
|
436 | 438 | > from mercurial import extensions, vfs |
|
437 | 439 | > def __call__(orig, self, path, *args, **kwargs): |
|
438 | 440 | > if path == 'data/f1.i': |
|
439 | 441 | > time.sleep(2) |
|
440 | 442 | > return orig(self, path, *args, **kwargs) |
|
441 | 443 | > extensions.wrapfunction(vfs.vfs, '__call__', __call__) |
|
442 | 444 | > EOF |
|
443 | 445 | |
|
444 | 446 | prepare repo with small and big file to cover both code paths in emitrevlogdata |
|
445 | 447 | |
|
446 | 448 | $ hg init repo |
|
447 | 449 | $ touch repo/f1 |
|
448 | 450 | $ $TESTDIR/seq.py 50000 > repo/f2 |
|
449 | 451 | $ hg -R repo ci -Aqm "0" |
|
450 | 452 | $ hg serve -R repo -p $HGPORT1 -d --pid-file=hg.pid --config extensions.delayer=delayer.py |
|
451 | 453 | $ cat hg.pid >> $DAEMON_PIDS |
|
452 | 454 | |
|
453 | 455 | clone while modifying the repo between stating file with write lock and |
|
454 | 456 | actually serving file content |
|
455 | 457 | |
|
456 | 458 | $ hg clone -q --stream -U http://localhost:$HGPORT1 clone & |
|
457 | 459 | $ sleep 1 |
|
458 | 460 | $ echo >> repo/f1 |
|
459 | 461 | $ echo >> repo/f2 |
|
460 | 462 | $ hg -R repo ci -m "1" --config ui.timeout.warn=-1 |
|
461 | 463 | $ wait |
|
462 | 464 | $ hg -R clone id |
|
463 | 465 | 000000000000 |
|
464 | 466 | $ cd .. |
|
465 | 467 | |
|
466 | 468 | Stream repository with bookmarks |
|
467 | 469 | -------------------------------- |
|
468 | 470 | |
|
469 | 471 | (revert introduction of secret changeset) |
|
470 | 472 | |
|
471 | 473 | $ hg -R server phase --draft 'secret()' |
|
472 | 474 | |
|
473 | 475 | add a bookmark |
|
474 | 476 | |
|
475 | 477 | $ hg -R server bookmark -r tip some-bookmark |
|
476 | 478 | |
|
477 | 479 | clone it |
|
478 | 480 | |
|
479 | 481 | #if stream-legacy |
|
480 | 482 | $ hg clone --stream http://localhost:$HGPORT with-bookmarks |
|
481 | 483 | streaming all changes |
|
482 | 484 | 1027 files to transfer, 96.3 KB of data (no-zstd !) |
|
483 | 485 | transferred 96.3 KB in * seconds (*) (glob) (no-zstd !) |
|
484 | 486 | 1027 files to transfer, 93.5 KB of data (zstd !) |
|
485 | 487 | transferred 93.5 KB in * seconds (* */sec) (glob) (zstd !) |
|
486 | 488 | searching for changes |
|
487 | 489 | no changes found |
|
488 | 490 | updating to branch default |
|
489 | 491 | 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
490 | 492 | #endif |
|
491 | 493 | #if stream-bundle2 |
|
492 | 494 | $ hg clone --stream http://localhost:$HGPORT with-bookmarks |
|
493 | 495 | streaming all changes |
|
494 | 496 | 1033 files to transfer, 96.6 KB of data (no-zstd !) |
|
495 | 497 | transferred 96.6 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
496 | 498 | 1033 files to transfer, 93.8 KB of data (zstd !) |
|
497 | 499 | transferred 93.8 KB in * seconds (* */sec) (glob) (zstd !) |
|
498 | 500 | updating to branch default |
|
499 | 501 | 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
500 | 502 | #endif |
|
501 | 503 | $ hg -R with-bookmarks bookmarks |
|
502 | 504 | some-bookmark 1:c17445101a72 |
|
503 | 505 | |
|
504 | 506 | Stream repository with phases |
|
505 | 507 | ----------------------------- |
|
506 | 508 | |
|
507 | 509 | Clone as publishing |
|
508 | 510 | |
|
509 | 511 | $ hg -R server phase -r 'all()' |
|
510 | 512 | 0: draft |
|
511 | 513 | 1: draft |
|
512 | 514 | |
|
513 | 515 | #if stream-legacy |
|
514 | 516 | $ hg clone --stream http://localhost:$HGPORT phase-publish |
|
515 | 517 | streaming all changes |
|
516 | 518 | 1027 files to transfer, 96.3 KB of data (no-zstd !) |
|
517 | 519 | transferred 96.3 KB in * seconds (*) (glob) (no-zstd !) |
|
518 | 520 | 1027 files to transfer, 93.5 KB of data (zstd !) |
|
519 | 521 | transferred 93.5 KB in * seconds (* */sec) (glob) (zstd !) |
|
520 | 522 | searching for changes |
|
521 | 523 | no changes found |
|
522 | 524 | updating to branch default |
|
523 | 525 | 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
524 | 526 | #endif |
|
525 | 527 | #if stream-bundle2 |
|
526 | 528 | $ hg clone --stream http://localhost:$HGPORT phase-publish |
|
527 | 529 | streaming all changes |
|
528 | 530 | 1033 files to transfer, 96.6 KB of data (no-zstd !) |
|
529 | 531 | transferred 96.6 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
530 | 532 | 1033 files to transfer, 93.8 KB of data (zstd !) |
|
531 | 533 | transferred 93.8 KB in * seconds (* */sec) (glob) (zstd !) |
|
532 | 534 | updating to branch default |
|
533 | 535 | 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
534 | 536 | #endif |
|
535 | 537 | $ hg -R phase-publish phase -r 'all()' |
|
536 | 538 | 0: public |
|
537 | 539 | 1: public |
|
538 | 540 | |
|
539 | 541 | Clone as non publishing |
|
540 | 542 | |
|
541 | 543 | $ cat << EOF >> server/.hg/hgrc |
|
542 | 544 | > [phases] |
|
543 | 545 | > publish = False |
|
544 | 546 | > EOF |
|
545 | 547 | $ killdaemons.py |
|
546 | 548 | $ hg -R server serve -p $HGPORT -d --pid-file=hg.pid |
|
547 | 549 | $ cat hg.pid > $DAEMON_PIDS |
|
548 | 550 | |
|
549 | 551 | #if stream-legacy |
|
550 | 552 | |
|
551 | 553 | With v1 of the stream protocol, changeset are always cloned as public. It make |
|
552 | 554 | stream v1 unsuitable for non-publishing repository. |
|
553 | 555 | |
|
554 | 556 | $ hg clone --stream http://localhost:$HGPORT phase-no-publish |
|
555 | 557 | streaming all changes |
|
556 | 558 | 1027 files to transfer, 96.3 KB of data (no-zstd !) |
|
557 | 559 | transferred 96.3 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
558 | 560 | 1027 files to transfer, 93.5 KB of data (zstd !) |
|
559 | 561 | transferred 93.5 KB in * seconds (* */sec) (glob) (zstd !) |
|
560 | 562 | searching for changes |
|
561 | 563 | no changes found |
|
562 | 564 | updating to branch default |
|
563 | 565 | 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
564 | 566 | $ hg -R phase-no-publish phase -r 'all()' |
|
565 | 567 | 0: public |
|
566 | 568 | 1: public |
|
567 | 569 | #endif |
|
568 | 570 | #if stream-bundle2 |
|
569 | 571 | $ hg clone --stream http://localhost:$HGPORT phase-no-publish |
|
570 | 572 | streaming all changes |
|
571 | 573 | 1034 files to transfer, 96.7 KB of data (no-zstd !) |
|
572 | 574 | transferred 96.7 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
573 | 575 | 1034 files to transfer, 93.9 KB of data (zstd !) |
|
574 | 576 | transferred 93.9 KB in * seconds (* */sec) (glob) (zstd !) |
|
575 | 577 | updating to branch default |
|
576 | 578 | 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
577 | 579 | $ hg -R phase-no-publish phase -r 'all()' |
|
578 | 580 | 0: draft |
|
579 | 581 | 1: draft |
|
580 | 582 | #endif |
|
581 | 583 | |
|
582 | 584 | $ killdaemons.py |
|
583 | 585 | |
|
584 | 586 | #if stream-legacy |
|
585 | 587 | |
|
586 | 588 | With v1 of the stream protocol, changeset are always cloned as public. There's |
|
587 | 589 | no obsolescence markers exchange in stream v1. |
|
588 | 590 | |
|
589 | 591 | #endif |
|
590 | 592 | #if stream-bundle2 |
|
591 | 593 | |
|
592 | 594 | Stream repository with obsolescence |
|
593 | 595 | ----------------------------------- |
|
594 | 596 | |
|
595 | 597 | Clone non-publishing with obsolescence |
|
596 | 598 | |
|
597 | 599 | $ cat >> $HGRCPATH << EOF |
|
598 | 600 | > [experimental] |
|
599 | 601 | > evolution=all |
|
600 | 602 | > EOF |
|
601 | 603 | |
|
602 | 604 | $ cd server |
|
603 | 605 | $ echo foo > foo |
|
604 | 606 | $ hg -q commit -m 'about to be pruned' |
|
605 | 607 | $ hg debugobsolete `hg log -r . -T '{node}'` -d '0 0' -u test --record-parents |
|
606 | 608 | 1 new obsolescence markers |
|
607 | 609 | obsoleted 1 changesets |
|
608 | 610 | $ hg up null -q |
|
609 | 611 | $ hg log -T '{rev}: {phase}\n' |
|
610 | 612 | 1: draft |
|
611 | 613 | 0: draft |
|
612 | 614 | $ hg serve -p $HGPORT -d --pid-file=hg.pid |
|
613 | 615 | $ cat hg.pid > $DAEMON_PIDS |
|
614 | 616 | $ cd .. |
|
615 | 617 | |
|
616 | 618 | $ hg clone -U --stream http://localhost:$HGPORT with-obsolescence |
|
617 | 619 | streaming all changes |
|
618 | 620 | 1035 files to transfer, 97.1 KB of data (no-zstd !) |
|
619 | 621 | transferred 97.1 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
620 | 622 | 1035 files to transfer, 94.3 KB of data (zstd !) |
|
621 | 623 | transferred 94.3 KB in * seconds (* */sec) (glob) (zstd !) |
|
622 | 624 | $ hg -R with-obsolescence log -T '{rev}: {phase}\n' |
|
623 | 625 | 1: draft |
|
624 | 626 | 0: draft |
|
625 | 627 | $ hg debugobsolete -R with-obsolescence |
|
626 | 628 | 50382b884f66690b7045cac93a540cba4d4c906f 0 {c17445101a72edac06facd130d14808dfbd5c7c2} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
627 | 629 | |
|
628 | 630 | $ hg clone -U --stream --config experimental.evolution=0 http://localhost:$HGPORT with-obsolescence-no-evolution |
|
629 | 631 | streaming all changes |
|
630 | 632 | remote: abort: server has obsolescence markers, but client cannot receive them via stream clone |
|
631 | 633 | abort: pull failed on remote |
|
632 | 634 | [100] |
|
633 | 635 | |
|
634 | 636 | $ killdaemons.py |
|
635 | 637 | |
|
636 | 638 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now