Show More
@@ -1,889 +1,889 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 | |
|
25 | 25 | add files with "tricky" name: |
|
26 | 26 | |
|
27 | 27 | $ echo foo > 00changelog.i |
|
28 | 28 | $ echo foo > 00changelog.d |
|
29 | 29 | $ echo foo > 00changelog.n |
|
30 | 30 | $ echo foo > 00changelog-ab349180a0405010.nd |
|
31 | 31 | $ echo foo > 00manifest.i |
|
32 | 32 | $ echo foo > 00manifest.d |
|
33 | 33 | $ echo foo > foo.i |
|
34 | 34 | $ echo foo > foo.d |
|
35 | 35 | $ echo foo > foo.n |
|
36 | 36 | $ echo foo > undo.py |
|
37 | 37 | $ echo foo > undo.i |
|
38 | 38 | $ echo foo > undo.d |
|
39 | 39 | $ echo foo > undo.n |
|
40 | 40 | $ echo foo > undo.foo.i |
|
41 | 41 | $ echo foo > undo.foo.d |
|
42 | 42 | $ echo foo > undo.foo.n |
|
43 | 43 | $ echo foo > undo.babar |
|
44 | 44 | $ mkdir savanah |
|
45 | 45 | $ echo foo > savanah/foo.i |
|
46 | 46 | $ echo foo > savanah/foo.d |
|
47 | 47 | $ echo foo > savanah/foo.n |
|
48 | 48 | $ echo foo > savanah/undo.py |
|
49 | 49 | $ echo foo > savanah/undo.i |
|
50 | 50 | $ echo foo > savanah/undo.d |
|
51 | 51 | $ echo foo > savanah/undo.n |
|
52 | 52 | $ echo foo > savanah/undo.foo.i |
|
53 | 53 | $ echo foo > savanah/undo.foo.d |
|
54 | 54 | $ echo foo > savanah/undo.foo.n |
|
55 | 55 | $ echo foo > savanah/undo.babar |
|
56 | 56 | $ mkdir data |
|
57 | 57 | $ echo foo > data/foo.i |
|
58 | 58 | $ echo foo > data/foo.d |
|
59 | 59 | $ echo foo > data/foo.n |
|
60 | 60 | $ echo foo > data/undo.py |
|
61 | 61 | $ echo foo > data/undo.i |
|
62 | 62 | $ echo foo > data/undo.d |
|
63 | 63 | $ echo foo > data/undo.n |
|
64 | 64 | $ echo foo > data/undo.foo.i |
|
65 | 65 | $ echo foo > data/undo.foo.d |
|
66 | 66 | $ echo foo > data/undo.foo.n |
|
67 | 67 | $ echo foo > data/undo.babar |
|
68 | 68 | $ mkdir meta |
|
69 | 69 | $ echo foo > meta/foo.i |
|
70 | 70 | $ echo foo > meta/foo.d |
|
71 | 71 | $ echo foo > meta/foo.n |
|
72 | 72 | $ echo foo > meta/undo.py |
|
73 | 73 | $ echo foo > meta/undo.i |
|
74 | 74 | $ echo foo > meta/undo.d |
|
75 | 75 | $ echo foo > meta/undo.n |
|
76 | 76 | $ echo foo > meta/undo.foo.i |
|
77 | 77 | $ echo foo > meta/undo.foo.d |
|
78 | 78 | $ echo foo > meta/undo.foo.n |
|
79 | 79 | $ echo foo > meta/undo.babar |
|
80 | 80 | $ mkdir store |
|
81 | 81 | $ echo foo > store/foo.i |
|
82 | 82 | $ echo foo > store/foo.d |
|
83 | 83 | $ echo foo > store/foo.n |
|
84 | 84 | $ echo foo > store/undo.py |
|
85 | 85 | $ echo foo > store/undo.i |
|
86 | 86 | $ echo foo > store/undo.d |
|
87 | 87 | $ echo foo > store/undo.n |
|
88 | 88 | $ echo foo > store/undo.foo.i |
|
89 | 89 | $ echo foo > store/undo.foo.d |
|
90 | 90 | $ echo foo > store/undo.foo.n |
|
91 | 91 | $ echo foo > store/undo.babar |
|
92 | 92 | |
|
93 | 93 | Name with special characters |
|
94 | 94 | |
|
95 | 95 | $ echo foo > store/CΓ©lesteVille_is_a_Capital_City |
|
96 | 96 | |
|
97 |
A |
|
|
97 | Add all that | |
|
98 | 98 | |
|
99 | 99 | $ hg add . |
|
100 | 100 | adding 00changelog-ab349180a0405010.nd |
|
101 | 101 | adding 00changelog.d |
|
102 | 102 | adding 00changelog.i |
|
103 | 103 | adding 00changelog.n |
|
104 | 104 | adding 00manifest.d |
|
105 | 105 | adding 00manifest.i |
|
106 | 106 | adding data/foo.d |
|
107 | 107 | adding data/foo.i |
|
108 | 108 | adding data/foo.n |
|
109 | 109 | adding data/undo.babar |
|
110 | 110 | adding data/undo.d |
|
111 | 111 | adding data/undo.foo.d |
|
112 | 112 | adding data/undo.foo.i |
|
113 | 113 | adding data/undo.foo.n |
|
114 | 114 | adding data/undo.i |
|
115 | 115 | adding data/undo.n |
|
116 | 116 | adding data/undo.py |
|
117 | 117 | adding foo.d |
|
118 | 118 | adding foo.i |
|
119 | 119 | adding foo.n |
|
120 | 120 | adding meta/foo.d |
|
121 | 121 | adding meta/foo.i |
|
122 | 122 | adding meta/foo.n |
|
123 | 123 | adding meta/undo.babar |
|
124 | 124 | adding meta/undo.d |
|
125 | 125 | adding meta/undo.foo.d |
|
126 | 126 | adding meta/undo.foo.i |
|
127 | 127 | adding meta/undo.foo.n |
|
128 | 128 | adding meta/undo.i |
|
129 | 129 | adding meta/undo.n |
|
130 | 130 | adding meta/undo.py |
|
131 | 131 | adding savanah/foo.d |
|
132 | 132 | adding savanah/foo.i |
|
133 | 133 | adding savanah/foo.n |
|
134 | 134 | adding savanah/undo.babar |
|
135 | 135 | adding savanah/undo.d |
|
136 | 136 | adding savanah/undo.foo.d |
|
137 | 137 | adding savanah/undo.foo.i |
|
138 | 138 | adding savanah/undo.foo.n |
|
139 | 139 | adding savanah/undo.i |
|
140 | 140 | adding savanah/undo.n |
|
141 | 141 | adding savanah/undo.py |
|
142 | 142 | adding store/C\xc3\xa9lesteVille_is_a_Capital_City (esc) |
|
143 | 143 | adding store/foo.d |
|
144 | 144 | adding store/foo.i |
|
145 | 145 | adding store/foo.n |
|
146 | 146 | adding store/undo.babar |
|
147 | 147 | adding store/undo.d |
|
148 | 148 | adding store/undo.foo.d |
|
149 | 149 | adding store/undo.foo.i |
|
150 | 150 | adding store/undo.foo.n |
|
151 | 151 | adding store/undo.i |
|
152 | 152 | adding store/undo.n |
|
153 | 153 | adding store/undo.py |
|
154 | 154 | adding undo.babar |
|
155 | 155 | adding undo.d |
|
156 | 156 | adding undo.foo.d |
|
157 | 157 | adding undo.foo.i |
|
158 | 158 | adding undo.foo.n |
|
159 | 159 | adding undo.i |
|
160 | 160 | adding undo.n |
|
161 | 161 | adding undo.py |
|
162 | 162 | $ hg ci -m 'add files with "tricky" name' |
|
163 | 163 | $ hg --config server.uncompressed=false serve -p $HGPORT -d --pid-file=hg.pid |
|
164 | 164 | $ cat hg.pid > $DAEMON_PIDS |
|
165 | 165 | $ cd .. |
|
166 | 166 | |
|
167 | 167 | Check local clone |
|
168 | 168 | ================== |
|
169 | 169 | |
|
170 | 170 | The logic is close enough of uncompressed. |
|
171 | 171 | This is present here to reuse the testing around file with "special" names. |
|
172 | 172 | |
|
173 | 173 | $ hg clone server local-clone |
|
174 | 174 | updating to branch default |
|
175 | 175 | 1087 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
176 | 176 | |
|
177 | 177 | Check uncompressed |
|
178 | 178 | ================== |
|
179 | 179 | |
|
180 | 180 | Cannot stream clone when server.uncompressed is set |
|
181 | 181 | |
|
182 | 182 | $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=stream_out' |
|
183 | 183 | 200 Script output follows |
|
184 | 184 | |
|
185 | 185 | 1 |
|
186 | 186 | |
|
187 | 187 | #if stream-legacy |
|
188 | 188 | $ hg debugcapabilities http://localhost:$HGPORT |
|
189 | 189 | Main capabilities: |
|
190 | 190 | batch |
|
191 | 191 | branchmap |
|
192 | 192 | $USUAL_BUNDLE2_CAPS_SERVER$ |
|
193 | 193 | changegroupsubset |
|
194 | 194 | compression=$BUNDLE2_COMPRESSIONS$ |
|
195 | 195 | getbundle |
|
196 | 196 | httpheader=1024 |
|
197 | 197 | httpmediatype=0.1rx,0.1tx,0.2tx |
|
198 | 198 | known |
|
199 | 199 | lookup |
|
200 | 200 | pushkey |
|
201 | 201 | unbundle=HG10GZ,HG10BZ,HG10UN |
|
202 | 202 | unbundlehash |
|
203 | 203 | Bundle2 capabilities: |
|
204 | 204 | HG20 |
|
205 | 205 | bookmarks |
|
206 | 206 | changegroup |
|
207 | 207 | 01 |
|
208 | 208 | 02 |
|
209 | 209 | checkheads |
|
210 | 210 | related |
|
211 | 211 | digests |
|
212 | 212 | md5 |
|
213 | 213 | sha1 |
|
214 | 214 | sha512 |
|
215 | 215 | error |
|
216 | 216 | abort |
|
217 | 217 | unsupportedcontent |
|
218 | 218 | pushraced |
|
219 | 219 | pushkey |
|
220 | 220 | hgtagsfnodes |
|
221 | 221 | listkeys |
|
222 | 222 | phases |
|
223 | 223 | heads |
|
224 | 224 | pushkey |
|
225 | 225 | remote-changegroup |
|
226 | 226 | http |
|
227 | 227 | https |
|
228 | 228 | |
|
229 | 229 | $ hg clone --stream -U http://localhost:$HGPORT server-disabled |
|
230 | 230 | warning: stream clone requested but server has them disabled |
|
231 | 231 | requesting all changes |
|
232 | 232 | adding changesets |
|
233 | 233 | adding manifests |
|
234 | 234 | adding file changes |
|
235 | 235 | added 3 changesets with 1087 changes to 1087 files |
|
236 | 236 | new changesets 96ee1d7354c4:42e820400e84 |
|
237 | 237 | |
|
238 | 238 | $ 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" |
|
239 | 239 | 200 Script output follows |
|
240 | 240 | content-type: application/mercurial-0.2 |
|
241 | 241 | |
|
242 | 242 | |
|
243 | 243 | $ f --size body --hexdump --bytes 100 |
|
244 | 244 | body: size=232 |
|
245 | 245 | 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......| |
|
246 | 246 | 0010: cf 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |..ERROR:ABORT...| |
|
247 | 247 | 0020: 00 01 01 07 3c 04 72 6d 65 73 73 61 67 65 73 74 |....<.rmessagest| |
|
248 | 248 | 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques| |
|
249 | 249 | 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d| |
|
250 | 250 | 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th| |
|
251 | 251 | 0060: 69 73 20 66 |is f| |
|
252 | 252 | |
|
253 | 253 | #endif |
|
254 | 254 | #if stream-bundle2 |
|
255 | 255 | $ hg debugcapabilities http://localhost:$HGPORT |
|
256 | 256 | Main capabilities: |
|
257 | 257 | batch |
|
258 | 258 | branchmap |
|
259 | 259 | $USUAL_BUNDLE2_CAPS_SERVER$ |
|
260 | 260 | changegroupsubset |
|
261 | 261 | compression=$BUNDLE2_COMPRESSIONS$ |
|
262 | 262 | getbundle |
|
263 | 263 | httpheader=1024 |
|
264 | 264 | httpmediatype=0.1rx,0.1tx,0.2tx |
|
265 | 265 | known |
|
266 | 266 | lookup |
|
267 | 267 | pushkey |
|
268 | 268 | unbundle=HG10GZ,HG10BZ,HG10UN |
|
269 | 269 | unbundlehash |
|
270 | 270 | Bundle2 capabilities: |
|
271 | 271 | HG20 |
|
272 | 272 | bookmarks |
|
273 | 273 | changegroup |
|
274 | 274 | 01 |
|
275 | 275 | 02 |
|
276 | 276 | checkheads |
|
277 | 277 | related |
|
278 | 278 | digests |
|
279 | 279 | md5 |
|
280 | 280 | sha1 |
|
281 | 281 | sha512 |
|
282 | 282 | error |
|
283 | 283 | abort |
|
284 | 284 | unsupportedcontent |
|
285 | 285 | pushraced |
|
286 | 286 | pushkey |
|
287 | 287 | hgtagsfnodes |
|
288 | 288 | listkeys |
|
289 | 289 | phases |
|
290 | 290 | heads |
|
291 | 291 | pushkey |
|
292 | 292 | remote-changegroup |
|
293 | 293 | http |
|
294 | 294 | https |
|
295 | 295 | |
|
296 | 296 | $ hg clone --stream -U http://localhost:$HGPORT server-disabled |
|
297 | 297 | warning: stream clone requested but server has them disabled |
|
298 | 298 | requesting all changes |
|
299 | 299 | adding changesets |
|
300 | 300 | adding manifests |
|
301 | 301 | adding file changes |
|
302 | 302 | added 3 changesets with 1087 changes to 1087 files |
|
303 | 303 | new changesets 96ee1d7354c4:42e820400e84 |
|
304 | 304 | |
|
305 | 305 | $ 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" |
|
306 | 306 | 200 Script output follows |
|
307 | 307 | content-type: application/mercurial-0.2 |
|
308 | 308 | |
|
309 | 309 | |
|
310 | 310 | $ f --size body --hexdump --bytes 100 |
|
311 | 311 | body: size=232 |
|
312 | 312 | 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......| |
|
313 | 313 | 0010: cf 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |..ERROR:ABORT...| |
|
314 | 314 | 0020: 00 01 01 07 3c 04 72 6d 65 73 73 61 67 65 73 74 |....<.rmessagest| |
|
315 | 315 | 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques| |
|
316 | 316 | 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d| |
|
317 | 317 | 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th| |
|
318 | 318 | 0060: 69 73 20 66 |is f| |
|
319 | 319 | |
|
320 | 320 | #endif |
|
321 | 321 | |
|
322 | 322 | $ killdaemons.py |
|
323 | 323 | $ cd server |
|
324 | 324 | $ hg serve -p $HGPORT -d --pid-file=hg.pid --error errors.txt |
|
325 | 325 | $ cat hg.pid > $DAEMON_PIDS |
|
326 | 326 | $ cd .. |
|
327 | 327 | |
|
328 | 328 | Basic clone |
|
329 | 329 | |
|
330 | 330 | #if stream-legacy |
|
331 | 331 | $ hg clone --stream -U http://localhost:$HGPORT clone1 |
|
332 | 332 | streaming all changes |
|
333 | 333 | 1089 files to transfer, 101 KB of data (no-zstd !) |
|
334 | 334 | transferred 101 KB in * seconds (*/sec) (glob) (no-zstd !) |
|
335 | 335 | 1089 files to transfer, 98.5 KB of data (zstd !) |
|
336 | 336 | transferred 98.5 KB in * seconds (*/sec) (glob) (zstd !) |
|
337 | 337 | searching for changes |
|
338 | 338 | no changes found |
|
339 | 339 | $ cat server/errors.txt |
|
340 | 340 | #endif |
|
341 | 341 | #if stream-bundle2 |
|
342 | 342 | $ hg clone --stream -U http://localhost:$HGPORT clone1 |
|
343 | 343 | streaming all changes |
|
344 | 344 | 1092 files to transfer, 101 KB of data (no-zstd !) |
|
345 | 345 | transferred 101 KB in * seconds (*/sec) (glob) (no-zstd !) |
|
346 | 346 | 1092 files to transfer, 98.6 KB of data (zstd !) |
|
347 | 347 | transferred 98.6 KB in * seconds (* */sec) (glob) (zstd !) |
|
348 | 348 | |
|
349 | 349 | $ ls -1 clone1/.hg/cache |
|
350 | 350 | branch2-base |
|
351 | 351 | branch2-immutable |
|
352 | 352 | branch2-served |
|
353 | 353 | branch2-served.hidden |
|
354 | 354 | branch2-visible |
|
355 | 355 | branch2-visible-hidden |
|
356 | 356 | rbc-names-v1 |
|
357 | 357 | rbc-revs-v1 |
|
358 | 358 | tags2 |
|
359 | 359 | tags2-served |
|
360 | 360 | $ cat server/errors.txt |
|
361 | 361 | #endif |
|
362 | 362 | |
|
363 | 363 | getbundle requests with stream=1 are uncompressed |
|
364 | 364 | |
|
365 | 365 | $ 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" |
|
366 | 366 | 200 Script output follows |
|
367 | 367 | content-type: application/mercurial-0.2 |
|
368 | 368 | |
|
369 | 369 | |
|
370 | 370 | #if no-zstd no-rust |
|
371 | 371 | $ f --size --hex --bytes 256 body |
|
372 | 372 | body: size=118737 |
|
373 | 373 | 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......| |
|
374 | 374 | 0010: 80 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |..STREAM2.......| |
|
375 | 375 | 0020: 06 09 04 0c 44 62 79 74 65 63 6f 75 6e 74 31 30 |....Dbytecount10| |
|
376 | 376 | 0030: 33 38 33 34 66 69 6c 65 63 6f 75 6e 74 31 30 39 |3834filecount109| |
|
377 | 377 | 0040: 32 72 65 71 75 69 72 65 6d 65 6e 74 73 64 6f 74 |2requirementsdot| |
|
378 | 378 | 0050: 65 6e 63 6f 64 65 25 32 43 66 6e 63 61 63 68 65 |encode%2Cfncache| |
|
379 | 379 | 0060: 25 32 43 67 65 6e 65 72 61 6c 64 65 6c 74 61 25 |%2Cgeneraldelta%| |
|
380 | 380 | 0070: 32 43 72 65 76 6c 6f 67 76 31 25 32 43 73 70 61 |2Crevlogv1%2Cspa| |
|
381 | 381 | 0080: 72 73 65 72 65 76 6c 6f 67 25 32 43 73 74 6f 72 |rserevlog%2Cstor| |
|
382 | 382 | 0090: 65 00 00 80 00 73 08 42 64 61 74 61 2f 30 2e 69 |e....s.Bdata/0.i| |
|
383 | 383 | 00a0: 00 03 00 01 00 00 00 00 00 00 00 02 00 00 00 01 |................| |
|
384 | 384 | 00b0: 00 00 00 00 00 00 00 01 ff ff ff ff ff ff ff ff |................| |
|
385 | 385 | 00c0: 80 29 63 a0 49 d3 23 87 bf ce fe 56 67 92 67 2c |.)c.I.#....Vg.g,| |
|
386 | 386 | 00d0: 69 d1 ec 39 00 00 00 00 00 00 00 00 00 00 00 00 |i..9............| |
|
387 | 387 | 00e0: 75 30 73 26 45 64 61 74 61 2f 30 30 63 68 61 6e |u0s&Edata/00chan| |
|
388 | 388 | 00f0: 67 65 6c 6f 67 2d 61 62 33 34 39 31 38 30 61 30 |gelog-ab349180a0| |
|
389 | 389 | #endif |
|
390 | 390 | #if zstd no-rust |
|
391 | 391 | $ f --size --hex --bytes 256 body |
|
392 | 392 | body: size=115921 |
|
393 | 393 | 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......| |
|
394 | 394 | 0010: 9a 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |..STREAM2.......| |
|
395 | 395 | 0020: 06 09 04 0c 5e 62 79 74 65 63 6f 75 6e 74 31 30 |....^bytecount10| |
|
396 | 396 | 0030: 30 39 39 32 66 69 6c 65 63 6f 75 6e 74 31 30 39 |0992filecount109| |
|
397 | 397 | 0040: 32 72 65 71 75 69 72 65 6d 65 6e 74 73 64 6f 74 |2requirementsdot| |
|
398 | 398 | 0050: 65 6e 63 6f 64 65 25 32 43 66 6e 63 61 63 68 65 |encode%2Cfncache| |
|
399 | 399 | 0060: 25 32 43 67 65 6e 65 72 61 6c 64 65 6c 74 61 25 |%2Cgeneraldelta%| |
|
400 | 400 | 0070: 32 43 72 65 76 6c 6f 67 2d 63 6f 6d 70 72 65 73 |2Crevlog-compres| |
|
401 | 401 | 0080: 73 69 6f 6e 2d 7a 73 74 64 25 32 43 72 65 76 6c |sion-zstd%2Crevl| |
|
402 | 402 | 0090: 6f 67 76 31 25 32 43 73 70 61 72 73 65 72 65 76 |ogv1%2Csparserev| |
|
403 | 403 | 00a0: 6c 6f 67 25 32 43 73 74 6f 72 65 00 00 80 00 73 |log%2Cstore....s| |
|
404 | 404 | 00b0: 08 42 64 61 74 61 2f 30 2e 69 00 03 00 01 00 00 |.Bdata/0.i......| |
|
405 | 405 | 00c0: 00 00 00 00 00 02 00 00 00 01 00 00 00 00 00 00 |................| |
|
406 | 406 | 00d0: 00 01 ff ff ff ff ff ff ff ff 80 29 63 a0 49 d3 |...........)c.I.| |
|
407 | 407 | 00e0: 23 87 bf ce fe 56 67 92 67 2c 69 d1 ec 39 00 00 |#....Vg.g,i..9..| |
|
408 | 408 | 00f0: 00 00 00 00 00 00 00 00 00 00 75 30 73 26 45 64 |..........u0s&Ed| |
|
409 | 409 | #endif |
|
410 | 410 | #if zstd rust no-dirstate-v2 |
|
411 | 411 | $ f --size --hex --bytes 256 body |
|
412 | 412 | body: size=115942 |
|
413 | 413 | 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......| |
|
414 | 414 | 0010: af 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |..STREAM2.......| |
|
415 | 415 | 0020: 06 09 04 0c 73 62 79 74 65 63 6f 75 6e 74 31 30 |....sbytecount10| |
|
416 | 416 | 0030: 30 39 39 32 66 69 6c 65 63 6f 75 6e 74 31 30 39 |0992filecount109| |
|
417 | 417 | 0040: 32 72 65 71 75 69 72 65 6d 65 6e 74 73 64 6f 74 |2requirementsdot| |
|
418 | 418 | 0050: 65 6e 63 6f 64 65 25 32 43 66 6e 63 61 63 68 65 |encode%2Cfncache| |
|
419 | 419 | 0060: 25 32 43 67 65 6e 65 72 61 6c 64 65 6c 74 61 25 |%2Cgeneraldelta%| |
|
420 | 420 | 0070: 32 43 70 65 72 73 69 73 74 65 6e 74 2d 6e 6f 64 |2Cpersistent-nod| |
|
421 | 421 | 0080: 65 6d 61 70 25 32 43 72 65 76 6c 6f 67 2d 63 6f |emap%2Crevlog-co| |
|
422 | 422 | 0090: 6d 70 72 65 73 73 69 6f 6e 2d 7a 73 74 64 25 32 |mpression-zstd%2| |
|
423 | 423 | 00a0: 43 72 65 76 6c 6f 67 76 31 25 32 43 73 70 61 72 |Crevlogv1%2Cspar| |
|
424 | 424 | 00b0: 73 65 72 65 76 6c 6f 67 25 32 43 73 74 6f 72 65 |serevlog%2Cstore| |
|
425 | 425 | 00c0: 00 00 80 00 73 08 42 64 61 74 61 2f 30 2e 69 00 |....s.Bdata/0.i.| |
|
426 | 426 | 00d0: 03 00 01 00 00 00 00 00 00 00 02 00 00 00 01 00 |................| |
|
427 | 427 | 00e0: 00 00 00 00 00 00 01 ff ff ff ff ff ff ff ff 80 |................| |
|
428 | 428 | 00f0: 29 63 a0 49 d3 23 87 bf ce fe 56 67 92 67 2c 69 |)c.I.#....Vg.g,i| |
|
429 | 429 | #endif |
|
430 | 430 | #if zstd dirstate-v2 |
|
431 | 431 | $ f --size --hex --bytes 256 body |
|
432 | 432 | body: size=109549 |
|
433 | 433 | 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......| |
|
434 | 434 | 0010: c0 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |..STREAM2.......| |
|
435 | 435 | 0020: 05 09 04 0c 85 62 79 74 65 63 6f 75 6e 74 39 35 |.....bytecount95| |
|
436 | 436 | 0030: 38 39 37 66 69 6c 65 63 6f 75 6e 74 31 30 33 30 |897filecount1030| |
|
437 | 437 | 0040: 72 65 71 75 69 72 65 6d 65 6e 74 73 64 6f 74 65 |requirementsdote| |
|
438 | 438 | 0050: 6e 63 6f 64 65 25 32 43 65 78 70 2d 64 69 72 73 |ncode%2Cexp-dirs| |
|
439 | 439 | 0060: 74 61 74 65 2d 76 32 25 32 43 66 6e 63 61 63 68 |tate-v2%2Cfncach| |
|
440 | 440 | 0070: 65 25 32 43 67 65 6e 65 72 61 6c 64 65 6c 74 61 |e%2Cgeneraldelta| |
|
441 | 441 | 0080: 25 32 43 70 65 72 73 69 73 74 65 6e 74 2d 6e 6f |%2Cpersistent-no| |
|
442 | 442 | 0090: 64 65 6d 61 70 25 32 43 72 65 76 6c 6f 67 2d 63 |demap%2Crevlog-c| |
|
443 | 443 | 00a0: 6f 6d 70 72 65 73 73 69 6f 6e 2d 7a 73 74 64 25 |ompression-zstd%| |
|
444 | 444 | 00b0: 32 43 72 65 76 6c 6f 67 76 31 25 32 43 73 70 61 |2Crevlogv1%2Cspa| |
|
445 | 445 | 00c0: 72 73 65 72 65 76 6c 6f 67 25 32 43 73 74 6f 72 |rserevlog%2Cstor| |
|
446 | 446 | 00d0: 65 00 00 80 00 73 08 42 64 61 74 61 2f 30 2e 69 |e....s.Bdata/0.i| |
|
447 | 447 | 00e0: 00 03 00 01 00 00 00 00 00 00 00 02 00 00 00 01 |................| |
|
448 | 448 | 00f0: 00 00 00 00 00 00 00 01 ff ff ff ff ff ff ff ff |................| |
|
449 | 449 | #endif |
|
450 | 450 | |
|
451 | 451 | --uncompressed is an alias to --stream |
|
452 | 452 | |
|
453 | 453 | #if stream-legacy |
|
454 | 454 | $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed |
|
455 | 455 | streaming all changes |
|
456 | 456 | 1089 files to transfer, 101 KB of data (no-zstd !) |
|
457 | 457 | transferred 101 KB in * seconds (*/sec) (glob) (no-zstd !) |
|
458 | 458 | 1089 files to transfer, 98.5 KB of data (zstd !) |
|
459 | 459 | transferred 98.5 KB in * seconds (*/sec) (glob) (zstd !) |
|
460 | 460 | searching for changes |
|
461 | 461 | no changes found |
|
462 | 462 | #endif |
|
463 | 463 | #if stream-bundle2 |
|
464 | 464 | $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed |
|
465 | 465 | streaming all changes |
|
466 | 466 | 1092 files to transfer, 101 KB of data (no-zstd !) |
|
467 | 467 | transferred 101 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
468 | 468 | 1092 files to transfer, 98.6 KB of data (zstd !) |
|
469 | 469 | transferred 98.6 KB in * seconds (* */sec) (glob) (zstd !) |
|
470 | 470 | #endif |
|
471 | 471 | |
|
472 | 472 | Clone with background file closing enabled |
|
473 | 473 | |
|
474 | 474 | #if stream-legacy |
|
475 | 475 | $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding |
|
476 | 476 | using http://localhost:$HGPORT/ |
|
477 | 477 | sending capabilities command |
|
478 | 478 | sending branchmap command |
|
479 | 479 | streaming all changes |
|
480 | 480 | sending stream_out command |
|
481 | 481 | 1089 files to transfer, 101 KB of data (no-zstd !) |
|
482 | 482 | 1089 files to transfer, 98.5 KB of data (zstd !) |
|
483 | 483 | starting 4 threads for background file closing |
|
484 | 484 | updating the branch cache |
|
485 | 485 | transferred 101 KB in * seconds (*/sec) (glob) (no-zstd !) |
|
486 | 486 | transferred 98.5 KB in * seconds (*/sec) (glob) (zstd !) |
|
487 | 487 | query 1; heads |
|
488 | 488 | sending batch command |
|
489 | 489 | searching for changes |
|
490 | 490 | all remote heads known locally |
|
491 | 491 | no changes found |
|
492 | 492 | sending getbundle command |
|
493 | 493 | bundle2-input-bundle: with-transaction |
|
494 | 494 | bundle2-input-part: "listkeys" (params: 1 mandatory) supported |
|
495 | 495 | bundle2-input-part: "phase-heads" supported |
|
496 | 496 | bundle2-input-part: total payload size 24 |
|
497 | 497 | bundle2-input-bundle: 2 parts total |
|
498 | 498 | checking for updated bookmarks |
|
499 | 499 | updating the branch cache |
|
500 | 500 | (sent 5 HTTP requests and * bytes; received * bytes in responses) (glob) |
|
501 | 501 | #endif |
|
502 | 502 | #if stream-bundle2 |
|
503 | 503 | $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding |
|
504 | 504 | using http://localhost:$HGPORT/ |
|
505 | 505 | sending capabilities command |
|
506 | 506 | query 1; heads |
|
507 | 507 | sending batch command |
|
508 | 508 | streaming all changes |
|
509 | 509 | sending getbundle command |
|
510 | 510 | bundle2-input-bundle: with-transaction |
|
511 | 511 | bundle2-input-part: "stream2" (params: 3 mandatory) supported |
|
512 | 512 | applying stream bundle |
|
513 | 513 | 1092 files to transfer, 101 KB of data (no-zstd !) |
|
514 | 514 | 1092 files to transfer, 98.6 KB of data (zstd !) |
|
515 | 515 | starting 4 threads for background file closing |
|
516 | 516 | starting 4 threads for background file closing |
|
517 | 517 | updating the branch cache |
|
518 | 518 | transferred 101 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
519 | 519 | bundle2-input-part: total payload size 118568 (no-zstd !) |
|
520 | 520 | transferred 98.6 KB in * seconds (* */sec) (glob) (zstd !) |
|
521 | 521 | bundle2-input-part: total payload size 115726 (zstd !) |
|
522 | 522 | bundle2-input-part: "listkeys" (params: 1 mandatory) supported |
|
523 | 523 | bundle2-input-bundle: 2 parts total |
|
524 | 524 | checking for updated bookmarks |
|
525 | 525 | updating the branch cache |
|
526 | 526 | (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob) |
|
527 | 527 | #endif |
|
528 | 528 | |
|
529 | 529 | Cannot stream clone when there are secret changesets |
|
530 | 530 | |
|
531 | 531 | $ hg -R server phase --force --secret -r tip |
|
532 | 532 | $ hg clone --stream -U http://localhost:$HGPORT secret-denied |
|
533 | 533 | warning: stream clone requested but server has them disabled |
|
534 | 534 | requesting all changes |
|
535 | 535 | adding changesets |
|
536 | 536 | adding manifests |
|
537 | 537 | adding file changes |
|
538 | 538 | added 2 changesets with 1025 changes to 1025 files |
|
539 | 539 | new changesets 96ee1d7354c4:c17445101a72 |
|
540 | 540 | |
|
541 | 541 | $ killdaemons.py |
|
542 | 542 | |
|
543 | 543 | Streaming of secrets can be overridden by server config |
|
544 | 544 | |
|
545 | 545 | $ cd server |
|
546 | 546 | $ hg serve --config server.uncompressedallowsecret=true -p $HGPORT -d --pid-file=hg.pid |
|
547 | 547 | $ cat hg.pid > $DAEMON_PIDS |
|
548 | 548 | $ cd .. |
|
549 | 549 | |
|
550 | 550 | #if stream-legacy |
|
551 | 551 | $ hg clone --stream -U http://localhost:$HGPORT secret-allowed |
|
552 | 552 | streaming all changes |
|
553 | 553 | 1089 files to transfer, 101 KB of data (no-zstd !) |
|
554 | 554 | transferred 101 KB in * seconds (*/sec) (glob) (no-zstd !) |
|
555 | 555 | 1089 files to transfer, 98.5 KB of data (zstd !) |
|
556 | 556 | transferred 98.5 KB in * seconds (*/sec) (glob) (zstd !) |
|
557 | 557 | searching for changes |
|
558 | 558 | no changes found |
|
559 | 559 | #endif |
|
560 | 560 | #if stream-bundle2 |
|
561 | 561 | $ hg clone --stream -U http://localhost:$HGPORT secret-allowed |
|
562 | 562 | streaming all changes |
|
563 | 563 | 1092 files to transfer, 101 KB of data (no-zstd !) |
|
564 | 564 | transferred 101 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
565 | 565 | 1092 files to transfer, 98.6 KB of data (zstd !) |
|
566 | 566 | transferred 98.6 KB in * seconds (* */sec) (glob) (zstd !) |
|
567 | 567 | #endif |
|
568 | 568 | |
|
569 | 569 | $ killdaemons.py |
|
570 | 570 | |
|
571 | 571 | Verify interaction between preferuncompressed and secret presence |
|
572 | 572 | |
|
573 | 573 | $ cd server |
|
574 | 574 | $ hg serve --config server.preferuncompressed=true -p $HGPORT -d --pid-file=hg.pid |
|
575 | 575 | $ cat hg.pid > $DAEMON_PIDS |
|
576 | 576 | $ cd .. |
|
577 | 577 | |
|
578 | 578 | $ hg clone -U http://localhost:$HGPORT preferuncompressed-secret |
|
579 | 579 | requesting all changes |
|
580 | 580 | adding changesets |
|
581 | 581 | adding manifests |
|
582 | 582 | adding file changes |
|
583 | 583 | added 2 changesets with 1025 changes to 1025 files |
|
584 | 584 | new changesets 96ee1d7354c4:c17445101a72 |
|
585 | 585 | |
|
586 | 586 | $ killdaemons.py |
|
587 | 587 | |
|
588 | 588 | Clone not allowed when full bundles disabled and can't serve secrets |
|
589 | 589 | |
|
590 | 590 | $ cd server |
|
591 | 591 | $ hg serve --config server.disablefullbundle=true -p $HGPORT -d --pid-file=hg.pid |
|
592 | 592 | $ cat hg.pid > $DAEMON_PIDS |
|
593 | 593 | $ cd .. |
|
594 | 594 | |
|
595 | 595 | $ hg clone --stream http://localhost:$HGPORT secret-full-disabled |
|
596 | 596 | warning: stream clone requested but server has them disabled |
|
597 | 597 | requesting all changes |
|
598 | 598 | remote: abort: server has pull-based clones disabled |
|
599 | 599 | abort: pull failed on remote |
|
600 | 600 | (remove --pull if specified or upgrade Mercurial) |
|
601 | 601 | [100] |
|
602 | 602 | |
|
603 | 603 | Local stream clone with secrets involved |
|
604 | 604 | (This is just a test over behavior: if you have access to the repo's files, |
|
605 | 605 | there is no security so it isn't important to prevent a clone here.) |
|
606 | 606 | |
|
607 | 607 | $ hg clone -U --stream server local-secret |
|
608 | 608 | warning: stream clone requested but server has them disabled |
|
609 | 609 | requesting all changes |
|
610 | 610 | adding changesets |
|
611 | 611 | adding manifests |
|
612 | 612 | adding file changes |
|
613 | 613 | added 2 changesets with 1025 changes to 1025 files |
|
614 | 614 | new changesets 96ee1d7354c4:c17445101a72 |
|
615 | 615 | |
|
616 | 616 | Stream clone while repo is changing: |
|
617 | 617 | |
|
618 | 618 | $ mkdir changing |
|
619 | 619 | $ cd changing |
|
620 | 620 | |
|
621 | 621 | extension for delaying the server process so we reliably can modify the repo |
|
622 | 622 | while cloning |
|
623 | 623 | |
|
624 | 624 | $ cat > stream_steps.py <<EOF |
|
625 | 625 | > import os |
|
626 | 626 | > import sys |
|
627 | 627 | > from mercurial import ( |
|
628 | 628 | > encoding, |
|
629 | 629 | > extensions, |
|
630 | 630 | > streamclone, |
|
631 | 631 | > testing, |
|
632 | 632 | > ) |
|
633 | 633 | > WALKED_FILE_1 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_1'] |
|
634 | 634 | > WALKED_FILE_2 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_2'] |
|
635 | 635 | > |
|
636 | 636 | > def _test_sync_point_walk_1(orig, repo): |
|
637 | 637 | > testing.write_file(WALKED_FILE_1) |
|
638 | 638 | > |
|
639 | 639 | > def _test_sync_point_walk_2(orig, repo): |
|
640 | 640 | > assert repo._currentlock(repo._lockref) is None |
|
641 | 641 | > testing.wait_file(WALKED_FILE_2) |
|
642 | 642 | > |
|
643 | 643 | > extensions.wrapfunction( |
|
644 | 644 | > streamclone, |
|
645 | 645 | > '_test_sync_point_walk_1', |
|
646 | 646 | > _test_sync_point_walk_1 |
|
647 | 647 | > ) |
|
648 | 648 | > extensions.wrapfunction( |
|
649 | 649 | > streamclone, |
|
650 | 650 | > '_test_sync_point_walk_2', |
|
651 | 651 | > _test_sync_point_walk_2 |
|
652 | 652 | > ) |
|
653 | 653 | > EOF |
|
654 | 654 | |
|
655 | 655 | prepare repo with small and big file to cover both code paths in emitrevlogdata |
|
656 | 656 | |
|
657 | 657 | $ hg init repo |
|
658 | 658 | $ touch repo/f1 |
|
659 | 659 | $ $TESTDIR/seq.py 50000 > repo/f2 |
|
660 | 660 | $ hg -R repo ci -Aqm "0" |
|
661 | 661 | $ HG_TEST_STREAM_WALKED_FILE_1="$TESTTMP/sync_file_walked_1" |
|
662 | 662 | $ export HG_TEST_STREAM_WALKED_FILE_1 |
|
663 | 663 | $ HG_TEST_STREAM_WALKED_FILE_2="$TESTTMP/sync_file_walked_2" |
|
664 | 664 | $ export HG_TEST_STREAM_WALKED_FILE_2 |
|
665 | 665 | $ HG_TEST_STREAM_WALKED_FILE_3="$TESTTMP/sync_file_walked_3" |
|
666 | 666 | $ export HG_TEST_STREAM_WALKED_FILE_3 |
|
667 | 667 | # $ cat << EOF >> $HGRCPATH |
|
668 | 668 | # > [hooks] |
|
669 | 669 | # > pre-clone=rm -f "$TESTTMP/sync_file_walked_*" |
|
670 | 670 | # > EOF |
|
671 | 671 | $ hg serve -R repo -p $HGPORT1 -d --error errors.log --pid-file=hg.pid --config extensions.stream_steps="$RUNTESTDIR/testlib/ext-stream-clone-steps.py" |
|
672 | 672 | $ cat hg.pid >> $DAEMON_PIDS |
|
673 | 673 | |
|
674 | 674 | clone while modifying the repo between stating file with write lock and |
|
675 | 675 | actually serving file content |
|
676 | 676 | |
|
677 | 677 | $ (hg clone -q --stream -U http://localhost:$HGPORT1 clone; touch "$HG_TEST_STREAM_WALKED_FILE_3") & |
|
678 | 678 | $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_1 |
|
679 | 679 | $ echo >> repo/f1 |
|
680 | 680 | $ echo >> repo/f2 |
|
681 | 681 | $ hg -R repo ci -m "1" --config ui.timeout.warn=-1 |
|
682 | 682 | $ touch $HG_TEST_STREAM_WALKED_FILE_2 |
|
683 | 683 | $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_3 |
|
684 | 684 | $ hg -R clone id |
|
685 | 685 | 000000000000 |
|
686 | 686 | $ cat errors.log |
|
687 | 687 | $ cd .. |
|
688 | 688 | |
|
689 | 689 | Stream repository with bookmarks |
|
690 | 690 | -------------------------------- |
|
691 | 691 | |
|
692 | 692 | (revert introduction of secret changeset) |
|
693 | 693 | |
|
694 | 694 | $ hg -R server phase --draft 'secret()' |
|
695 | 695 | |
|
696 | 696 | add a bookmark |
|
697 | 697 | |
|
698 | 698 | $ hg -R server bookmark -r tip some-bookmark |
|
699 | 699 | |
|
700 | 700 | clone it |
|
701 | 701 | |
|
702 | 702 | #if stream-legacy |
|
703 | 703 | $ hg clone --stream http://localhost:$HGPORT with-bookmarks |
|
704 | 704 | streaming all changes |
|
705 | 705 | 1089 files to transfer, 101 KB of data (no-zstd !) |
|
706 | 706 | transferred 101 KB in * seconds (*) (glob) (no-zstd !) |
|
707 | 707 | 1089 files to transfer, 98.5 KB of data (zstd !) |
|
708 | 708 | transferred 98.5 KB in * seconds (*/sec) (glob) (zstd !) |
|
709 | 709 | searching for changes |
|
710 | 710 | no changes found |
|
711 | 711 | updating to branch default |
|
712 | 712 | 1087 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
713 | 713 | #endif |
|
714 | 714 | #if stream-bundle2 |
|
715 | 715 | $ hg clone --stream http://localhost:$HGPORT with-bookmarks |
|
716 | 716 | streaming all changes |
|
717 | 717 | 1095 files to transfer, 102 KB of data (no-zstd !) |
|
718 | 718 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
719 | 719 | 1095 files to transfer, 98.8 KB of data (zstd !) |
|
720 | 720 | transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !) |
|
721 | 721 | updating to branch default |
|
722 | 722 | 1087 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
723 | 723 | #endif |
|
724 | 724 | $ hg verify -R with-bookmarks |
|
725 | 725 | checking changesets |
|
726 | 726 | checking manifests |
|
727 | 727 | crosschecking files in changesets and manifests |
|
728 | 728 | checking files |
|
729 | 729 | checked 3 changesets with 1087 changes to 1087 files |
|
730 | 730 | $ hg -R with-bookmarks bookmarks |
|
731 | 731 | some-bookmark 2:42e820400e84 |
|
732 | 732 | |
|
733 | 733 | Stream repository with phases |
|
734 | 734 | ----------------------------- |
|
735 | 735 | |
|
736 | 736 | Clone as publishing |
|
737 | 737 | |
|
738 | 738 | $ hg -R server phase -r 'all()' |
|
739 | 739 | 0: draft |
|
740 | 740 | 1: draft |
|
741 | 741 | 2: draft |
|
742 | 742 | |
|
743 | 743 | #if stream-legacy |
|
744 | 744 | $ hg clone --stream http://localhost:$HGPORT phase-publish |
|
745 | 745 | streaming all changes |
|
746 | 746 | 1089 files to transfer, 101 KB of data (no-zstd !) |
|
747 | 747 | transferred 101 KB in * seconds (*) (glob) (no-zstd !) |
|
748 | 748 | 1089 files to transfer, 98.5 KB of data (zstd !) |
|
749 | 749 | transferred 98.5 KB in * seconds (*/sec) (glob) (zstd !) |
|
750 | 750 | searching for changes |
|
751 | 751 | no changes found |
|
752 | 752 | updating to branch default |
|
753 | 753 | 1087 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
754 | 754 | #endif |
|
755 | 755 | #if stream-bundle2 |
|
756 | 756 | $ hg clone --stream http://localhost:$HGPORT phase-publish |
|
757 | 757 | streaming all changes |
|
758 | 758 | 1095 files to transfer, 102 KB of data (no-zstd !) |
|
759 | 759 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
760 | 760 | 1095 files to transfer, 98.8 KB of data (zstd !) |
|
761 | 761 | transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !) |
|
762 | 762 | updating to branch default |
|
763 | 763 | 1087 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
764 | 764 | #endif |
|
765 | 765 | $ hg verify -R phase-publish |
|
766 | 766 | checking changesets |
|
767 | 767 | checking manifests |
|
768 | 768 | crosschecking files in changesets and manifests |
|
769 | 769 | checking files |
|
770 | 770 | checked 3 changesets with 1087 changes to 1087 files |
|
771 | 771 | $ hg -R phase-publish phase -r 'all()' |
|
772 | 772 | 0: public |
|
773 | 773 | 1: public |
|
774 | 774 | 2: public |
|
775 | 775 | |
|
776 | 776 | Clone as non publishing |
|
777 | 777 | |
|
778 | 778 | $ cat << EOF >> server/.hg/hgrc |
|
779 | 779 | > [phases] |
|
780 | 780 | > publish = False |
|
781 | 781 | > EOF |
|
782 | 782 | $ killdaemons.py |
|
783 | 783 | $ hg -R server serve -p $HGPORT -d --pid-file=hg.pid |
|
784 | 784 | $ cat hg.pid > $DAEMON_PIDS |
|
785 | 785 | |
|
786 | 786 | #if stream-legacy |
|
787 | 787 | |
|
788 | 788 | With v1 of the stream protocol, changeset are always cloned as public. It make |
|
789 | 789 | stream v1 unsuitable for non-publishing repository. |
|
790 | 790 | |
|
791 | 791 | $ hg clone --stream http://localhost:$HGPORT phase-no-publish |
|
792 | 792 | streaming all changes |
|
793 | 793 | 1089 files to transfer, 101 KB of data (no-zstd !) |
|
794 | 794 | transferred 101 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
795 | 795 | 1089 files to transfer, 98.5 KB of data (zstd !) |
|
796 | 796 | transferred 98.5 KB in * seconds (*/sec) (glob) (zstd !) |
|
797 | 797 | searching for changes |
|
798 | 798 | no changes found |
|
799 | 799 | updating to branch default |
|
800 | 800 | 1087 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
801 | 801 | $ hg -R phase-no-publish phase -r 'all()' |
|
802 | 802 | 0: public |
|
803 | 803 | 1: public |
|
804 | 804 | 2: public |
|
805 | 805 | #endif |
|
806 | 806 | #if stream-bundle2 |
|
807 | 807 | $ hg clone --stream http://localhost:$HGPORT phase-no-publish |
|
808 | 808 | streaming all changes |
|
809 | 809 | 1096 files to transfer, 102 KB of data (no-zstd !) |
|
810 | 810 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
811 | 811 | 1096 files to transfer, 98.8 KB of data (zstd !) |
|
812 | 812 | transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !) |
|
813 | 813 | updating to branch default |
|
814 | 814 | 1087 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
815 | 815 | $ hg -R phase-no-publish phase -r 'all()' |
|
816 | 816 | 0: draft |
|
817 | 817 | 1: draft |
|
818 | 818 | 2: draft |
|
819 | 819 | #endif |
|
820 | 820 | $ hg verify -R phase-no-publish |
|
821 | 821 | checking changesets |
|
822 | 822 | checking manifests |
|
823 | 823 | crosschecking files in changesets and manifests |
|
824 | 824 | checking files |
|
825 | 825 | checked 3 changesets with 1087 changes to 1087 files |
|
826 | 826 | |
|
827 | 827 | $ killdaemons.py |
|
828 | 828 | |
|
829 | 829 | #if stream-legacy |
|
830 | 830 | |
|
831 | 831 | With v1 of the stream protocol, changeset are always cloned as public. There's |
|
832 | 832 | no obsolescence markers exchange in stream v1. |
|
833 | 833 | |
|
834 | 834 | #endif |
|
835 | 835 | #if stream-bundle2 |
|
836 | 836 | |
|
837 | 837 | Stream repository with obsolescence |
|
838 | 838 | ----------------------------------- |
|
839 | 839 | |
|
840 | 840 | Clone non-publishing with obsolescence |
|
841 | 841 | |
|
842 | 842 | $ cat >> $HGRCPATH << EOF |
|
843 | 843 | > [experimental] |
|
844 | 844 | > evolution=all |
|
845 | 845 | > EOF |
|
846 | 846 | |
|
847 | 847 | $ cd server |
|
848 | 848 | $ echo foo > foo |
|
849 | 849 | $ hg -q commit -m 'about to be pruned' |
|
850 | 850 | $ hg debugobsolete `hg log -r . -T '{node}'` -d '0 0' -u test --record-parents |
|
851 | 851 | 1 new obsolescence markers |
|
852 | 852 | obsoleted 1 changesets |
|
853 | 853 | $ hg up null -q |
|
854 | 854 | $ hg log -T '{rev}: {phase}\n' |
|
855 | 855 | 2: draft |
|
856 | 856 | 1: draft |
|
857 | 857 | 0: draft |
|
858 | 858 | $ hg serve -p $HGPORT -d --pid-file=hg.pid |
|
859 | 859 | $ cat hg.pid > $DAEMON_PIDS |
|
860 | 860 | $ cd .. |
|
861 | 861 | |
|
862 | 862 | $ hg clone -U --stream http://localhost:$HGPORT with-obsolescence |
|
863 | 863 | streaming all changes |
|
864 | 864 | 1097 files to transfer, 102 KB of data (no-zstd !) |
|
865 | 865 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
866 | 866 | 1097 files to transfer, 99.2 KB of data (zstd !) |
|
867 | 867 | transferred 99.2 KB in * seconds (* */sec) (glob) (zstd !) |
|
868 | 868 | $ hg -R with-obsolescence log -T '{rev}: {phase}\n' |
|
869 | 869 | 2: draft |
|
870 | 870 | 1: draft |
|
871 | 871 | 0: draft |
|
872 | 872 | $ hg debugobsolete -R with-obsolescence |
|
873 | 873 | e53e122156df12330d3a0b72351e3a84bfd14195 0 {42e820400e843bc479ad36068ff772a69c8affe9} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
874 | 874 | $ hg verify -R with-obsolescence |
|
875 | 875 | checking changesets |
|
876 | 876 | checking manifests |
|
877 | 877 | crosschecking files in changesets and manifests |
|
878 | 878 | checking files |
|
879 | 879 | checked 4 changesets with 1088 changes to 1087 files |
|
880 | 880 | |
|
881 | 881 | $ hg clone -U --stream --config experimental.evolution=0 http://localhost:$HGPORT with-obsolescence-no-evolution |
|
882 | 882 | streaming all changes |
|
883 | 883 | remote: abort: server has obsolescence markers, but client cannot receive them via stream clone |
|
884 | 884 | abort: pull failed on remote |
|
885 | 885 | [100] |
|
886 | 886 | |
|
887 | 887 | $ killdaemons.py |
|
888 | 888 | |
|
889 | 889 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now