comparison tests/test-clone-stream.t @ 51472:749e7685935a

stream-clone-test: simplify the case where server disabled it We have an option to disable it, we don't need to test it with all protocol variants. In addition there is little value in looking at the bytes to bytes details of the reply. Such check is very fragile and consume a lot of time for little value when adjusting formats, caches, and protocol.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 28 Feb 2024 22:01:09 +0100
parents dcaa2df1f688
children a72ab2ec5315
comparison
equal deleted inserted replaced
51469:d54f0692820d 51472:749e7685935a
107 $ hg verify -R local-clone -q 107 $ hg verify -R local-clone -q
108 108
109 Check uncompressed 109 Check uncompressed
110 ================== 110 ==================
111 111
112 Cannot stream clone when server.uncompressed is set 112 Cannot stream clone when server.uncompressed is set to false
113 ------------------------------------------------------------
114
115 When `server.uncompressed` is disabled, the client should fallback to a bundle
116 based clone with a warning.
117
113 118
114 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=stream_out' 119 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=stream_out'
115 200 Script output follows 120 200 Script output follows
116 121
117 1 122 1
118 123
119 #if stream-legacy
120 $ hg debugcapabilities http://localhost:$HGPORT 124 $ hg debugcapabilities http://localhost:$HGPORT
121 Main capabilities: 125 Main capabilities:
122 batch 126 batch
123 branchmap 127 branchmap
124 $USUAL_BUNDLE2_CAPS_SERVER$ 128 $USUAL_BUNDLE2_CAPS_SERVER$
166 adding manifests 170 adding manifests
167 adding file changes 171 adding file changes
168 added 3 changesets with 1088 changes to 1088 files 172 added 3 changesets with 1088 changes to 1088 files
169 new changesets 96ee1d7354c4:5223b5e3265f 173 new changesets 96ee1d7354c4:5223b5e3265f
170 174
171 $ 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%252C03%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"
172 200 Script output follows
173 content-type: application/mercurial-0.2
174
175
176 $ f --size body --hexdump --bytes 100
177 body: size=140
178 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
179 0010: 73 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |s.ERROR:ABORT...|
180 0020: 00 01 01 07 3c 04 16 6d 65 73 73 61 67 65 73 74 |....<..messagest|
181 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques|
182 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d|
183 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th|
184 0060: 69 73 20 66 |is f|
185
186 #endif
187 #if stream-bundle2-v2
188 $ hg debugcapabilities http://localhost:$HGPORT
189 Main capabilities:
190 batch
191 branchmap
192 $USUAL_BUNDLE2_CAPS_SERVER$
193 changegroupsubset
194 compression=$BUNDLE2_COMPRESSIONS$
195 getbundle
196 httpheader=1024
197 httpmediatype=0.1rx,0.1tx,0.2tx
198 known
199 lookup
200 pushkey
201 unbundle=HG10GZ,HG10BZ,HG10UN
202 unbundlehash
203 Bundle2 capabilities:
204 HG20
205 bookmarks
206 changegroup
207 01
208 02
209 03
210 checkheads
211 related
212 digests
213 md5
214 sha1
215 sha512
216 error
217 abort
218 unsupportedcontent
219 pushraced
220 pushkey
221 hgtagsfnodes
222 listkeys
223 phases
224 heads
225 pushkey
226 remote-changegroup
227 http
228 https
229
230 $ hg clone --stream -U http://localhost:$HGPORT server-disabled
231 warning: stream clone requested but server has them disabled
232 requesting all changes
233 adding changesets
234 adding manifests
235 adding file changes
236 added 3 changesets with 1088 changes to 1088 files
237 new changesets 96ee1d7354c4:5223b5e3265f
238
239 $ 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%252C03%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"
240 200 Script output follows
241 content-type: application/mercurial-0.2
242
243
244 $ f --size body --hexdump --bytes 100
245 body: size=140
246 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
247 0010: 73 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |s.ERROR:ABORT...|
248 0020: 00 01 01 07 3c 04 16 6d 65 73 73 61 67 65 73 74 |....<..messagest|
249 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques|
250 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d|
251 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th|
252 0060: 69 73 20 66 |is f|
253
254 #endif
255 #if stream-bundle2-v3
256 $ hg debugcapabilities http://localhost:$HGPORT
257 Main capabilities:
258 batch
259 branchmap
260 $USUAL_BUNDLE2_CAPS_SERVER$
261 changegroupsubset
262 compression=$BUNDLE2_COMPRESSIONS$
263 getbundle
264 httpheader=1024
265 httpmediatype=0.1rx,0.1tx,0.2tx
266 known
267 lookup
268 pushkey
269 unbundle=HG10GZ,HG10BZ,HG10UN
270 unbundlehash
271 Bundle2 capabilities:
272 HG20
273 bookmarks
274 changegroup
275 01
276 02
277 03
278 checkheads
279 related
280 digests
281 md5
282 sha1
283 sha512
284 error
285 abort
286 unsupportedcontent
287 pushraced
288 pushkey
289 hgtagsfnodes
290 listkeys
291 phases
292 heads
293 pushkey
294 remote-changegroup
295 http
296 https
297
298 $ hg clone --stream -U http://localhost:$HGPORT server-disabled
299 warning: stream clone requested but server has them disabled
300 requesting all changes
301 adding changesets
302 adding manifests
303 adding file changes
304 added 3 changesets with 1088 changes to 1088 files
305 new changesets 96ee1d7354c4:5223b5e3265f
306
307 $ 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%252C03%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"
308 200 Script output follows
309 content-type: application/mercurial-0.2
310
311
312 $ f --size body --hexdump --bytes 100
313 body: size=140
314 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
315 0010: 73 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |s.ERROR:ABORT...|
316 0020: 00 01 01 07 3c 04 16 6d 65 73 73 61 67 65 73 74 |....<..messagest|
317 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques|
318 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d|
319 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th|
320 0060: 69 73 20 66 |is f|
321
322 #endif
323
324 $ killdaemons.py 175 $ killdaemons.py
325 $ cd server 176 $ cd server
326 $ hg serve -p $HGPORT -d --pid-file=hg.pid --error errors.txt 177 $ hg serve -p $HGPORT -d --pid-file=hg.pid --error errors.txt
327 $ cat hg.pid > $DAEMON_PIDS 178 $ cat hg.pid > $DAEMON_PIDS
328 $ cd .. 179 $ cd ..