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