Show More
@@ -1,556 +1,556 b'' | |||
|
1 | 1 | #require no-reposimplestore no-chg |
|
2 | 2 | |
|
3 | 3 | Set up a server |
|
4 | 4 | |
|
5 | 5 | $ hg init server |
|
6 | 6 | $ cd server |
|
7 | 7 | $ cat >> .hg/hgrc << EOF |
|
8 | 8 | > [extensions] |
|
9 | 9 | > clonebundles = |
|
10 | 10 | > EOF |
|
11 | 11 | |
|
12 | 12 | $ touch foo |
|
13 | 13 | $ hg -q commit -A -m 'add foo' |
|
14 | 14 | $ touch bar |
|
15 | 15 | $ hg -q commit -A -m 'add bar' |
|
16 | 16 | |
|
17 | 17 | $ hg serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log |
|
18 | 18 | $ cat hg.pid >> $DAEMON_PIDS |
|
19 | 19 | $ cd .. |
|
20 | 20 | |
|
21 | 21 | Missing manifest should not result in server lookup |
|
22 | 22 | |
|
23 | 23 | $ hg --verbose clone -U http://localhost:$HGPORT no-manifest |
|
24 | 24 | requesting all changes |
|
25 | 25 | adding changesets |
|
26 | 26 | adding manifests |
|
27 | 27 | adding file changes |
|
28 | 28 | added 2 changesets with 2 changes to 2 files |
|
29 | 29 | new changesets 53245c60e682:aaff8d2ffbbf |
|
30 | 30 | (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob) |
|
31 | 31 | |
|
32 | 32 | $ cat server/access.log |
|
33 | 33 | * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
34 | 34 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
35 | 35 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=aaff8d2ffbbf07a46dd1f05d8ae7877e3f56e2a2&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
36 | 36 | |
|
37 | 37 | Empty manifest file results in retrieval |
|
38 | 38 | (the extension only checks if the manifest file exists) |
|
39 | 39 | |
|
40 | 40 | $ touch server/.hg/clonebundles.manifest |
|
41 | 41 | $ hg --verbose clone -U http://localhost:$HGPORT empty-manifest |
|
42 | 42 | no clone bundles available on remote; falling back to regular clone |
|
43 | 43 | requesting all changes |
|
44 | 44 | adding changesets |
|
45 | 45 | adding manifests |
|
46 | 46 | adding file changes |
|
47 | 47 | added 2 changesets with 2 changes to 2 files |
|
48 | 48 | new changesets 53245c60e682:aaff8d2ffbbf |
|
49 | 49 | (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob) |
|
50 | 50 | |
|
51 | 51 | Manifest file with invalid URL aborts |
|
52 | 52 | |
|
53 | 53 | $ echo 'http://does.not.exist/bundle.hg' > server/.hg/clonebundles.manifest |
|
54 | 54 | $ hg clone http://localhost:$HGPORT 404-url |
|
55 | 55 | applying clone bundle from http://does.not.exist/bundle.hg |
|
56 | 56 | error fetching bundle: (.* not known|(\[Errno -?\d+])? No address associated with hostname) (re) (no-windows !) |
|
57 | 57 | error fetching bundle: [Errno 1100*] getaddrinfo failed (glob) (windows !) |
|
58 | 58 | abort: error applying bundle |
|
59 | 59 | (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false") |
|
60 | 60 | [255] |
|
61 | 61 | |
|
62 | 62 | Server is not running aborts |
|
63 | 63 | |
|
64 | 64 | $ echo "http://localhost:$HGPORT1/bundle.hg" > server/.hg/clonebundles.manifest |
|
65 | 65 | $ hg clone http://localhost:$HGPORT server-not-runner |
|
66 | 66 | applying clone bundle from http://localhost:$HGPORT1/bundle.hg |
|
67 | error fetching bundle: (.* refused.*|Protocol not supported|(.* )?\$EADDRNOTAVAIL\$) (re) | |
|
67 | error fetching bundle: (.* refused.*|Protocol not supported|(.* )?\$EADDRNOTAVAIL\$|.* No route to host) (re) | |
|
68 | 68 | abort: error applying bundle |
|
69 | 69 | (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false") |
|
70 | 70 | [255] |
|
71 | 71 | |
|
72 | 72 | Server returns 404 |
|
73 | 73 | |
|
74 | 74 | $ "$PYTHON" $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid |
|
75 | 75 | $ cat http.pid >> $DAEMON_PIDS |
|
76 | 76 | $ hg clone http://localhost:$HGPORT running-404 |
|
77 | 77 | applying clone bundle from http://localhost:$HGPORT1/bundle.hg |
|
78 | 78 | HTTP error fetching bundle: HTTP Error 404: File not found |
|
79 | 79 | abort: error applying bundle |
|
80 | 80 | (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false") |
|
81 | 81 | [255] |
|
82 | 82 | |
|
83 | 83 | We can override failure to fall back to regular clone |
|
84 | 84 | |
|
85 | 85 | $ hg --config ui.clonebundlefallback=true clone -U http://localhost:$HGPORT 404-fallback |
|
86 | 86 | applying clone bundle from http://localhost:$HGPORT1/bundle.hg |
|
87 | 87 | HTTP error fetching bundle: HTTP Error 404: File not found |
|
88 | 88 | falling back to normal clone |
|
89 | 89 | requesting all changes |
|
90 | 90 | adding changesets |
|
91 | 91 | adding manifests |
|
92 | 92 | adding file changes |
|
93 | 93 | added 2 changesets with 2 changes to 2 files |
|
94 | 94 | new changesets 53245c60e682:aaff8d2ffbbf |
|
95 | 95 | |
|
96 | 96 | Bundle with partial content works |
|
97 | 97 | |
|
98 | 98 | $ hg -R server bundle --type gzip-v1 --base null -r 53245c60e682 partial.hg |
|
99 | 99 | 1 changesets found |
|
100 | 100 | |
|
101 | 101 | We verify exact bundle content as an extra check against accidental future |
|
102 | 102 | changes. If this output changes, we could break old clients. |
|
103 | 103 | |
|
104 | 104 | $ f --size --hexdump partial.hg |
|
105 | 105 | partial.hg: size=207 |
|
106 | 106 | 0000: 48 47 31 30 47 5a 78 9c 63 60 60 98 17 ac 12 93 |HG10GZx.c``.....| |
|
107 | 107 | 0010: f0 ac a9 23 45 70 cb bf 0d 5f 59 4e 4a 7f 79 21 |...#Ep..._YNJ.y!| |
|
108 | 108 | 0020: 9b cc 40 24 20 a0 d7 ce 2c d1 38 25 cd 24 25 d5 |..@$ ...,.8%.$%.| |
|
109 | 109 | 0030: d8 c2 22 cd 38 d9 24 cd 22 d5 c8 22 cd 24 cd 32 |..".8.$."..".$.2| |
|
110 | 110 | 0040: d1 c2 d0 c4 c8 d2 32 d1 38 39 29 c9 34 cd d4 80 |......2.89).4...| |
|
111 | 111 | 0050: ab 24 b5 b8 84 cb 40 c1 80 2b 2d 3f 9f 8b 2b 31 |.$....@..+-?..+1| |
|
112 | 112 | 0060: 25 45 01 c8 80 9a d2 9b 65 fb e5 9e 45 bf 8d 7f |%E......e...E...| |
|
113 | 113 | 0070: 9f c6 97 9f 2b 44 34 67 d9 ec 8e 0f a0 92 0b 75 |....+D4g.......u| |
|
114 | 114 | 0080: 41 d6 24 59 18 a4 a4 9a a6 18 1a 5b 98 9b 5a 98 |A.$Y.......[..Z.| |
|
115 | 115 | 0090: 9a 18 26 9b a6 19 98 1a 99 99 26 a6 18 9a 98 24 |..&.......&....$| |
|
116 | 116 | 00a0: 26 59 a6 25 5a 98 a5 18 a6 24 71 41 35 b1 43 dc |&Y.%Z....$qA5.C.| |
|
117 | 117 | 00b0: 16 b2 83 f7 e9 45 8b d2 56 c7 a3 1f 82 52 d7 8a |.....E..V....R..| |
|
118 | 118 | 00c0: 78 ed fc d5 76 f1 36 35 dc 05 00 36 ed 5e c7 |x...v.65...6.^.| |
|
119 | 119 | |
|
120 | 120 | $ echo "http://localhost:$HGPORT1/partial.hg" > server/.hg/clonebundles.manifest |
|
121 | 121 | $ hg clone -U http://localhost:$HGPORT partial-bundle |
|
122 | 122 | applying clone bundle from http://localhost:$HGPORT1/partial.hg |
|
123 | 123 | adding changesets |
|
124 | 124 | adding manifests |
|
125 | 125 | adding file changes |
|
126 | 126 | added 1 changesets with 1 changes to 1 files |
|
127 | 127 | finished applying clone bundle |
|
128 | 128 | searching for changes |
|
129 | 129 | adding changesets |
|
130 | 130 | adding manifests |
|
131 | 131 | adding file changes |
|
132 | 132 | added 1 changesets with 1 changes to 1 files |
|
133 | 133 | new changesets aaff8d2ffbbf |
|
134 | 134 | 1 local changesets published |
|
135 | 135 | |
|
136 | 136 | Incremental pull doesn't fetch bundle |
|
137 | 137 | |
|
138 | 138 | $ hg clone -r 53245c60e682 -U http://localhost:$HGPORT partial-clone |
|
139 | 139 | adding changesets |
|
140 | 140 | adding manifests |
|
141 | 141 | adding file changes |
|
142 | 142 | added 1 changesets with 1 changes to 1 files |
|
143 | 143 | new changesets 53245c60e682 |
|
144 | 144 | |
|
145 | 145 | $ cd partial-clone |
|
146 | 146 | $ hg pull |
|
147 | 147 | pulling from http://localhost:$HGPORT/ |
|
148 | 148 | searching for changes |
|
149 | 149 | adding changesets |
|
150 | 150 | adding manifests |
|
151 | 151 | adding file changes |
|
152 | 152 | added 1 changesets with 1 changes to 1 files |
|
153 | 153 | new changesets aaff8d2ffbbf |
|
154 | 154 | (run 'hg update' to get a working copy) |
|
155 | 155 | $ cd .. |
|
156 | 156 | |
|
157 | 157 | Bundle with full content works |
|
158 | 158 | |
|
159 | 159 | $ hg -R server bundle --type gzip-v2 --base null -r tip full.hg |
|
160 | 160 | 2 changesets found |
|
161 | 161 | |
|
162 | 162 | Again, we perform an extra check against bundle content changes. If this content |
|
163 | 163 | changes, clone bundles produced by new Mercurial versions may not be readable |
|
164 | 164 | by old clients. |
|
165 | 165 | |
|
166 | 166 | $ f --size --hexdump full.hg |
|
167 | 167 | full.hg: size=442 |
|
168 | 168 | 0000: 48 47 32 30 00 00 00 0e 43 6f 6d 70 72 65 73 73 |HG20....Compress| |
|
169 | 169 | 0010: 69 6f 6e 3d 47 5a 78 9c 63 60 60 d0 e4 76 f6 70 |ion=GZx.c``..v.p| |
|
170 | 170 | 0020: f4 73 77 75 0f f2 0f 0d 60 00 02 46 46 76 26 4e |.swu....`..FFv&N| |
|
171 | 171 | 0030: c6 b2 d4 a2 e2 cc fc 3c 03 a3 bc a4 e4 8c c4 bc |.......<........| |
|
172 | 172 | 0040: f4 d4 62 23 06 06 e6 19 40 f9 4d c1 2a 31 09 cf |..b#....@.M.*1..| |
|
173 | 173 | 0050: 9a 3a 52 04 b7 fc db f0 95 e5 a4 f4 97 17 b2 c9 |.:R.............| |
|
174 | 174 | 0060: 0c 14 00 02 e6 d9 99 25 1a a7 a4 99 a4 a4 1a 5b |.......%.......[| |
|
175 | 175 | 0070: 58 a4 19 27 9b a4 59 a4 1a 59 a4 99 a4 59 26 5a |X..'..Y..Y...Y&Z| |
|
176 | 176 | 0080: 18 9a 18 59 5a 26 1a 27 27 25 99 a6 99 1a 70 95 |...YZ&.''%....p.| |
|
177 | 177 | 0090: a4 16 97 70 19 28 18 70 a5 e5 e7 73 71 25 a6 a4 |...p.(.p...sq%..| |
|
178 | 178 | 00a0: 28 00 19 20 17 af fa df ab ff 7b 3f fb 92 dc 8b |(.. ......{?....| |
|
179 | 179 | 00b0: 1f 62 bb 9e b7 d7 d9 87 3d 5a 44 89 2f b0 99 87 |.b......=ZD./...| |
|
180 | 180 | 00c0: ec e2 54 63 43 e3 b4 64 43 73 23 33 43 53 0b 63 |..TcC..dCs#3CS.c| |
|
181 | 181 | 00d0: d3 14 23 03 a0 fb 2c 2c 0c d3 80 1e 30 49 49 b1 |..#...,,....0II.| |
|
182 | 182 | 00e0: 4c 4a 32 48 33 30 b0 34 42 b8 38 29 b1 08 e2 62 |LJ2H30.4B.8)...b| |
|
183 | 183 | 00f0: 20 03 6a ca c2 2c db 2f f7 2c fa 6d fc fb 34 be | .j..,./.,.m..4.| |
|
184 | 184 | 0100: fc 5c 21 a2 39 cb 66 77 7c 00 0d c3 59 17 14 58 |.\!.9.fw|...Y..X| |
|
185 | 185 | 0110: 49 16 06 29 a9 a6 29 86 c6 16 e6 a6 16 a6 26 86 |I..)..).......&.| |
|
186 | 186 | 0120: c9 a6 69 06 a6 46 66 a6 89 29 86 26 26 89 49 96 |..i..Ff..).&&.I.| |
|
187 | 187 | 0130: 69 89 16 66 29 86 29 49 5c 20 07 3e 16 fe 23 ae |i..f).)I\ .>..#.| |
|
188 | 188 | 0140: 26 da 1c ab 10 1f d1 f8 e3 b3 ef cd dd fc 0c 93 |&...............| |
|
189 | 189 | 0150: 88 75 34 36 75 04 82 55 17 14 36 a4 38 10 04 d8 |.u46u..U..6.8...| |
|
190 | 190 | 0160: 21 01 9a b1 83 f7 e9 45 8b d2 56 c7 a3 1f 82 52 |!......E..V....R| |
|
191 | 191 | 0170: d7 8a 78 ed fc d5 76 f1 36 25 81 89 c7 ad ec 90 |..x...v.6%......| |
|
192 | 192 | 0180: 54 47 75 2b 89 48 b1 b2 62 c9 89 c9 19 a9 56 45 |TGu+.H..b.....VE| |
|
193 | 193 | 0190: a9 65 ba 49 45 89 79 c9 19 ba 60 01 a0 14 23 58 |.e.IE.y...`...#X| |
|
194 | 194 | 01a0: 81 35 c8 7d 40 cc 04 e2 a4 a4 a6 25 96 e6 94 60 |.5.}@......%...`| |
|
195 | 195 | 01b0: 33 17 5f 54 00 00 d3 1b 0d 4c |3._T.....L| |
|
196 | 196 | |
|
197 | 197 | $ echo "http://localhost:$HGPORT1/full.hg" > server/.hg/clonebundles.manifest |
|
198 | 198 | $ hg clone -U http://localhost:$HGPORT full-bundle |
|
199 | 199 | applying clone bundle from http://localhost:$HGPORT1/full.hg |
|
200 | 200 | adding changesets |
|
201 | 201 | adding manifests |
|
202 | 202 | adding file changes |
|
203 | 203 | added 2 changesets with 2 changes to 2 files |
|
204 | 204 | finished applying clone bundle |
|
205 | 205 | searching for changes |
|
206 | 206 | no changes found |
|
207 | 207 | 2 local changesets published |
|
208 | 208 | |
|
209 | 209 | Feature works over SSH |
|
210 | 210 | |
|
211 | 211 | $ hg clone -U -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/server ssh-full-clone |
|
212 | 212 | applying clone bundle from http://localhost:$HGPORT1/full.hg |
|
213 | 213 | adding changesets |
|
214 | 214 | adding manifests |
|
215 | 215 | adding file changes |
|
216 | 216 | added 2 changesets with 2 changes to 2 files |
|
217 | 217 | finished applying clone bundle |
|
218 | 218 | searching for changes |
|
219 | 219 | no changes found |
|
220 | 220 | 2 local changesets published |
|
221 | 221 | |
|
222 | 222 | Entry with unknown BUNDLESPEC is filtered and not used |
|
223 | 223 | |
|
224 | 224 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
225 | 225 | > http://bad.entry1 BUNDLESPEC=UNKNOWN |
|
226 | 226 | > http://bad.entry2 BUNDLESPEC=xz-v1 |
|
227 | 227 | > http://bad.entry3 BUNDLESPEC=none-v100 |
|
228 | 228 | > http://localhost:$HGPORT1/full.hg BUNDLESPEC=gzip-v2 |
|
229 | 229 | > EOF |
|
230 | 230 | |
|
231 | 231 | $ hg clone -U http://localhost:$HGPORT filter-unknown-type |
|
232 | 232 | applying clone bundle from http://localhost:$HGPORT1/full.hg |
|
233 | 233 | adding changesets |
|
234 | 234 | adding manifests |
|
235 | 235 | adding file changes |
|
236 | 236 | added 2 changesets with 2 changes to 2 files |
|
237 | 237 | finished applying clone bundle |
|
238 | 238 | searching for changes |
|
239 | 239 | no changes found |
|
240 | 240 | 2 local changesets published |
|
241 | 241 | |
|
242 | 242 | Automatic fallback when all entries are filtered |
|
243 | 243 | |
|
244 | 244 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
245 | 245 | > http://bad.entry BUNDLESPEC=UNKNOWN |
|
246 | 246 | > EOF |
|
247 | 247 | |
|
248 | 248 | $ hg clone -U http://localhost:$HGPORT filter-all |
|
249 | 249 | no compatible clone bundles available on server; falling back to regular clone |
|
250 | 250 | (you may want to report this to the server operator) |
|
251 | 251 | requesting all changes |
|
252 | 252 | adding changesets |
|
253 | 253 | adding manifests |
|
254 | 254 | adding file changes |
|
255 | 255 | added 2 changesets with 2 changes to 2 files |
|
256 | 256 | new changesets 53245c60e682:aaff8d2ffbbf |
|
257 | 257 | |
|
258 | 258 | URLs requiring SNI are filtered in Python <2.7.9 |
|
259 | 259 | |
|
260 | 260 | $ cp full.hg sni.hg |
|
261 | 261 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
262 | 262 | > http://localhost:$HGPORT1/sni.hg REQUIRESNI=true |
|
263 | 263 | > http://localhost:$HGPORT1/full.hg |
|
264 | 264 | > EOF |
|
265 | 265 | |
|
266 | 266 | #if sslcontext |
|
267 | 267 | Python 2.7.9+ support SNI |
|
268 | 268 | |
|
269 | 269 | $ hg clone -U http://localhost:$HGPORT sni-supported |
|
270 | 270 | applying clone bundle from http://localhost:$HGPORT1/sni.hg |
|
271 | 271 | adding changesets |
|
272 | 272 | adding manifests |
|
273 | 273 | adding file changes |
|
274 | 274 | added 2 changesets with 2 changes to 2 files |
|
275 | 275 | finished applying clone bundle |
|
276 | 276 | searching for changes |
|
277 | 277 | no changes found |
|
278 | 278 | 2 local changesets published |
|
279 | 279 | #else |
|
280 | 280 | Python <2.7.9 will filter SNI URLs |
|
281 | 281 | |
|
282 | 282 | $ hg clone -U http://localhost:$HGPORT sni-unsupported |
|
283 | 283 | applying clone bundle from http://localhost:$HGPORT1/full.hg |
|
284 | 284 | adding changesets |
|
285 | 285 | adding manifests |
|
286 | 286 | adding file changes |
|
287 | 287 | added 2 changesets with 2 changes to 2 files |
|
288 | 288 | finished applying clone bundle |
|
289 | 289 | searching for changes |
|
290 | 290 | no changes found |
|
291 | 291 | 2 local changesets published |
|
292 | 292 | #endif |
|
293 | 293 | |
|
294 | 294 | Stream clone bundles are supported |
|
295 | 295 | |
|
296 | 296 | $ hg -R server debugcreatestreamclonebundle packed.hg |
|
297 | 297 | writing 613 bytes for 4 files |
|
298 | 298 | bundle requirements: generaldelta, revlogv1, sparserevlog |
|
299 | 299 | |
|
300 | 300 | No bundle spec should work |
|
301 | 301 | |
|
302 | 302 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
303 | 303 | > http://localhost:$HGPORT1/packed.hg |
|
304 | 304 | > EOF |
|
305 | 305 | |
|
306 | 306 | $ hg clone -U http://localhost:$HGPORT stream-clone-no-spec |
|
307 | 307 | applying clone bundle from http://localhost:$HGPORT1/packed.hg |
|
308 | 308 | 4 files to transfer, 613 bytes of data |
|
309 | 309 | transferred 613 bytes in *.* seconds (*) (glob) |
|
310 | 310 | finished applying clone bundle |
|
311 | 311 | searching for changes |
|
312 | 312 | no changes found |
|
313 | 313 | |
|
314 | 314 | Bundle spec without parameters should work |
|
315 | 315 | |
|
316 | 316 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
317 | 317 | > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1 |
|
318 | 318 | > EOF |
|
319 | 319 | |
|
320 | 320 | $ hg clone -U http://localhost:$HGPORT stream-clone-vanilla-spec |
|
321 | 321 | applying clone bundle from http://localhost:$HGPORT1/packed.hg |
|
322 | 322 | 4 files to transfer, 613 bytes of data |
|
323 | 323 | transferred 613 bytes in *.* seconds (*) (glob) |
|
324 | 324 | finished applying clone bundle |
|
325 | 325 | searching for changes |
|
326 | 326 | no changes found |
|
327 | 327 | |
|
328 | 328 | Bundle spec with format requirements should work |
|
329 | 329 | |
|
330 | 330 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
331 | 331 | > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv1 |
|
332 | 332 | > EOF |
|
333 | 333 | |
|
334 | 334 | $ hg clone -U http://localhost:$HGPORT stream-clone-supported-requirements |
|
335 | 335 | applying clone bundle from http://localhost:$HGPORT1/packed.hg |
|
336 | 336 | 4 files to transfer, 613 bytes of data |
|
337 | 337 | transferred 613 bytes in *.* seconds (*) (glob) |
|
338 | 338 | finished applying clone bundle |
|
339 | 339 | searching for changes |
|
340 | 340 | no changes found |
|
341 | 341 | |
|
342 | 342 | Stream bundle spec with unknown requirements should be filtered out |
|
343 | 343 | |
|
344 | 344 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
345 | 345 | > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv42 |
|
346 | 346 | > EOF |
|
347 | 347 | |
|
348 | 348 | $ hg clone -U http://localhost:$HGPORT stream-clone-unsupported-requirements |
|
349 | 349 | no compatible clone bundles available on server; falling back to regular clone |
|
350 | 350 | (you may want to report this to the server operator) |
|
351 | 351 | requesting all changes |
|
352 | 352 | adding changesets |
|
353 | 353 | adding manifests |
|
354 | 354 | adding file changes |
|
355 | 355 | added 2 changesets with 2 changes to 2 files |
|
356 | 356 | new changesets 53245c60e682:aaff8d2ffbbf |
|
357 | 357 | |
|
358 | 358 | Set up manifest for testing preferences |
|
359 | 359 | (Remember, the TYPE does not have to match reality - the URL is |
|
360 | 360 | important) |
|
361 | 361 | |
|
362 | 362 | $ cp full.hg gz-a.hg |
|
363 | 363 | $ cp full.hg gz-b.hg |
|
364 | 364 | $ cp full.hg bz2-a.hg |
|
365 | 365 | $ cp full.hg bz2-b.hg |
|
366 | 366 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
367 | 367 | > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 extra=a |
|
368 | 368 | > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2 extra=a |
|
369 | 369 | > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b |
|
370 | 370 | > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b |
|
371 | 371 | > EOF |
|
372 | 372 | |
|
373 | 373 | Preferring an undefined attribute will take first entry |
|
374 | 374 | |
|
375 | 375 | $ hg --config ui.clonebundleprefers=foo=bar clone -U http://localhost:$HGPORT prefer-foo |
|
376 | 376 | applying clone bundle from http://localhost:$HGPORT1/gz-a.hg |
|
377 | 377 | adding changesets |
|
378 | 378 | adding manifests |
|
379 | 379 | adding file changes |
|
380 | 380 | added 2 changesets with 2 changes to 2 files |
|
381 | 381 | finished applying clone bundle |
|
382 | 382 | searching for changes |
|
383 | 383 | no changes found |
|
384 | 384 | 2 local changesets published |
|
385 | 385 | |
|
386 | 386 | Preferring bz2 type will download first entry of that type |
|
387 | 387 | |
|
388 | 388 | $ hg --config ui.clonebundleprefers=COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-bz |
|
389 | 389 | applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg |
|
390 | 390 | adding changesets |
|
391 | 391 | adding manifests |
|
392 | 392 | adding file changes |
|
393 | 393 | added 2 changesets with 2 changes to 2 files |
|
394 | 394 | finished applying clone bundle |
|
395 | 395 | searching for changes |
|
396 | 396 | no changes found |
|
397 | 397 | 2 local changesets published |
|
398 | 398 | |
|
399 | 399 | Preferring multiple values of an option works |
|
400 | 400 | |
|
401 | 401 | $ hg --config ui.clonebundleprefers=COMPRESSION=unknown,COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-multiple-bz |
|
402 | 402 | applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg |
|
403 | 403 | adding changesets |
|
404 | 404 | adding manifests |
|
405 | 405 | adding file changes |
|
406 | 406 | added 2 changesets with 2 changes to 2 files |
|
407 | 407 | finished applying clone bundle |
|
408 | 408 | searching for changes |
|
409 | 409 | no changes found |
|
410 | 410 | 2 local changesets published |
|
411 | 411 | |
|
412 | 412 | Sorting multiple values should get us back to original first entry |
|
413 | 413 | |
|
414 | 414 | $ hg --config ui.clonebundleprefers=BUNDLESPEC=unknown,BUNDLESPEC=gzip-v2,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-multiple-gz |
|
415 | 415 | applying clone bundle from http://localhost:$HGPORT1/gz-a.hg |
|
416 | 416 | adding changesets |
|
417 | 417 | adding manifests |
|
418 | 418 | adding file changes |
|
419 | 419 | added 2 changesets with 2 changes to 2 files |
|
420 | 420 | finished applying clone bundle |
|
421 | 421 | searching for changes |
|
422 | 422 | no changes found |
|
423 | 423 | 2 local changesets published |
|
424 | 424 | |
|
425 | 425 | Preferring multiple attributes has correct order |
|
426 | 426 | |
|
427 | 427 | $ hg --config ui.clonebundleprefers=extra=b,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-separate-attributes |
|
428 | 428 | applying clone bundle from http://localhost:$HGPORT1/bz2-b.hg |
|
429 | 429 | adding changesets |
|
430 | 430 | adding manifests |
|
431 | 431 | adding file changes |
|
432 | 432 | added 2 changesets with 2 changes to 2 files |
|
433 | 433 | finished applying clone bundle |
|
434 | 434 | searching for changes |
|
435 | 435 | no changes found |
|
436 | 436 | 2 local changesets published |
|
437 | 437 | |
|
438 | 438 | Test where attribute is missing from some entries |
|
439 | 439 | |
|
440 | 440 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
441 | 441 | > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 |
|
442 | 442 | > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2 |
|
443 | 443 | > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b |
|
444 | 444 | > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b |
|
445 | 445 | > EOF |
|
446 | 446 | |
|
447 | 447 | $ hg --config ui.clonebundleprefers=extra=b clone -U http://localhost:$HGPORT prefer-partially-defined-attribute |
|
448 | 448 | applying clone bundle from http://localhost:$HGPORT1/gz-b.hg |
|
449 | 449 | adding changesets |
|
450 | 450 | adding manifests |
|
451 | 451 | adding file changes |
|
452 | 452 | added 2 changesets with 2 changes to 2 files |
|
453 | 453 | finished applying clone bundle |
|
454 | 454 | searching for changes |
|
455 | 455 | no changes found |
|
456 | 456 | 2 local changesets published |
|
457 | 457 | |
|
458 | 458 | Test interaction between clone bundles and --stream |
|
459 | 459 | |
|
460 | 460 | A manifest with just a gzip bundle |
|
461 | 461 | |
|
462 | 462 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
463 | 463 | > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 |
|
464 | 464 | > EOF |
|
465 | 465 | |
|
466 | 466 | $ hg clone -U --stream http://localhost:$HGPORT uncompressed-gzip |
|
467 | 467 | no compatible clone bundles available on server; falling back to regular clone |
|
468 | 468 | (you may want to report this to the server operator) |
|
469 | 469 | streaming all changes |
|
470 | 470 | 9 files to transfer, 816 bytes of data |
|
471 | 471 | transferred 816 bytes in * seconds (*) (glob) |
|
472 | 472 | |
|
473 | 473 | A manifest with a stream clone but no BUNDLESPEC |
|
474 | 474 | |
|
475 | 475 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
476 | 476 | > http://localhost:$HGPORT1/packed.hg |
|
477 | 477 | > EOF |
|
478 | 478 | |
|
479 | 479 | $ hg clone -U --stream http://localhost:$HGPORT uncompressed-no-bundlespec |
|
480 | 480 | no compatible clone bundles available on server; falling back to regular clone |
|
481 | 481 | (you may want to report this to the server operator) |
|
482 | 482 | streaming all changes |
|
483 | 483 | 9 files to transfer, 816 bytes of data |
|
484 | 484 | transferred 816 bytes in * seconds (*) (glob) |
|
485 | 485 | |
|
486 | 486 | A manifest with a gzip bundle and a stream clone |
|
487 | 487 | |
|
488 | 488 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
489 | 489 | > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 |
|
490 | 490 | > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1 |
|
491 | 491 | > EOF |
|
492 | 492 | |
|
493 | 493 | $ hg clone -U --stream http://localhost:$HGPORT uncompressed-gzip-packed |
|
494 | 494 | applying clone bundle from http://localhost:$HGPORT1/packed.hg |
|
495 | 495 | 4 files to transfer, 613 bytes of data |
|
496 | 496 | transferred 613 bytes in * seconds (*) (glob) |
|
497 | 497 | finished applying clone bundle |
|
498 | 498 | searching for changes |
|
499 | 499 | no changes found |
|
500 | 500 | |
|
501 | 501 | A manifest with a gzip bundle and stream clone with supported requirements |
|
502 | 502 | |
|
503 | 503 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
504 | 504 | > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 |
|
505 | 505 | > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv1 |
|
506 | 506 | > EOF |
|
507 | 507 | |
|
508 | 508 | $ hg clone -U --stream http://localhost:$HGPORT uncompressed-gzip-packed-requirements |
|
509 | 509 | applying clone bundle from http://localhost:$HGPORT1/packed.hg |
|
510 | 510 | 4 files to transfer, 613 bytes of data |
|
511 | 511 | transferred 613 bytes in * seconds (*) (glob) |
|
512 | 512 | finished applying clone bundle |
|
513 | 513 | searching for changes |
|
514 | 514 | no changes found |
|
515 | 515 | |
|
516 | 516 | A manifest with a gzip bundle and a stream clone with unsupported requirements |
|
517 | 517 | |
|
518 | 518 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
519 | 519 | > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 |
|
520 | 520 | > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv42 |
|
521 | 521 | > EOF |
|
522 | 522 | |
|
523 | 523 | $ hg clone -U --stream http://localhost:$HGPORT uncompressed-gzip-packed-unsupported-requirements |
|
524 | 524 | no compatible clone bundles available on server; falling back to regular clone |
|
525 | 525 | (you may want to report this to the server operator) |
|
526 | 526 | streaming all changes |
|
527 | 527 | 9 files to transfer, 816 bytes of data |
|
528 | 528 | transferred 816 bytes in * seconds (*) (glob) |
|
529 | 529 | |
|
530 | 530 | Test clone bundle retrieved through bundle2 |
|
531 | 531 | |
|
532 | 532 | $ cat << EOF >> $HGRCPATH |
|
533 | 533 | > [extensions] |
|
534 | 534 | > largefiles= |
|
535 | 535 | > EOF |
|
536 | 536 | $ killdaemons.py |
|
537 | 537 | $ hg -R server serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log |
|
538 | 538 | $ cat hg.pid >> $DAEMON_PIDS |
|
539 | 539 | |
|
540 | 540 | $ hg -R server debuglfput gz-a.hg |
|
541 | 541 | 1f74b3d08286b9b3a16fb3fa185dd29219cbc6ae |
|
542 | 542 | |
|
543 | 543 | $ cat > server/.hg/clonebundles.manifest << EOF |
|
544 | 544 | > largefile://1f74b3d08286b9b3a16fb3fa185dd29219cbc6ae BUNDLESPEC=gzip-v2 |
|
545 | 545 | > EOF |
|
546 | 546 | |
|
547 | 547 | $ hg clone -U http://localhost:$HGPORT largefile-provided --traceback |
|
548 | 548 | applying clone bundle from largefile://1f74b3d08286b9b3a16fb3fa185dd29219cbc6ae |
|
549 | 549 | adding changesets |
|
550 | 550 | adding manifests |
|
551 | 551 | adding file changes |
|
552 | 552 | added 2 changesets with 2 changes to 2 files |
|
553 | 553 | finished applying clone bundle |
|
554 | 554 | searching for changes |
|
555 | 555 | no changes found |
|
556 | 556 | 2 local changesets published |
@@ -1,122 +1,122 b'' | |||
|
1 | 1 | #require serve |
|
2 | 2 | |
|
3 | 3 | $ hg init a |
|
4 | 4 | $ cd a |
|
5 | 5 | $ echo a > a |
|
6 | 6 | $ hg ci -Ama -d '1123456789 0' |
|
7 | 7 | adding a |
|
8 | 8 | $ hg serve --config server.uncompressed=True -p $HGPORT -d --pid-file=hg.pid |
|
9 | 9 | $ cat hg.pid >> $DAEMON_PIDS |
|
10 | 10 | $ cd .. |
|
11 | 11 | $ tinyproxy.py $HGPORT1 localhost 2>proxy.log >/dev/null </dev/null & |
|
12 | 12 | $ while [ ! -f proxy.pid ]; do sleep 0; done |
|
13 | 13 | $ cat proxy.pid >> $DAEMON_PIDS |
|
14 | 14 | |
|
15 | 15 | url for proxy, stream |
|
16 | 16 | |
|
17 | 17 | $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone --stream http://localhost:$HGPORT/ b |
|
18 | 18 | streaming all changes |
|
19 | 19 | 6 files to transfer, 412 bytes of data (reporevlogstore !) |
|
20 | 20 | 4 files to transfer, 330 bytes of data (reposimplestore !) |
|
21 | 21 | transferred * bytes in * seconds (*/sec) (glob) |
|
22 | 22 | updating to branch default |
|
23 | 23 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
24 | 24 | $ cd b |
|
25 | 25 | $ hg verify |
|
26 | 26 | checking changesets |
|
27 | 27 | checking manifests |
|
28 | 28 | crosschecking files in changesets and manifests |
|
29 | 29 | checking files |
|
30 | 30 | checked 1 changesets with 1 changes to 1 files |
|
31 | 31 | $ cd .. |
|
32 | 32 | |
|
33 | 33 | url for proxy, pull |
|
34 | 34 | |
|
35 | 35 | $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone http://localhost:$HGPORT/ b-pull |
|
36 | 36 | requesting all changes |
|
37 | 37 | adding changesets |
|
38 | 38 | adding manifests |
|
39 | 39 | adding file changes |
|
40 | 40 | added 1 changesets with 1 changes to 1 files |
|
41 | 41 | new changesets 83180e7845de |
|
42 | 42 | updating to branch default |
|
43 | 43 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
44 | 44 | $ cd b-pull |
|
45 | 45 | $ hg verify |
|
46 | 46 | checking changesets |
|
47 | 47 | checking manifests |
|
48 | 48 | crosschecking files in changesets and manifests |
|
49 | 49 | checking files |
|
50 | 50 | checked 1 changesets with 1 changes to 1 files |
|
51 | 51 | $ cd .. |
|
52 | 52 | |
|
53 | 53 | host:port for proxy |
|
54 | 54 | |
|
55 | 55 | $ http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ c |
|
56 | 56 | requesting all changes |
|
57 | 57 | adding changesets |
|
58 | 58 | adding manifests |
|
59 | 59 | adding file changes |
|
60 | 60 | added 1 changesets with 1 changes to 1 files |
|
61 | 61 | new changesets 83180e7845de |
|
62 | 62 | updating to branch default |
|
63 | 63 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
64 | 64 | |
|
65 | 65 | proxy url with user name and password |
|
66 | 66 | |
|
67 | 67 | $ http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ d |
|
68 | 68 | requesting all changes |
|
69 | 69 | adding changesets |
|
70 | 70 | adding manifests |
|
71 | 71 | adding file changes |
|
72 | 72 | added 1 changesets with 1 changes to 1 files |
|
73 | 73 | new changesets 83180e7845de |
|
74 | 74 | updating to branch default |
|
75 | 75 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
76 | 76 | |
|
77 | 77 | url with user name and password |
|
78 | 78 | |
|
79 | 79 | $ http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://user:passwd@localhost:$HGPORT/ e |
|
80 | 80 | requesting all changes |
|
81 | 81 | adding changesets |
|
82 | 82 | adding manifests |
|
83 | 83 | adding file changes |
|
84 | 84 | added 1 changesets with 1 changes to 1 files |
|
85 | 85 | new changesets 83180e7845de |
|
86 | 86 | updating to branch default |
|
87 | 87 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
88 | 88 | |
|
89 | 89 | bad host:port for proxy ("Protocol not supported" can happen on |
|
90 | 90 | misconfigured hosts) |
|
91 | 91 | |
|
92 | 92 | $ http_proxy=localhost:$HGPORT2 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ f |
|
93 | abort: error: (Connection refused|Protocol not supported|.* actively refused it|\$EADDRNOTAVAIL\$) (re) | |
|
93 | abort: error: (Connection refused|Protocol not supported|.* actively refused it|\$EADDRNOTAVAIL\$|No route to host) (re) | |
|
94 | 94 | [255] |
|
95 | 95 | |
|
96 | 96 | do not use the proxy if it is in the no list |
|
97 | 97 | |
|
98 | 98 | $ http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.no=localhost http://localhost:$HGPORT/ g |
|
99 | 99 | requesting all changes |
|
100 | 100 | adding changesets |
|
101 | 101 | adding manifests |
|
102 | 102 | adding file changes |
|
103 | 103 | added 1 changesets with 1 changes to 1 files |
|
104 | 104 | new changesets 83180e7845de |
|
105 | 105 | updating to branch default |
|
106 | 106 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
107 | 107 | $ cat proxy.log |
|
108 | 108 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) |
|
109 | 109 | $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
110 | 110 | $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&stream=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
111 | 111 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) |
|
112 | 112 | $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
113 | 113 | $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
114 | 114 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) |
|
115 | 115 | $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
116 | 116 | $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
117 | 117 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) |
|
118 | 118 | $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
119 | 119 | $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
120 | 120 | * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob) |
|
121 | 121 | $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
122 | 122 | $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
@@ -1,481 +1,482 b'' | |||
|
1 | 1 | #require serve no-reposimplestore no-chg |
|
2 | 2 | |
|
3 | 3 | $ cat >> $HGRCPATH <<EOF |
|
4 | 4 | > [extensions] |
|
5 | 5 | > lfs= |
|
6 | 6 | > [lfs] |
|
7 | 7 | > track=all() |
|
8 | 8 | > [web] |
|
9 | 9 | > push_ssl = False |
|
10 | 10 | > allow-push = * |
|
11 | 11 | > EOF |
|
12 | 12 | |
|
13 | 13 | Serving LFS files can experimentally be turned off. The long term solution is |
|
14 | 14 | to support the 'verify' action in both client and server, so that the server can |
|
15 | 15 | tell the client to store files elsewhere. |
|
16 | 16 | |
|
17 | 17 | $ hg init server |
|
18 | 18 | $ hg --config "lfs.usercache=$TESTTMP/servercache" \ |
|
19 | 19 | > --config experimental.lfs.serve=False -R server serve -d \ |
|
20 | 20 | > -p $HGPORT --pid-file=hg.pid -A $TESTTMP/access.log -E $TESTTMP/errors.log |
|
21 | 21 | $ cat hg.pid >> $DAEMON_PIDS |
|
22 | 22 | |
|
23 | 23 | Uploads fail... |
|
24 | 24 | |
|
25 | 25 | $ hg init client |
|
26 | 26 | $ echo 'this-is-an-lfs-file' > client/lfs.bin |
|
27 | 27 | $ hg -R client ci -Am 'initial commit' |
|
28 | 28 | adding lfs.bin |
|
29 | 29 | $ hg -R client push http://localhost:$HGPORT |
|
30 | 30 | pushing to http://localhost:$HGPORT/ |
|
31 | 31 | searching for changes |
|
32 | 32 | abort: LFS HTTP error: HTTP Error 400: no such method: .git! |
|
33 | 33 | (check that lfs serving is enabled on http://localhost:$HGPORT/.git/info/lfs and "upload" is supported) |
|
34 | 34 | [255] |
|
35 | 35 | |
|
36 | 36 | ... so do a local push to make the data available. Remove the blob from the |
|
37 | 37 | default cache, so it attempts to download. |
|
38 | 38 | $ hg --config "lfs.usercache=$TESTTMP/servercache" \ |
|
39 | 39 | > --config "lfs.url=null://" \ |
|
40 | 40 | > -R client push -q server |
|
41 | 41 | $ mv `hg config lfs.usercache` $TESTTMP/servercache |
|
42 | 42 | |
|
43 | 43 | Downloads fail... |
|
44 | 44 | |
|
45 | 45 | $ hg clone http://localhost:$HGPORT httpclone |
|
46 | 46 | (remote is using large file support (lfs); lfs will be enabled for this repository) |
|
47 | 47 | requesting all changes |
|
48 | 48 | adding changesets |
|
49 | 49 | adding manifests |
|
50 | 50 | adding file changes |
|
51 | 51 | added 1 changesets with 1 changes to 1 files |
|
52 | 52 | new changesets 525251863cad |
|
53 | 53 | updating to branch default |
|
54 | 54 | abort: LFS HTTP error: HTTP Error 400: no such method: .git! |
|
55 | 55 | (check that lfs serving is enabled on http://localhost:$HGPORT/.git/info/lfs and "download" is supported) |
|
56 | 56 | [255] |
|
57 | 57 | |
|
58 | 58 | $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS |
|
59 | 59 | |
|
60 | 60 | $ cat $TESTTMP/access.log $TESTTMP/errors.log |
|
61 | 61 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
62 | 62 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D525251863cad618e55d483555f3d00a2ca99597e x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
63 | 63 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
64 | 64 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
65 | 65 | $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 400 - (glob) |
|
66 | 66 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
67 | 67 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
68 | 68 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Arev-branch-cache%250Astream%253Dv2&cg=1&common=0000000000000000000000000000000000000000&heads=525251863cad618e55d483555f3d00a2ca99597e&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
69 | 69 | $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 400 - (glob) |
|
70 | 70 | |
|
71 | 71 | $ rm -f $TESTTMP/access.log $TESTTMP/errors.log |
|
72 | 72 | $ hg --config "lfs.usercache=$TESTTMP/servercache" -R server serve -d \ |
|
73 | 73 | > -p $HGPORT --pid-file=hg.pid --prefix=subdir/mount/point \ |
|
74 | 74 | > -A $TESTTMP/access.log -E $TESTTMP/errors.log |
|
75 | 75 | $ cat hg.pid >> $DAEMON_PIDS |
|
76 | 76 | |
|
77 | 77 | Reasonable hint for a misconfigured blob server |
|
78 | 78 | |
|
79 | 79 | $ hg -R httpclone update default --config lfs.url=http://localhost:$HGPORT/missing |
|
80 | 80 | abort: LFS HTTP error: HTTP Error 404: Not Found! |
|
81 | 81 | (the "lfs.url" config may be used to override http://localhost:$HGPORT/missing) |
|
82 | 82 | [255] |
|
83 | 83 | |
|
84 | 84 | $ hg -R httpclone update default --config lfs.url=http://localhost:$HGPORT2/missing |
|
85 | 85 | abort: LFS error: *onnection *refused*! (glob) (?) |
|
86 | 86 | abort: LFS error: $EADDRNOTAVAIL$! (glob) (?) |
|
87 | abort: LFS error: No route to host! (?) | |
|
87 | 88 | (the "lfs.url" config may be used to override http://localhost:$HGPORT2/missing) |
|
88 | 89 | [255] |
|
89 | 90 | |
|
90 | 91 | Blob URIs are correct when --prefix is used |
|
91 | 92 | |
|
92 | 93 | $ hg clone --debug http://localhost:$HGPORT/subdir/mount/point cloned2 |
|
93 | 94 | using http://localhost:$HGPORT/subdir/mount/point |
|
94 | 95 | sending capabilities command |
|
95 | 96 | (remote is using large file support (lfs); lfs will be enabled for this repository) |
|
96 | 97 | query 1; heads |
|
97 | 98 | sending batch command |
|
98 | 99 | requesting all changes |
|
99 | 100 | sending getbundle command |
|
100 | 101 | bundle2-input-bundle: with-transaction |
|
101 | 102 | bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported |
|
102 | 103 | adding changesets |
|
103 | 104 | add changeset 525251863cad |
|
104 | 105 | adding manifests |
|
105 | 106 | adding file changes |
|
106 | 107 | adding lfs.bin revisions |
|
107 | 108 | added 1 changesets with 1 changes to 1 files |
|
108 | 109 | bundle2-input-part: total payload size 648 |
|
109 | 110 | bundle2-input-part: "listkeys" (params: 1 mandatory) supported |
|
110 | 111 | bundle2-input-part: "phase-heads" supported |
|
111 | 112 | bundle2-input-part: total payload size 24 |
|
112 | 113 | bundle2-input-part: "cache:rev-branch-cache" (advisory) supported |
|
113 | 114 | bundle2-input-part: total payload size 39 |
|
114 | 115 | bundle2-input-bundle: 3 parts total |
|
115 | 116 | checking for updated bookmarks |
|
116 | 117 | updating the branch cache |
|
117 | 118 | new changesets 525251863cad |
|
118 | 119 | updating to branch default |
|
119 | 120 | resolving manifests |
|
120 | 121 | branchmerge: False, force: False, partial: False |
|
121 | 122 | ancestor: 000000000000, local: 000000000000+, remote: 525251863cad |
|
122 | 123 | lfs: assuming remote store: http://localhost:$HGPORT/subdir/mount/point/.git/info/lfs |
|
123 | 124 | Status: 200 |
|
124 | 125 | Content-Length: 371 |
|
125 | 126 | Content-Type: application/vnd.git-lfs+json |
|
126 | 127 | Date: $HTTP_DATE$ |
|
127 | 128 | Server: testing stub value |
|
128 | 129 | { |
|
129 | 130 | "objects": [ |
|
130 | 131 | { |
|
131 | 132 | "actions": { |
|
132 | 133 | "download": { |
|
133 | 134 | "expires_at": "$ISO_8601_DATE_TIME$" |
|
134 | 135 | "header": { |
|
135 | 136 | "Accept": "application/vnd.git-lfs" |
|
136 | 137 | } |
|
137 | 138 | "href": "http://localhost:$HGPORT/subdir/mount/point/.hg/lfs/objects/f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e" |
|
138 | 139 | } |
|
139 | 140 | } |
|
140 | 141 | "oid": "f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e" |
|
141 | 142 | "size": 20 |
|
142 | 143 | } |
|
143 | 144 | ] |
|
144 | 145 | "transfer": "basic" |
|
145 | 146 | } |
|
146 | 147 | lfs: downloading f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e (20 bytes) |
|
147 | 148 | Status: 200 |
|
148 | 149 | Content-Length: 20 |
|
149 | 150 | Content-Type: application/octet-stream |
|
150 | 151 | Date: $HTTP_DATE$ |
|
151 | 152 | Server: testing stub value |
|
152 | 153 | lfs: adding f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e to the usercache |
|
153 | 154 | lfs: processed: f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e |
|
154 | 155 | lfs: downloaded 1 files (20 bytes) |
|
155 | 156 | lfs.bin: remote created -> g |
|
156 | 157 | getting lfs.bin |
|
157 | 158 | lfs: found f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e in the local lfs store |
|
158 | 159 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
159 | 160 | (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob) |
|
160 | 161 | |
|
161 | 162 | $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS |
|
162 | 163 | |
|
163 | 164 | $ cat $TESTTMP/access.log $TESTTMP/errors.log |
|
164 | 165 | $LOCALIP - - [$LOGDATE$] "POST /missing/objects/batch HTTP/1.1" 404 - (glob) |
|
165 | 166 | $LOCALIP - - [$LOGDATE$] "GET /subdir/mount/point?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
166 | 167 | $LOCALIP - - [$LOGDATE$] "GET /subdir/mount/point?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
167 | 168 | $LOCALIP - - [$LOGDATE$] "GET /subdir/mount/point?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Arev-branch-cache%250Astream%253Dv2&cg=1&common=0000000000000000000000000000000000000000&heads=525251863cad618e55d483555f3d00a2ca99597e&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
168 | 169 | $LOCALIP - - [$LOGDATE$] "POST /subdir/mount/point/.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) |
|
169 | 170 | $LOCALIP - - [$LOGDATE$] "GET /subdir/mount/point/.hg/lfs/objects/f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e HTTP/1.1" 200 - (glob) |
|
170 | 171 | |
|
171 | 172 | Blobs that already exist in the usercache are linked into the repo store, even |
|
172 | 173 | though the client doesn't send the blob. |
|
173 | 174 | |
|
174 | 175 | $ hg init server2 |
|
175 | 176 | $ hg --config "lfs.usercache=$TESTTMP/servercache" -R server2 serve -d \ |
|
176 | 177 | > -p $HGPORT --pid-file=hg.pid \ |
|
177 | 178 | > -A $TESTTMP/access.log -E $TESTTMP/errors.log |
|
178 | 179 | $ cat hg.pid >> $DAEMON_PIDS |
|
179 | 180 | |
|
180 | 181 | $ hg --config "lfs.usercache=$TESTTMP/servercache" -R cloned2 --debug \ |
|
181 | 182 | > push http://localhost:$HGPORT | grep '^[{} ]' |
|
182 | 183 | { |
|
183 | 184 | "objects": [ |
|
184 | 185 | { |
|
185 | 186 | "oid": "f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e" |
|
186 | 187 | "size": 20 |
|
187 | 188 | } |
|
188 | 189 | ] |
|
189 | 190 | "transfer": "basic" |
|
190 | 191 | } |
|
191 | 192 | $ find server2/.hg/store/lfs/objects | sort |
|
192 | 193 | server2/.hg/store/lfs/objects |
|
193 | 194 | server2/.hg/store/lfs/objects/f0 |
|
194 | 195 | server2/.hg/store/lfs/objects/f0/3217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e |
|
195 | 196 | $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS |
|
196 | 197 | $ cat $TESTTMP/errors.log |
|
197 | 198 | |
|
198 | 199 | $ cat >> $TESTTMP/lfsstoreerror.py <<EOF |
|
199 | 200 | > import errno |
|
200 | 201 | > from hgext.lfs import blobstore |
|
201 | 202 | > |
|
202 | 203 | > _numverifies = 0 |
|
203 | 204 | > _readerr = True |
|
204 | 205 | > |
|
205 | 206 | > def reposetup(ui, repo): |
|
206 | 207 | > # Nothing to do with a remote repo |
|
207 | 208 | > if not repo.local(): |
|
208 | 209 | > return |
|
209 | 210 | > |
|
210 | 211 | > store = repo.svfs.lfslocalblobstore |
|
211 | 212 | > class badstore(store.__class__): |
|
212 | 213 | > def download(self, oid, src): |
|
213 | 214 | > '''Called in the server to handle reading from the client in a |
|
214 | 215 | > PUT request.''' |
|
215 | 216 | > origread = src.read |
|
216 | 217 | > def _badread(nbytes): |
|
217 | 218 | > # Simulate bad data/checksum failure from the client |
|
218 | 219 | > return b'0' * len(origread(nbytes)) |
|
219 | 220 | > src.read = _badread |
|
220 | 221 | > super(badstore, self).download(oid, src) |
|
221 | 222 | > |
|
222 | 223 | > def _read(self, vfs, oid, verify): |
|
223 | 224 | > '''Called in the server to read data for a GET request, and then |
|
224 | 225 | > calls self._verify() on it before returning.''' |
|
225 | 226 | > global _readerr |
|
226 | 227 | > # One time simulation of a read error |
|
227 | 228 | > if _readerr: |
|
228 | 229 | > _readerr = False |
|
229 | 230 | > raise IOError(errno.EIO, '%s: I/O error' % oid) |
|
230 | 231 | > # Simulate corrupt content on client download |
|
231 | 232 | > blobstore._verify(oid, 'dummy content') |
|
232 | 233 | > |
|
233 | 234 | > def verify(self, oid): |
|
234 | 235 | > '''Called in the server to populate the Batch API response, |
|
235 | 236 | > letting the client re-upload if the file is corrupt.''' |
|
236 | 237 | > # Fail verify in Batch API for one clone command and one push |
|
237 | 238 | > # command with an IOError. Then let it through to access other |
|
238 | 239 | > # functions. Checksum failure is tested elsewhere. |
|
239 | 240 | > global _numverifies |
|
240 | 241 | > _numverifies += 1 |
|
241 | 242 | > if _numverifies <= 2: |
|
242 | 243 | > raise IOError(errno.EIO, '%s: I/O error' % oid) |
|
243 | 244 | > return super(badstore, self).verify(oid) |
|
244 | 245 | > |
|
245 | 246 | > store.__class__ = badstore |
|
246 | 247 | > EOF |
|
247 | 248 | |
|
248 | 249 | $ rm -rf `hg config lfs.usercache` |
|
249 | 250 | $ rm -f $TESTTMP/access.log $TESTTMP/errors.log |
|
250 | 251 | $ hg --config "lfs.usercache=$TESTTMP/servercache" \ |
|
251 | 252 | > --config extensions.lfsstoreerror=$TESTTMP/lfsstoreerror.py \ |
|
252 | 253 | > -R server serve -d \ |
|
253 | 254 | > -p $HGPORT1 --pid-file=hg.pid -A $TESTTMP/access.log -E $TESTTMP/errors.log |
|
254 | 255 | $ cat hg.pid >> $DAEMON_PIDS |
|
255 | 256 | |
|
256 | 257 | Test an I/O error in localstore.verify() (Batch API) with GET |
|
257 | 258 | |
|
258 | 259 | $ hg clone http://localhost:$HGPORT1 httpclone2 |
|
259 | 260 | (remote is using large file support (lfs); lfs will be enabled for this repository) |
|
260 | 261 | requesting all changes |
|
261 | 262 | adding changesets |
|
262 | 263 | adding manifests |
|
263 | 264 | adding file changes |
|
264 | 265 | added 1 changesets with 1 changes to 1 files |
|
265 | 266 | new changesets 525251863cad |
|
266 | 267 | updating to branch default |
|
267 | 268 | abort: LFS server error for "lfs.bin": Internal server error! |
|
268 | 269 | [255] |
|
269 | 270 | |
|
270 | 271 | Test an I/O error in localstore.verify() (Batch API) with PUT |
|
271 | 272 | |
|
272 | 273 | $ echo foo > client/lfs.bin |
|
273 | 274 | $ hg -R client ci -m 'mod lfs' |
|
274 | 275 | $ hg -R client push http://localhost:$HGPORT1 |
|
275 | 276 | pushing to http://localhost:$HGPORT1/ |
|
276 | 277 | searching for changes |
|
277 | 278 | abort: LFS server error for "unknown": Internal server error! |
|
278 | 279 | [255] |
|
279 | 280 | TODO: figure out how to associate the file name in the error above |
|
280 | 281 | |
|
281 | 282 | Test a bad checksum sent by the client in the transfer API |
|
282 | 283 | |
|
283 | 284 | $ hg -R client push http://localhost:$HGPORT1 |
|
284 | 285 | pushing to http://localhost:$HGPORT1/ |
|
285 | 286 | searching for changes |
|
286 | 287 | abort: LFS HTTP error: HTTP Error 422: corrupt blob (oid=b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c, action=upload)! |
|
287 | 288 | [255] |
|
288 | 289 | |
|
289 | 290 | $ echo 'test lfs file' > server/lfs3.bin |
|
290 | 291 | $ hg --config experimental.lfs.disableusercache=True \ |
|
291 | 292 | > -R server ci -Aqm 'another lfs file' |
|
292 | 293 | $ hg -R client pull -q http://localhost:$HGPORT1 |
|
293 | 294 | |
|
294 | 295 | Test an I/O error during the processing of the GET request |
|
295 | 296 | |
|
296 | 297 | $ hg --config lfs.url=http://localhost:$HGPORT1/.git/info/lfs \ |
|
297 | 298 | > -R client update -r tip |
|
298 | 299 | abort: LFS HTTP error: HTTP Error 500: Internal Server Error (oid=276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d, action=download)! |
|
299 | 300 | [255] |
|
300 | 301 | |
|
301 | 302 | Test a checksum failure during the processing of the GET request |
|
302 | 303 | |
|
303 | 304 | $ hg --config lfs.url=http://localhost:$HGPORT1/.git/info/lfs \ |
|
304 | 305 | > -R client update -r tip |
|
305 | 306 | abort: LFS HTTP error: HTTP Error 422: corrupt blob (oid=276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d, action=download)! |
|
306 | 307 | [255] |
|
307 | 308 | |
|
308 | 309 | $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS |
|
309 | 310 | |
|
310 | 311 | $ cat $TESTTMP/access.log |
|
311 | 312 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
312 | 313 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
313 | 314 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Arev-branch-cache%250Astream%253Dv2&cg=1&common=0000000000000000000000000000000000000000&heads=525251863cad618e55d483555f3d00a2ca99597e&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
314 | 315 | $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) |
|
315 | 316 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
316 | 317 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D392c05922088bacf8e68a6939b480017afbf245d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
317 | 318 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
318 | 319 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
319 | 320 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
320 | 321 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
321 | 322 | $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) |
|
322 | 323 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
323 | 324 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D392c05922088bacf8e68a6939b480017afbf245d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
324 | 325 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
325 | 326 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
326 | 327 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
327 | 328 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
328 | 329 | $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) |
|
329 | 330 | $LOCALIP - - [$LOGDATE$] "PUT /.hg/lfs/objects/b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c HTTP/1.1" 422 - (glob) |
|
330 | 331 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
331 | 332 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D392c05922088bacf8e68a6939b480017afbf245d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
332 | 333 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Arev-branch-cache%250Astream%253Dv2&cg=1&common=525251863cad618e55d483555f3d00a2ca99597e&heads=506bf3d83f78c54b89e81c6411adee19fdf02156+525251863cad618e55d483555f3d00a2ca99597e&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
333 | 334 | $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) |
|
334 | 335 | $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d HTTP/1.1" 500 - (glob) |
|
335 | 336 | $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) |
|
336 | 337 | $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d HTTP/1.1" 422 - (glob) |
|
337 | 338 | |
|
338 | 339 | $ grep -v ' File "' $TESTTMP/errors.log |
|
339 | 340 | $LOCALIP - - [$ERRDATE$] HG error: Exception happened while processing request '/.git/info/lfs/objects/batch': (glob) |
|
340 | 341 | $LOCALIP - - [$ERRDATE$] HG error: Traceback (most recent call last): (glob) |
|
341 | 342 | $LOCALIP - - [$ERRDATE$] HG error: verifies = store.verify(oid) (glob) |
|
342 | 343 | $LOCALIP - - [$ERRDATE$] HG error: raise IOError(errno.EIO, '%s: I/O error' % oid) (glob) |
|
343 | 344 | $LOCALIP - - [$ERRDATE$] HG error: IOError: [Errno 5] f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e: I/O error (glob) |
|
344 | 345 | $LOCALIP - - [$ERRDATE$] HG error: (glob) |
|
345 | 346 | $LOCALIP - - [$ERRDATE$] HG error: Exception happened while processing request '/.git/info/lfs/objects/batch': (glob) |
|
346 | 347 | $LOCALIP - - [$ERRDATE$] HG error: Traceback (most recent call last): (glob) |
|
347 | 348 | $LOCALIP - - [$ERRDATE$] HG error: verifies = store.verify(oid) (glob) |
|
348 | 349 | $LOCALIP - - [$ERRDATE$] HG error: raise IOError(errno.EIO, '%s: I/O error' % oid) (glob) |
|
349 | 350 | $LOCALIP - - [$ERRDATE$] HG error: IOError: [Errno 5] b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c: I/O error (glob) |
|
350 | 351 | $LOCALIP - - [$ERRDATE$] HG error: (glob) |
|
351 | 352 | $LOCALIP - - [$ERRDATE$] HG error: Exception happened while processing request '/.hg/lfs/objects/b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c': (glob) |
|
352 | 353 | $LOCALIP - - [$ERRDATE$] HG error: Traceback (most recent call last): (glob) |
|
353 | 354 | $LOCALIP - - [$ERRDATE$] HG error: localstore.download(oid, req.bodyfh) (glob) |
|
354 | 355 | $LOCALIP - - [$ERRDATE$] HG error: super(badstore, self).download(oid, src) (glob) |
|
355 | 356 | $LOCALIP - - [$ERRDATE$] HG error: % oid) (glob) |
|
356 | 357 | $LOCALIP - - [$ERRDATE$] HG error: LfsCorruptionError: corrupt remote lfs object: b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c (glob) |
|
357 | 358 | $LOCALIP - - [$ERRDATE$] HG error: (glob) |
|
358 | 359 | $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/.hg/lfs/objects/276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d': (glob) |
|
359 | 360 | Traceback (most recent call last): |
|
360 | 361 | self.do_write() |
|
361 | 362 | self.do_hgweb() |
|
362 | 363 | for chunk in self.server.application(env, self._start_response): |
|
363 | 364 | for r in self._runwsgi(req, res, repo): |
|
364 | 365 | rctx, req, res, self.check_perm) |
|
365 | 366 | return func(*(args + a), **kw) |
|
366 | 367 | lambda perm: |
|
367 | 368 | res.setbodybytes(localstore.read(oid)) |
|
368 | 369 | blob = self._read(self.vfs, oid, verify) |
|
369 | 370 | raise IOError(errno.EIO, '%s: I/O error' % oid) |
|
370 | 371 | IOError: [Errno 5] 276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d: I/O error |
|
371 | 372 | |
|
372 | 373 | $LOCALIP - - [$ERRDATE$] HG error: Exception happened while processing request '/.hg/lfs/objects/276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d': (glob) |
|
373 | 374 | $LOCALIP - - [$ERRDATE$] HG error: Traceback (most recent call last): (glob) |
|
374 | 375 | $LOCALIP - - [$ERRDATE$] HG error: res.setbodybytes(localstore.read(oid)) (glob) |
|
375 | 376 | $LOCALIP - - [$ERRDATE$] HG error: blob = self._read(self.vfs, oid, verify) (glob) |
|
376 | 377 | $LOCALIP - - [$ERRDATE$] HG error: blobstore._verify(oid, 'dummy content') (glob) |
|
377 | 378 | $LOCALIP - - [$ERRDATE$] HG error: hint=_('run hg verify')) (glob) |
|
378 | 379 | $LOCALIP - - [$ERRDATE$] HG error: LfsCorruptionError: detected corrupt lfs object: 276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d (glob) |
|
379 | 380 | $LOCALIP - - [$ERRDATE$] HG error: (glob) |
|
380 | 381 | |
|
381 | 382 | Basic Authorization headers are returned by the Batch API, and sent back with |
|
382 | 383 | the GET/PUT request. |
|
383 | 384 | |
|
384 | 385 | $ rm -f $TESTTMP/access.log $TESTTMP/errors.log |
|
385 | 386 | |
|
386 | 387 | $ cat >> $HGRCPATH << EOF |
|
387 | 388 | > [experimental] |
|
388 | 389 | > lfs.disableusercache = True |
|
389 | 390 | > [auth] |
|
390 | 391 | > l.schemes=http |
|
391 | 392 | > l.prefix=lo |
|
392 | 393 | > l.username=user |
|
393 | 394 | > l.password=pass |
|
394 | 395 | > EOF |
|
395 | 396 | |
|
396 | 397 | $ cat << EOF > userpass.py |
|
397 | 398 | > import base64 |
|
398 | 399 | > from mercurial.hgweb import common |
|
399 | 400 | > def perform_authentication(hgweb, req, op): |
|
400 | 401 | > auth = req.headers.get(b'Authorization') |
|
401 | 402 | > if not auth: |
|
402 | 403 | > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, b'who', |
|
403 | 404 | > [(b'WWW-Authenticate', b'Basic Realm="mercurial"')]) |
|
404 | 405 | > if base64.b64decode(auth.split()[1]).split(b':', 1) != [b'user', |
|
405 | 406 | > b'pass']: |
|
406 | 407 | > raise common.ErrorResponse(common.HTTP_FORBIDDEN, b'no') |
|
407 | 408 | > def extsetup(ui): |
|
408 | 409 | > common.permhooks.insert(0, perform_authentication) |
|
409 | 410 | > EOF |
|
410 | 411 | |
|
411 | 412 | $ hg --config extensions.x=$TESTTMP/userpass.py \ |
|
412 | 413 | > -R server serve -d -p $HGPORT1 --pid-file=hg.pid \ |
|
413 | 414 | > -A $TESTTMP/access.log -E $TESTTMP/errors.log |
|
414 | 415 | $ mv hg.pid $DAEMON_PIDS |
|
415 | 416 | |
|
416 | 417 | $ hg clone --debug http://localhost:$HGPORT1 auth_clone | egrep '^[{}]| ' |
|
417 | 418 | { |
|
418 | 419 | "objects": [ |
|
419 | 420 | { |
|
420 | 421 | "actions": { |
|
421 | 422 | "download": { |
|
422 | 423 | "expires_at": "$ISO_8601_DATE_TIME$" |
|
423 | 424 | "header": { |
|
424 | 425 | "Accept": "application/vnd.git-lfs" |
|
425 | 426 | "Authorization": "Basic dXNlcjpwYXNz" |
|
426 | 427 | } |
|
427 | 428 | "href": "http://localhost:$HGPORT1/.hg/lfs/objects/276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d" |
|
428 | 429 | } |
|
429 | 430 | } |
|
430 | 431 | "oid": "276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d" |
|
431 | 432 | "size": 14 |
|
432 | 433 | } |
|
433 | 434 | ] |
|
434 | 435 | "transfer": "basic" |
|
435 | 436 | } |
|
436 | 437 | |
|
437 | 438 | $ echo 'another blob' > auth_clone/lfs.blob |
|
438 | 439 | $ hg -R auth_clone ci -Aqm 'add blob' |
|
439 | 440 | $ hg -R auth_clone --debug push | egrep '^[{}]| ' |
|
440 | 441 | { |
|
441 | 442 | "objects": [ |
|
442 | 443 | { |
|
443 | 444 | "actions": { |
|
444 | 445 | "upload": { |
|
445 | 446 | "expires_at": "$ISO_8601_DATE_TIME$" |
|
446 | 447 | "header": { |
|
447 | 448 | "Accept": "application/vnd.git-lfs" |
|
448 | 449 | "Authorization": "Basic dXNlcjpwYXNz" |
|
449 | 450 | } |
|
450 | 451 | "href": "http://localhost:$HGPORT1/.hg/lfs/objects/df14287d8d75f076a6459e7a3703ca583ca9fb3f4918caed10c77ac8622d49b3" |
|
451 | 452 | } |
|
452 | 453 | } |
|
453 | 454 | "oid": "df14287d8d75f076a6459e7a3703ca583ca9fb3f4918caed10c77ac8622d49b3" |
|
454 | 455 | "size": 13 |
|
455 | 456 | } |
|
456 | 457 | ] |
|
457 | 458 | "transfer": "basic" |
|
458 | 459 | } |
|
459 | 460 | |
|
460 | 461 | $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS |
|
461 | 462 | |
|
462 | 463 | $ cat $TESTTMP/access.log $TESTTMP/errors.log |
|
463 | 464 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 401 - (glob) |
|
464 | 465 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
465 | 466 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
466 | 467 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Arev-branch-cache%250Astream%253Dv2&cg=1&common=0000000000000000000000000000000000000000&heads=506bf3d83f78c54b89e81c6411adee19fdf02156+525251863cad618e55d483555f3d00a2ca99597e&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
467 | 468 | $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 401 - (glob) |
|
468 | 469 | $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) |
|
469 | 470 | $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d HTTP/1.1" 200 - (glob) |
|
470 | 471 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 401 - (glob) |
|
471 | 472 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
472 | 473 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D525251863cad618e55d483555f3d00a2ca99597e+4d9397055dc0c205f3132f331f36353ab1a525a3 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
473 | 474 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
474 | 475 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
475 | 476 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
476 | 477 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
477 | 478 | $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 401 - (glob) |
|
478 | 479 | $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) |
|
479 | 480 | $LOCALIP - - [$LOGDATE$] "PUT /.hg/lfs/objects/df14287d8d75f076a6459e7a3703ca583ca9fb3f4918caed10c77ac8622d49b3 HTTP/1.1" 201 - (glob) |
|
480 | 481 | $LOCALIP - - [$LOGDATE$] "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
|
481 | 482 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob) |
General Comments 0
You need to be logged in to leave comments.
Login now