Show More
@@ -1,462 +1,466 b'' | |||
|
1 | 1 | Set up a server |
|
2 | 2 | |
|
3 | $ cat >> $HGRCPATH << EOF | |
|
4 | > [format] | |
|
5 | > usegeneraldelta=yes | |
|
6 | > EOF | |
|
3 | 7 | $ hg init server |
|
4 | 8 | $ cd server |
|
5 | 9 | $ cat >> .hg/hgrc << EOF |
|
6 | 10 | > [extensions] |
|
7 | 11 | > clonebundles = |
|
8 | 12 | > EOF |
|
9 | 13 | |
|
10 | 14 | $ touch foo |
|
11 | 15 | $ hg -q commit -A -m 'add foo' |
|
12 | 16 | $ touch bar |
|
13 | 17 | $ hg -q commit -A -m 'add bar' |
|
14 | 18 | |
|
15 | 19 | $ hg serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log |
|
16 | 20 | $ cat hg.pid >> $DAEMON_PIDS |
|
17 | 21 | $ cd .. |
|
18 | 22 | |
|
19 | 23 | Feature disabled by default |
|
20 | 24 | (client should not request manifest) |
|
21 | 25 | |
|
22 | 26 | $ hg clone -U http://localhost:$HGPORT feature-disabled |
|
23 | 27 | requesting all changes |
|
24 | 28 | adding changesets |
|
25 | 29 | adding manifests |
|
26 | 30 | adding file changes |
|
27 | 31 | added 2 changesets with 2 changes to 2 files |
|
28 | 32 | |
|
29 | 33 | $ cat server/access.log |
|
30 | 34 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
31 | 35 | * - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob) |
|
32 | 36 | * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=aaff8d2ffbbf07a46dd1f05d8ae7877e3f56e2a2&listkeys=phase%2Cbookmarks (glob) |
|
33 | 37 | * - - [*] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases (glob) |
|
34 | 38 | |
|
35 | 39 | $ cat >> $HGRCPATH << EOF |
|
36 | 40 | > [experimental] |
|
37 | 41 | > clonebundles = true |
|
38 | 42 | > EOF |
|
39 | 43 | |
|
40 | 44 | Missing manifest should not result in server lookup |
|
41 | 45 | |
|
42 | 46 | $ hg --verbose clone -U http://localhost:$HGPORT no-manifest |
|
43 | 47 | requesting all changes |
|
44 | 48 | adding changesets |
|
45 | 49 | adding manifests |
|
46 | 50 | adding file changes |
|
47 | 51 | added 2 changesets with 2 changes to 2 files |
|
48 | 52 | |
|
49 | 53 | $ tail -4 server/access.log |
|
50 | 54 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
51 | 55 | * - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob) |
|
52 | 56 | * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=aaff8d2ffbbf07a46dd1f05d8ae7877e3f56e2a2&listkeys=phase%2Cbookmarks (glob) |
|
53 | 57 | * - - [*] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases (glob) |
|
54 | 58 | |
|
55 | 59 | Empty manifest file results in retrieval |
|
56 | 60 | (the extension only checks if the manifest file exists) |
|
57 | 61 | |
|
58 | 62 | $ touch server/.hg/clonebundles.manifest |
|
59 | 63 | $ hg --verbose clone -U http://localhost:$HGPORT empty-manifest |
|
60 | 64 | no clone bundles available on remote; falling back to regular clone |
|
61 | 65 | requesting all changes |
|
62 | 66 | adding changesets |
|
63 | 67 | adding manifests |
|
64 | 68 | adding file changes |
|
65 | 69 | added 2 changesets with 2 changes to 2 files |
|
66 | 70 | |
|
67 | 71 | Server advertises presence of feature to client requesting full clone |
|
68 | 72 | |
|
69 | 73 | $ hg --config experimental.clonebundles=false clone -U http://localhost:$HGPORT advertise-on-clone |
|
70 | 74 | requesting all changes |
|
71 | 75 | remote: this server supports the experimental "clone bundles" feature that should enable faster and more reliable cloning |
|
72 | 76 | remote: help test it by setting the "experimental.clonebundles" config flag to "true" |
|
73 | 77 | adding changesets |
|
74 | 78 | adding manifests |
|
75 | 79 | adding file changes |
|
76 | 80 | added 2 changesets with 2 changes to 2 files |
|
77 | 81 | |
|
78 | 82 | Manifest file with invalid URL aborts |
|
79 | 83 | |
|
80 | 84 | $ echo 'http://does.not.exist/bundle.hg' > server/.hg/clonebundles.manifest |
|
81 | 85 | $ hg clone http://localhost:$HGPORT 404-url |
|
82 | 86 | applying clone bundle from http://does.not.exist/bundle.hg |
|
83 | 87 | error fetching bundle: * not known (glob) |
|
84 | 88 | abort: error applying bundle |
|
85 | 89 | (if this error persists, consider contacting the server operator or disable clone bundles via "--config experimental.clonebundles=false") |
|
86 | 90 | [255] |
|
87 | 91 | |
|
88 | 92 | Server is not running aborts |
|
89 | 93 | |
|
90 | 94 | $ echo "http://localhost:$HGPORT1/bundle.hg" > server/.hg/clonebundles.manifest |
|
91 | 95 | $ hg clone http://localhost:$HGPORT server-not-runner |
|
92 | 96 | applying clone bundle from http://localhost:$HGPORT1/bundle.hg |
|
93 | 97 | error fetching bundle: Connection refused |
|
94 | 98 | abort: error applying bundle |
|
95 | 99 | (if this error persists, consider contacting the server operator or disable clone bundles via "--config experimental.clonebundles=false") |
|
96 | 100 | [255] |
|
97 | 101 | |
|
98 | 102 | Server returns 404 |
|
99 | 103 | |
|
100 | 104 | $ python $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid |
|
101 | 105 | $ cat http.pid >> $DAEMON_PIDS |
|
102 | 106 | $ hg clone http://localhost:$HGPORT running-404 |
|
103 | 107 | applying clone bundle from http://localhost:$HGPORT1/bundle.hg |
|
104 | 108 | HTTP error fetching bundle: HTTP Error 404: File not found |
|
105 | 109 | abort: error applying bundle |
|
106 | 110 | (if this error persists, consider contacting the server operator or disable clone bundles via "--config experimental.clonebundles=false") |
|
107 | 111 | [255] |
|
108 | 112 | |
|
109 | 113 | We can override failure to fall back to regular clone |
|
110 | 114 | |
|
111 | 115 | $ hg --config ui.clonebundlefallback=true clone -U http://localhost:$HGPORT 404-fallback |
|
112 | 116 | applying clone bundle from http://localhost:$HGPORT1/bundle.hg |
|
113 | 117 | HTTP error fetching bundle: HTTP Error 404: File not found |
|
114 | 118 | falling back to normal clone |
|
115 | 119 | requesting all changes |
|
116 | 120 | adding changesets |
|
117 | 121 | adding manifests |
|
118 | 122 | adding file changes |
|
119 | 123 | added 2 changesets with 2 changes to 2 files |
|
120 | 124 | |
|
121 | 125 | Bundle with partial content works |
|
122 | 126 | |
|
123 | 127 | $ hg -R server bundle --type gzip-v1 --base null -r 53245c60e682 partial.hg |
|
124 | 128 | 1 changesets found |
|
125 | 129 | |
|
126 | 130 | We verify exact bundle content as an extra check against accidental future |
|
127 | 131 | changes. If this output changes, we could break old clients. |
|
128 | 132 | |
|
129 | 133 | $ f --size --hexdump partial.hg |
|
130 | 134 | partial.hg: size=208 |
|
131 | 135 | 0000: 48 47 31 30 47 5a 78 9c 63 60 60 98 17 ac 12 93 |HG10GZx.c``.....| |
|
132 | 136 | 0010: f0 ac a9 23 45 70 cb bf 0d 5f 59 4e 4a 7f 79 21 |...#Ep..._YNJ.y!| |
|
133 | 137 | 0020: 9b cc 40 24 20 a0 d7 ce 2c d1 38 25 cd 24 25 d5 |..@$ ...,.8%.$%.| |
|
134 | 138 | 0030: d8 c2 22 cd 38 d9 24 cd 22 d5 c8 22 cd 24 cd 32 |..".8.$."..".$.2| |
|
135 | 139 | 0040: d1 c2 d0 c4 c8 d2 32 d1 38 39 29 c9 34 cd d4 80 |......2.89).4...| |
|
136 | 140 | 0050: ab 24 b5 b8 84 cb 40 c1 80 2b 2d 3f 9f 8b 2b 31 |.$....@..+-?..+1| |
|
137 | 141 | 0060: 25 45 01 c8 80 9a d2 9b 65 fb e5 9e 45 bf 8d 7f |%E......e...E...| |
|
138 | 142 | 0070: 9f c6 97 9f 2b 44 34 67 d9 ec 8e 0f a0 92 0b 75 |....+D4g.......u| |
|
139 | 143 | 0080: 41 d6 24 59 18 a4 a4 9a a6 18 1a 5b 98 9b 5a 98 |A.$Y.......[..Z.| |
|
140 | 144 | 0090: 9a 18 26 9b a6 19 98 1a 99 99 26 a6 18 9a 98 24 |..&.......&....$| |
|
141 | 145 | 00a0: 26 59 a6 25 5a 98 a5 18 a6 24 71 41 35 b1 43 dc |&Y.%Z....$qA5.C.| |
|
142 | 146 | 00b0: 96 b0 83 f7 e9 45 8b d2 56 c7 a3 1f 82 52 d7 8a |.....E..V....R..| |
|
143 | 147 | 00c0: 78 ed fc d5 76 f1 36 95 dc 05 07 00 ad 39 5e d3 |x...v.6......9^.| |
|
144 | 148 | |
|
145 | 149 | $ echo "http://localhost:$HGPORT1/partial.hg" > server/.hg/clonebundles.manifest |
|
146 | 150 | $ hg clone -U http://localhost:$HGPORT partial-bundle |
|
147 | 151 | applying clone bundle from http://localhost:$HGPORT1/partial.hg |
|
148 | 152 | adding changesets |
|
149 | 153 | adding manifests |
|
150 | 154 | adding file changes |
|
151 | 155 | added 1 changesets with 1 changes to 1 files |
|
152 | 156 | finished applying clone bundle |
|
153 | 157 | searching for changes |
|
154 | 158 | adding changesets |
|
155 | 159 | adding manifests |
|
156 | 160 | adding file changes |
|
157 | 161 | added 1 changesets with 1 changes to 1 files |
|
158 | 162 | |
|
159 | 163 | Incremental pull doesn't fetch bundle |
|
160 | 164 | |
|
161 | 165 | $ hg clone -r 53245c60e682 -U http://localhost:$HGPORT partial-clone |
|
162 | 166 | adding changesets |
|
163 | 167 | adding manifests |
|
164 | 168 | adding file changes |
|
165 | 169 | added 1 changesets with 1 changes to 1 files |
|
166 | 170 | |
|
167 | 171 | $ cd partial-clone |
|
168 | 172 | $ hg pull |
|
169 | 173 | pulling from http://localhost:$HGPORT/ |
|
170 | 174 | searching for changes |
|
171 | 175 | adding changesets |
|
172 | 176 | adding manifests |
|
173 | 177 | adding file changes |
|
174 | 178 | added 1 changesets with 1 changes to 1 files |
|
175 | 179 | (run 'hg update' to get a working copy) |
|
176 | 180 | $ cd .. |
|
177 | 181 | |
|
178 | 182 | Bundle with full content works |
|
179 | 183 | |
|
180 | 184 | $ hg -R server bundle --type gzip-v2 --base null -r tip full.hg |
|
181 | 185 | 2 changesets found |
|
182 | 186 | |
|
183 | 187 | Again, we perform an extra check against bundle content changes. If this content |
|
184 | 188 | changes, clone bundles produced by new Mercurial versions may not be readable |
|
185 | 189 | by old clients. |
|
186 | 190 | |
|
187 | 191 | $ f --size --hexdump full.hg |
|
188 | 192 | full.hg: size=408 |
|
189 | 193 | 0000: 48 47 32 30 00 00 00 0e 43 6f 6d 70 72 65 73 73 |HG20....Compress| |
|
190 | 194 | 0010: 69 6f 6e 3d 47 5a 78 9c 63 60 60 90 e5 76 f6 70 |ion=GZx.c``..v.p| |
|
191 | 195 | 0020: f4 73 77 75 0f f2 0f 0d 60 00 02 46 06 76 a6 b2 |.swu....`..F.v..| |
|
192 | 196 | 0030: d4 a2 e2 cc fc 3c 03 23 06 06 e6 7d 40 b1 4d c1 |.....<.#...}@.M.| |
|
193 | 197 | 0040: 2a 31 09 cf 9a 3a 52 04 b7 fc db f0 95 e5 a4 f4 |*1...:R.........| |
|
194 | 198 | 0050: 97 17 b2 c9 0c 14 00 02 e6 d9 99 25 1a a7 a4 99 |...........%....| |
|
195 | 199 | 0060: a4 a4 1a 5b 58 a4 19 27 9b a4 59 a4 1a 59 a4 99 |...[X..'..Y..Y..| |
|
196 | 200 | 0070: a4 59 26 5a 18 9a 18 59 5a 26 1a 27 27 25 99 a6 |.Y&Z...YZ&.''%..| |
|
197 | 201 | 0080: 99 1a 70 95 a4 16 97 70 19 28 18 70 a5 e5 e7 73 |..p....p.(.p...s| |
|
198 | 202 | 0090: 71 25 a6 a4 28 00 19 40 13 0e ac fa df ab ff 7b |q%..(..@.......{| |
|
199 | 203 | 00a0: 3f fb 92 dc 8b 1f 62 bb 9e b7 d7 d9 87 3d 5a 44 |?.....b......=ZD| |
|
200 | 204 | 00b0: ac 2f b0 a9 c3 66 1e 54 b9 26 08 a7 1a 1b 1a a7 |./...f.T.&......| |
|
201 | 205 | 00c0: 25 1b 9a 1b 99 19 9a 5a 18 9b a6 18 19 00 dd 67 |%......Z.......g| |
|
202 | 206 | 00d0: 61 61 98 06 f4 80 49 4a 8a 65 52 92 41 9a 81 81 |aa....IJ.eR.A...| |
|
203 | 207 | 00e0: a5 11 17 50 31 30 58 19 cc 80 98 25 29 b1 08 c4 |...P10X....%)...| |
|
204 | 208 | 00f0: 37 07 79 19 88 d9 41 ee 07 8a 41 cd 5d 98 65 fb |7.y...A...A.].e.| |
|
205 | 209 | 0100: e5 9e 45 bf 8d 7f 9f c6 97 9f 2b 44 34 67 d9 ec |..E.......+D4g..| |
|
206 | 210 | 0110: 8e 0f a0 61 a8 eb 82 82 2e c9 c2 20 25 d5 34 c5 |...a....... %.4.| |
|
207 | 211 | 0120: d0 d8 c2 dc d4 c2 d4 c4 30 d9 34 cd c0 d4 c8 cc |........0.4.....| |
|
208 | 212 | 0130: 34 31 c5 d0 c4 24 31 c9 32 2d d1 c2 2c c5 30 25 |41...$1.2-..,.0%| |
|
209 | 213 | 0140: 09 e4 ee 85 8f 85 ff 88 ab 89 36 c7 2a c4 47 34 |..........6.*.G4| |
|
210 | 214 | 0150: fe f8 ec 7b 73 37 3f c3 24 62 1d 8d 4d 1d 9e 40 |...{s7?.$b..M..@| |
|
211 | 215 | 0160: 06 3b 10 14 36 a4 38 10 04 d8 21 01 5a b2 83 f7 |.;..6.8...!.Z...| |
|
212 | 216 | 0170: e9 45 8b d2 56 c7 a3 1f 82 52 d7 8a 78 ed fc d5 |.E..V....R..x...| |
|
213 | 217 | 0180: 76 f1 36 25 81 49 c0 ad 30 c0 0e 49 8f 54 b7 9e |v.6%.I..0..I.T..| |
|
214 | 218 | 0190: d4 1c 09 00 bb 8d f0 bd |........| |
|
215 | 219 | |
|
216 | 220 | $ echo "http://localhost:$HGPORT1/full.hg" > server/.hg/clonebundles.manifest |
|
217 | 221 | $ hg clone -U http://localhost:$HGPORT full-bundle |
|
218 | 222 | applying clone bundle from http://localhost:$HGPORT1/full.hg |
|
219 | 223 | adding changesets |
|
220 | 224 | adding manifests |
|
221 | 225 | adding file changes |
|
222 | 226 | added 2 changesets with 2 changes to 2 files |
|
223 | 227 | finished applying clone bundle |
|
224 | 228 | searching for changes |
|
225 | 229 | no changes found |
|
226 | 230 | |
|
227 | 231 | Feature works over SSH |
|
228 | 232 | |
|
229 | 233 | $ hg clone -U -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/server ssh-full-clone |
|
230 | 234 | applying clone bundle from http://localhost:$HGPORT1/full.hg |
|
231 | 235 | adding changesets |
|
232 | 236 | adding manifests |
|
233 | 237 | adding file changes |
|
234 | 238 | added 2 changesets with 2 changes to 2 files |
|
235 | 239 | finished applying clone bundle |
|
236 | 240 | searching for changes |
|
237 | 241 | no changes found |
|
238 | 242 | |
|
239 | 243 | Entry with unknown BUNDLESPEC is filtered and not used |
|
240 | 244 | |
|
241 | 245 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
242 | 246 | > http://bad.entry1 BUNDLESPEC=UNKNOWN |
|
243 | 247 | > http://bad.entry2 BUNDLESPEC=xz-v1 |
|
244 | 248 | > http://bad.entry3 BUNDLESPEC=none-v100 |
|
245 | 249 | > http://localhost:$HGPORT1/full.hg BUNDLESPEC=gzip-v2 |
|
246 | 250 | > EOF |
|
247 | 251 | |
|
248 | 252 | $ hg clone -U http://localhost:$HGPORT filter-unknown-type |
|
249 | 253 | applying clone bundle from http://localhost:$HGPORT1/full.hg |
|
250 | 254 | adding changesets |
|
251 | 255 | adding manifests |
|
252 | 256 | adding file changes |
|
253 | 257 | added 2 changesets with 2 changes to 2 files |
|
254 | 258 | finished applying clone bundle |
|
255 | 259 | searching for changes |
|
256 | 260 | no changes found |
|
257 | 261 | |
|
258 | 262 | Automatic fallback when all entries are filtered |
|
259 | 263 | |
|
260 | 264 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
261 | 265 | > http://bad.entry BUNDLESPEC=UNKNOWN |
|
262 | 266 | > EOF |
|
263 | 267 | |
|
264 | 268 | $ hg clone -U http://localhost:$HGPORT filter-all |
|
265 | 269 | no compatible clone bundles available on server; falling back to regular clone |
|
266 | 270 | (you may want to report this to the server operator) |
|
267 | 271 | requesting all changes |
|
268 | 272 | adding changesets |
|
269 | 273 | adding manifests |
|
270 | 274 | adding file changes |
|
271 | 275 | added 2 changesets with 2 changes to 2 files |
|
272 | 276 | |
|
273 | 277 | URLs requiring SNI are filtered in Python <2.7.9 |
|
274 | 278 | |
|
275 | 279 | $ cp full.hg sni.hg |
|
276 | 280 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
277 | 281 | > http://localhost:$HGPORT1/sni.hg REQUIRESNI=true |
|
278 | 282 | > http://localhost:$HGPORT1/full.hg |
|
279 | 283 | > EOF |
|
280 | 284 | |
|
281 | 285 | #if sslcontext |
|
282 | 286 | Python 2.7.9+ support SNI |
|
283 | 287 | |
|
284 | 288 | $ hg clone -U http://localhost:$HGPORT sni-supported |
|
285 | 289 | applying clone bundle from http://localhost:$HGPORT1/sni.hg |
|
286 | 290 | adding changesets |
|
287 | 291 | adding manifests |
|
288 | 292 | adding file changes |
|
289 | 293 | added 2 changesets with 2 changes to 2 files |
|
290 | 294 | finished applying clone bundle |
|
291 | 295 | searching for changes |
|
292 | 296 | no changes found |
|
293 | 297 | #else |
|
294 | 298 | Python <2.7.9 will filter SNI URLs |
|
295 | 299 | |
|
296 | 300 | $ hg clone -U http://localhost:$HGPORT sni-unsupported |
|
297 | 301 | applying clone bundle from http://localhost:$HGPORT1/full.hg |
|
298 | 302 | adding changesets |
|
299 | 303 | adding manifests |
|
300 | 304 | adding file changes |
|
301 | 305 | added 2 changesets with 2 changes to 2 files |
|
302 | 306 | finished applying clone bundle |
|
303 | 307 | searching for changes |
|
304 | 308 | no changes found |
|
305 | 309 | #endif |
|
306 | 310 | |
|
307 | 311 | Stream clone bundles are supported |
|
308 | 312 | |
|
309 | 313 | $ hg -R server debugcreatestreamclonebundle packed.hg |
|
310 | 314 | writing 613 bytes for 4 files |
|
311 | bundle requirements: revlogv1 | |
|
315 | bundle requirements: generaldelta, revlogv1 | |
|
312 | 316 | |
|
313 | 317 | No bundle spec should work |
|
314 | 318 | |
|
315 | 319 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
316 | 320 | > http://localhost:$HGPORT1/packed.hg |
|
317 | 321 | > EOF |
|
318 | 322 | |
|
319 | 323 | $ hg clone -U http://localhost:$HGPORT stream-clone-no-spec |
|
320 | 324 | applying clone bundle from http://localhost:$HGPORT1/packed.hg |
|
321 | 325 | 4 files to transfer, 613 bytes of data |
|
322 | 326 | transferred 613 bytes in *.* seconds (*) (glob) |
|
323 | 327 | finished applying clone bundle |
|
324 | 328 | searching for changes |
|
325 | 329 | no changes found |
|
326 | 330 | |
|
327 | 331 | Bundle spec without parameters should work |
|
328 | 332 | |
|
329 | 333 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
330 | 334 | > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1 |
|
331 | 335 | > EOF |
|
332 | 336 | |
|
333 | 337 | $ hg clone -U http://localhost:$HGPORT stream-clone-vanilla-spec |
|
334 | 338 | applying clone bundle from http://localhost:$HGPORT1/packed.hg |
|
335 | 339 | 4 files to transfer, 613 bytes of data |
|
336 | 340 | transferred 613 bytes in *.* seconds (*) (glob) |
|
337 | 341 | finished applying clone bundle |
|
338 | 342 | searching for changes |
|
339 | 343 | no changes found |
|
340 | 344 | |
|
341 | 345 | Bundle spec with format requirements should work |
|
342 | 346 | |
|
343 | 347 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
344 | 348 | > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv1 |
|
345 | 349 | > EOF |
|
346 | 350 | |
|
347 | 351 | $ hg clone -U http://localhost:$HGPORT stream-clone-supported-requirements |
|
348 | 352 | applying clone bundle from http://localhost:$HGPORT1/packed.hg |
|
349 | 353 | 4 files to transfer, 613 bytes of data |
|
350 | 354 | transferred 613 bytes in *.* seconds (*) (glob) |
|
351 | 355 | finished applying clone bundle |
|
352 | 356 | searching for changes |
|
353 | 357 | no changes found |
|
354 | 358 | |
|
355 | 359 | Stream bundle spec with unknown requirements should be filtered out |
|
356 | 360 | |
|
357 | 361 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
358 | 362 | > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv42 |
|
359 | 363 | > EOF |
|
360 | 364 | |
|
361 | 365 | $ hg clone -U http://localhost:$HGPORT stream-clone-unsupported-requirements |
|
362 | 366 | no compatible clone bundles available on server; falling back to regular clone |
|
363 | 367 | (you may want to report this to the server operator) |
|
364 | 368 | requesting all changes |
|
365 | 369 | adding changesets |
|
366 | 370 | adding manifests |
|
367 | 371 | adding file changes |
|
368 | 372 | added 2 changesets with 2 changes to 2 files |
|
369 | 373 | |
|
370 | 374 | Set up manifest for testing preferences |
|
371 | 375 | (Remember, the TYPE does not have to match reality - the URL is |
|
372 | 376 | important) |
|
373 | 377 | |
|
374 | 378 | $ cp full.hg gz-a.hg |
|
375 | 379 | $ cp full.hg gz-b.hg |
|
376 | 380 | $ cp full.hg bz2-a.hg |
|
377 | 381 | $ cp full.hg bz2-b.hg |
|
378 | 382 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
379 | 383 | > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 extra=a |
|
380 | 384 | > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2 extra=a |
|
381 | 385 | > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b |
|
382 | 386 | > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b |
|
383 | 387 | > EOF |
|
384 | 388 | |
|
385 | 389 | Preferring an undefined attribute will take first entry |
|
386 | 390 | |
|
387 | 391 | $ hg --config experimental.clonebundleprefers=foo=bar clone -U http://localhost:$HGPORT prefer-foo |
|
388 | 392 | applying clone bundle from http://localhost:$HGPORT1/gz-a.hg |
|
389 | 393 | adding changesets |
|
390 | 394 | adding manifests |
|
391 | 395 | adding file changes |
|
392 | 396 | added 2 changesets with 2 changes to 2 files |
|
393 | 397 | finished applying clone bundle |
|
394 | 398 | searching for changes |
|
395 | 399 | no changes found |
|
396 | 400 | |
|
397 | 401 | Preferring bz2 type will download first entry of that type |
|
398 | 402 | |
|
399 | 403 | $ hg --config experimental.clonebundleprefers=COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-bz |
|
400 | 404 | applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg |
|
401 | 405 | adding changesets |
|
402 | 406 | adding manifests |
|
403 | 407 | adding file changes |
|
404 | 408 | added 2 changesets with 2 changes to 2 files |
|
405 | 409 | finished applying clone bundle |
|
406 | 410 | searching for changes |
|
407 | 411 | no changes found |
|
408 | 412 | |
|
409 | 413 | Preferring multiple values of an option works |
|
410 | 414 | |
|
411 | 415 | $ hg --config experimental.clonebundleprefers=COMPRESSION=unknown,COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-multiple-bz |
|
412 | 416 | applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg |
|
413 | 417 | adding changesets |
|
414 | 418 | adding manifests |
|
415 | 419 | adding file changes |
|
416 | 420 | added 2 changesets with 2 changes to 2 files |
|
417 | 421 | finished applying clone bundle |
|
418 | 422 | searching for changes |
|
419 | 423 | no changes found |
|
420 | 424 | |
|
421 | 425 | Sorting multiple values should get us back to original first entry |
|
422 | 426 | |
|
423 | 427 | $ hg --config experimental.clonebundleprefers=BUNDLESPEC=unknown,BUNDLESPEC=gzip-v2,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-multiple-gz |
|
424 | 428 | applying clone bundle from http://localhost:$HGPORT1/gz-a.hg |
|
425 | 429 | adding changesets |
|
426 | 430 | adding manifests |
|
427 | 431 | adding file changes |
|
428 | 432 | added 2 changesets with 2 changes to 2 files |
|
429 | 433 | finished applying clone bundle |
|
430 | 434 | searching for changes |
|
431 | 435 | no changes found |
|
432 | 436 | |
|
433 | 437 | Preferring multiple attributes has correct order |
|
434 | 438 | |
|
435 | 439 | $ hg --config experimental.clonebundleprefers=extra=b,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-separate-attributes |
|
436 | 440 | applying clone bundle from http://localhost:$HGPORT1/bz2-b.hg |
|
437 | 441 | adding changesets |
|
438 | 442 | adding manifests |
|
439 | 443 | adding file changes |
|
440 | 444 | added 2 changesets with 2 changes to 2 files |
|
441 | 445 | finished applying clone bundle |
|
442 | 446 | searching for changes |
|
443 | 447 | no changes found |
|
444 | 448 | |
|
445 | 449 | Test where attribute is missing from some entries |
|
446 | 450 | |
|
447 | 451 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
448 | 452 | > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 |
|
449 | 453 | > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2 |
|
450 | 454 | > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b |
|
451 | 455 | > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b |
|
452 | 456 | > EOF |
|
453 | 457 | |
|
454 | 458 | $ hg --config experimental.clonebundleprefers=extra=b clone -U http://localhost:$HGPORT prefer-partially-defined-attribute |
|
455 | 459 | applying clone bundle from http://localhost:$HGPORT1/gz-b.hg |
|
456 | 460 | adding changesets |
|
457 | 461 | adding manifests |
|
458 | 462 | adding file changes |
|
459 | 463 | added 2 changesets with 2 changes to 2 files |
|
460 | 464 | finished applying clone bundle |
|
461 | 465 | searching for changes |
|
462 | 466 | no changes found |
General Comments 0
You need to be logged in to leave comments.
Login now