Show More
@@ -1,1221 +1,1233 b'' | |||
|
1 | $ "$TESTDIR/hghave" serve || exit 80 | |
|
2 | 1 |
|
|
3 | $ mkdir -p ${USERCACHE} | |
|
2 | $ mkdir -p "${USERCACHE}" | |
|
4 | 3 | $ cat >> $HGRCPATH <<EOF |
|
5 | 4 | > [extensions] |
|
6 | 5 | > largefiles= |
|
7 | 6 | > purge= |
|
8 | 7 | > rebase= |
|
9 | 8 | > transplant= |
|
10 | 9 | > [phases] |
|
11 | 10 | > publish=False |
|
12 | 11 | > [largefiles] |
|
13 | 12 | > minsize=2 |
|
14 | 13 | > patterns=glob:**.dat |
|
15 | 14 | > usercache=${USERCACHE} |
|
16 | 15 | > [hooks] |
|
17 | 16 | > precommit=sh -c "echo \"Invoking status precommit hook\"; hg status" |
|
18 | 17 | > EOF |
|
19 | 18 | |
|
20 | 19 | Create the repo with a couple of revisions of both large and normal |
|
21 | 20 | files, testing that status correctly shows largefiles and that summary output |
|
22 | 21 | is correct. |
|
23 | 22 | |
|
24 | 23 | $ hg init a |
|
25 | 24 | $ cd a |
|
26 | 25 | $ mkdir sub |
|
27 | 26 | $ echo normal1 > normal1 |
|
28 | 27 | $ echo normal2 > sub/normal2 |
|
29 | 28 | $ echo large1 > large1 |
|
30 | 29 | $ echo large2 > sub/large2 |
|
31 | 30 | $ hg add normal1 sub/normal2 |
|
32 | 31 | $ hg add --large large1 sub/large2 |
|
33 | 32 | $ hg commit -m "add files" |
|
34 | 33 | Invoking status precommit hook |
|
35 | 34 | A large1 |
|
36 | 35 | A normal1 |
|
37 | 36 | A sub/large2 |
|
38 | 37 | A sub/normal2 |
|
39 | 38 | $ echo normal11 > normal1 |
|
40 | 39 | $ echo normal22 > sub/normal2 |
|
41 | 40 | $ echo large11 > large1 |
|
42 | 41 | $ echo large22 > sub/large2 |
|
43 | 42 | $ hg commit -m "edit files" |
|
44 | 43 | Invoking status precommit hook |
|
45 | 44 | M large1 |
|
46 | 45 | M normal1 |
|
47 | 46 | M sub/large2 |
|
48 | 47 | M sub/normal2 |
|
49 | 48 | $ hg sum --large |
|
50 | 49 | parent: 1:ce8896473775 tip |
|
51 | 50 | edit files |
|
52 | 51 | branch: default |
|
53 | 52 | commit: (clean) |
|
54 | 53 | update: (current) |
|
55 | 54 | largefiles: No remote repo |
|
56 | 55 | |
|
57 | 56 | Commit preserved largefile contents. |
|
58 | 57 | |
|
59 | 58 | $ cat normal1 |
|
60 | 59 | normal11 |
|
61 | 60 | $ cat large1 |
|
62 | 61 | large11 |
|
63 | 62 | $ cat sub/normal2 |
|
64 | 63 | normal22 |
|
65 | 64 | $ cat sub/large2 |
|
66 | 65 | large22 |
|
67 | 66 | |
|
68 | 67 | Test status, subdir and unknown files |
|
69 | 68 | |
|
70 | 69 | $ echo unknown > sub/unknown |
|
71 | 70 | $ hg st --all |
|
72 | 71 | ? sub/unknown |
|
73 | 72 | C large1 |
|
74 | 73 | C normal1 |
|
75 | 74 | C sub/large2 |
|
76 | 75 | C sub/normal2 |
|
77 | 76 | $ hg st --all sub |
|
78 | 77 | ? sub/unknown |
|
79 | 78 | C sub/large2 |
|
80 | 79 | C sub/normal2 |
|
81 | 80 | $ rm sub/unknown |
|
82 | 81 | |
|
83 | 82 | Remove both largefiles and normal files. |
|
84 | 83 | |
|
85 | 84 | $ hg remove normal1 large1 |
|
86 | 85 | $ hg status large1 |
|
87 | 86 | R large1 |
|
88 | 87 | $ hg commit -m "remove files" |
|
89 | 88 | Invoking status precommit hook |
|
90 | 89 | R large1 |
|
91 | 90 | R normal1 |
|
92 | 91 | $ ls |
|
93 | 92 | sub |
|
94 | 93 | $ echo "testlargefile" > large1-test |
|
95 | 94 | $ hg add --large large1-test |
|
96 | 95 | $ hg st |
|
97 | 96 | A large1-test |
|
98 | 97 | $ hg rm large1-test |
|
99 | 98 | not removing large1-test: file has been marked for add (use forget to undo) |
|
100 | 99 | $ hg st |
|
101 | 100 | A large1-test |
|
102 | 101 | $ hg forget large1-test |
|
103 | 102 | $ hg st |
|
104 | 103 | ? large1-test |
|
105 | 104 | $ rm large1-test |
|
106 | 105 | |
|
107 | 106 | Copy both largefiles and normal files (testing that status output is correct). |
|
108 | 107 | |
|
109 | 108 | $ hg cp sub/normal2 normal1 |
|
110 | 109 | $ hg cp sub/large2 large1 |
|
111 | 110 | $ hg commit -m "copy files" |
|
112 | 111 | Invoking status precommit hook |
|
113 | 112 | A large1 |
|
114 | 113 | A normal1 |
|
115 | 114 | $ cat normal1 |
|
116 | 115 | normal22 |
|
117 | 116 | $ cat large1 |
|
118 | 117 | large22 |
|
119 | 118 | |
|
120 | 119 | Test moving largefiles and verify that normal files are also unaffected. |
|
121 | 120 | |
|
122 | 121 | $ hg mv normal1 normal3 |
|
123 | 122 | $ hg mv large1 large3 |
|
124 | 123 | $ hg mv sub/normal2 sub/normal4 |
|
125 | 124 | $ hg mv sub/large2 sub/large4 |
|
126 | 125 | $ hg commit -m "move files" |
|
127 | 126 | Invoking status precommit hook |
|
128 | 127 | A large3 |
|
129 | 128 | A normal3 |
|
130 | 129 | A sub/large4 |
|
131 | 130 | A sub/normal4 |
|
132 | 131 | R large1 |
|
133 | 132 | R normal1 |
|
134 | 133 | R sub/large2 |
|
135 | 134 | R sub/normal2 |
|
136 | 135 | $ cat normal3 |
|
137 | 136 | normal22 |
|
138 | 137 | $ cat large3 |
|
139 | 138 | large22 |
|
140 | 139 | $ cat sub/normal4 |
|
141 | 140 | normal22 |
|
142 | 141 | $ cat sub/large4 |
|
143 | 142 | large22 |
|
144 | 143 | |
|
144 | #if hgweb | |
|
145 | 145 | Test display of largefiles in hgweb |
|
146 | 146 | |
|
147 | 147 | $ hg serve -d -p $HGPORT --pid-file ../hg.pid |
|
148 | 148 | $ cat ../hg.pid >> $DAEMON_PIDS |
|
149 | 149 | $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/?style=raw' |
|
150 | 150 | 200 Script output follows |
|
151 | 151 | |
|
152 | 152 | |
|
153 | 153 | drwxr-xr-x sub |
|
154 | 154 | -rw-r--r-- 41 large3 |
|
155 | 155 | -rw-r--r-- 9 normal3 |
|
156 | 156 | |
|
157 | 157 | |
|
158 | 158 | $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/sub/?style=raw' |
|
159 | 159 | 200 Script output follows |
|
160 | 160 | |
|
161 | 161 | |
|
162 | 162 | -rw-r--r-- 41 large4 |
|
163 | 163 | -rw-r--r-- 9 normal4 |
|
164 | 164 | |
|
165 | 165 | |
|
166 | 166 | $ "$TESTDIR/killdaemons.py" |
|
167 | #endif | |
|
167 | 168 | |
|
168 | 169 | Test archiving the various revisions. These hit corner cases known with |
|
169 | 170 | archiving. |
|
170 | 171 | |
|
171 | 172 | $ hg archive -r 0 ../archive0 |
|
172 | 173 | $ hg archive -r 1 ../archive1 |
|
173 | 174 | $ hg archive -r 2 ../archive2 |
|
174 | 175 | $ hg archive -r 3 ../archive3 |
|
175 | 176 | $ hg archive -r 4 ../archive4 |
|
176 | 177 | $ cd ../archive0 |
|
177 | 178 | $ cat normal1 |
|
178 | 179 | normal1 |
|
179 | 180 | $ cat large1 |
|
180 | 181 | large1 |
|
181 | 182 | $ cat sub/normal2 |
|
182 | 183 | normal2 |
|
183 | 184 | $ cat sub/large2 |
|
184 | 185 | large2 |
|
185 | 186 | $ cd ../archive1 |
|
186 | 187 | $ cat normal1 |
|
187 | 188 | normal11 |
|
188 | 189 | $ cat large1 |
|
189 | 190 | large11 |
|
190 | 191 | $ cat sub/normal2 |
|
191 | 192 | normal22 |
|
192 | 193 | $ cat sub/large2 |
|
193 | 194 | large22 |
|
194 | 195 | $ cd ../archive2 |
|
195 | 196 | $ ls |
|
196 | 197 | sub |
|
197 | 198 | $ cat sub/normal2 |
|
198 | 199 | normal22 |
|
199 | 200 | $ cat sub/large2 |
|
200 | 201 | large22 |
|
201 | 202 | $ cd ../archive3 |
|
202 | 203 | $ cat normal1 |
|
203 | 204 | normal22 |
|
204 | 205 | $ cat large1 |
|
205 | 206 | large22 |
|
206 | 207 | $ cat sub/normal2 |
|
207 | 208 | normal22 |
|
208 | 209 | $ cat sub/large2 |
|
209 | 210 | large22 |
|
210 | 211 | $ cd ../archive4 |
|
211 | 212 | $ cat normal3 |
|
212 | 213 | normal22 |
|
213 | 214 | $ cat large3 |
|
214 | 215 | large22 |
|
215 | 216 | $ cat sub/normal4 |
|
216 | 217 | normal22 |
|
217 | 218 | $ cat sub/large4 |
|
218 | 219 | large22 |
|
219 | 220 | |
|
220 | 221 | Commit corner case: specify files to commit. |
|
221 | 222 | |
|
222 | 223 | $ cd ../a |
|
223 | 224 | $ echo normal3 > normal3 |
|
224 | 225 | $ echo large3 > large3 |
|
225 | 226 | $ echo normal4 > sub/normal4 |
|
226 | 227 | $ echo large4 > sub/large4 |
|
227 | 228 | $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again" |
|
228 | 229 | Invoking status precommit hook |
|
229 | 230 | M large3 |
|
230 | 231 | M normal3 |
|
231 | 232 | M sub/large4 |
|
232 | 233 | M sub/normal4 |
|
233 | 234 | $ cat normal3 |
|
234 | 235 | normal3 |
|
235 | 236 | $ cat large3 |
|
236 | 237 | large3 |
|
237 | 238 | $ cat sub/normal4 |
|
238 | 239 | normal4 |
|
239 | 240 | $ cat sub/large4 |
|
240 | 241 | large4 |
|
241 | 242 | |
|
242 | 243 | One more commit corner case: commit from a subdirectory. |
|
243 | 244 | |
|
244 | 245 | $ cd ../a |
|
245 | 246 | $ echo normal33 > normal3 |
|
246 | 247 | $ echo large33 > large3 |
|
247 | 248 | $ echo normal44 > sub/normal4 |
|
248 | 249 | $ echo large44 > sub/large4 |
|
249 | 250 | $ cd sub |
|
250 | 251 | $ hg commit -m "edit files yet again" |
|
251 | 252 | Invoking status precommit hook |
|
252 | 253 | M large3 |
|
253 | 254 | M normal3 |
|
254 | 255 | M sub/large4 |
|
255 | 256 | M sub/normal4 |
|
256 | 257 | $ cat ../normal3 |
|
257 | 258 | normal33 |
|
258 | 259 | $ cat ../large3 |
|
259 | 260 | large33 |
|
260 | 261 | $ cat normal4 |
|
261 | 262 | normal44 |
|
262 | 263 | $ cat large4 |
|
263 | 264 | large44 |
|
264 | 265 | |
|
265 | 266 | Committing standins is not allowed. |
|
266 | 267 | |
|
267 | 268 | $ cd .. |
|
268 | 269 | $ echo large3 > large3 |
|
269 | 270 | $ hg commit .hglf/large3 -m "try to commit standin" |
|
270 | 271 | abort: file ".hglf/large3" is a largefile standin |
|
271 | 272 | (commit the largefile itself instead) |
|
272 | 273 | [255] |
|
273 | 274 | |
|
274 | 275 | Corner cases for adding largefiles. |
|
275 | 276 | |
|
276 | 277 | $ echo large5 > large5 |
|
277 | 278 | $ hg add --large large5 |
|
278 | 279 | $ hg add --large large5 |
|
279 | 280 | large5 already a largefile |
|
280 | 281 | $ mkdir sub2 |
|
281 | 282 | $ echo large6 > sub2/large6 |
|
282 | 283 | $ echo large7 > sub2/large7 |
|
283 | 284 | $ hg add --large sub2 |
|
284 | 285 | adding sub2/large6 as a largefile (glob) |
|
285 | 286 | adding sub2/large7 as a largefile (glob) |
|
286 | 287 | $ hg st |
|
287 | 288 | M large3 |
|
288 | 289 | A large5 |
|
289 | 290 | A sub2/large6 |
|
290 | 291 | A sub2/large7 |
|
291 | 292 | |
|
292 | 293 | Test "hg status" with combination of 'file pattern' and 'directory |
|
293 | 294 | pattern' for largefiles: |
|
294 | 295 | |
|
295 | 296 | $ hg status sub2/large6 sub2 |
|
296 | 297 | A sub2/large6 |
|
297 | 298 | A sub2/large7 |
|
298 | 299 | |
|
299 | 300 | Config settings (pattern **.dat, minsize 2 MB) are respected. |
|
300 | 301 | |
|
301 | 302 | $ echo testdata > test.dat |
|
302 | 303 | $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null |
|
303 | 304 | $ hg add |
|
304 | 305 | adding reallylarge as a largefile |
|
305 | 306 | adding test.dat as a largefile |
|
306 | 307 | |
|
307 | 308 | Test that minsize and --lfsize handle float values; |
|
308 | 309 | also tests that --lfsize overrides largefiles.minsize. |
|
309 | 310 | (0.250 MB = 256 kB = 262144 B) |
|
310 | 311 | |
|
311 | 312 | $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null |
|
312 | 313 | $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null |
|
313 | 314 | $ hg --config largefiles.minsize=.25 add |
|
314 | 315 | adding ratherlarge as a largefile |
|
315 | 316 | adding medium |
|
316 | 317 | $ hg forget medium |
|
317 | 318 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 |
|
318 | 319 | adding medium as a largefile |
|
319 | 320 | $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null |
|
320 | 321 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 |
|
321 | 322 | adding notlarge |
|
322 | 323 | $ hg forget notlarge |
|
323 | 324 | |
|
324 | 325 | Test forget on largefiles. |
|
325 | 326 | |
|
326 | 327 | $ hg forget large3 large5 test.dat reallylarge ratherlarge medium |
|
327 | 328 | $ hg commit -m "add/edit more largefiles" |
|
328 | 329 | Invoking status precommit hook |
|
329 | 330 | A sub2/large6 |
|
330 | 331 | A sub2/large7 |
|
331 | 332 | R large3 |
|
332 | 333 | ? large5 |
|
333 | 334 | ? medium |
|
334 | 335 | ? notlarge |
|
335 | 336 | ? ratherlarge |
|
336 | 337 | ? reallylarge |
|
337 | 338 | ? test.dat |
|
338 | 339 | $ hg st |
|
339 | 340 | ? large3 |
|
340 | 341 | ? large5 |
|
341 | 342 | ? medium |
|
342 | 343 | ? notlarge |
|
343 | 344 | ? ratherlarge |
|
344 | 345 | ? reallylarge |
|
345 | 346 | ? test.dat |
|
346 | 347 | |
|
347 | 348 | Purge with largefiles: verify that largefiles are still in the working |
|
348 | 349 | dir after a purge. |
|
349 | 350 | |
|
350 | 351 | $ hg purge --all |
|
351 | 352 | $ cat sub/large4 |
|
352 | 353 | large44 |
|
353 | 354 | $ cat sub2/large6 |
|
354 | 355 | large6 |
|
355 | 356 | $ cat sub2/large7 |
|
356 | 357 | large7 |
|
357 | 358 | |
|
358 | 359 | Test addremove: verify that files that should be added as largfiles are added as |
|
359 | 360 | such and that already-existing largfiles are not added as normal files by |
|
360 | 361 | accident. |
|
361 | 362 | |
|
362 | 363 | $ rm normal3 |
|
363 | 364 | $ rm sub/large4 |
|
364 | 365 | $ echo "testing addremove with patterns" > testaddremove.dat |
|
365 | 366 | $ echo "normaladdremove" > normaladdremove |
|
366 | 367 | $ hg addremove |
|
367 | 368 | removing sub/large4 |
|
368 | 369 | adding testaddremove.dat as a largefile |
|
369 | 370 | removing normal3 |
|
370 | 371 | adding normaladdremove |
|
371 | 372 | |
|
372 | 373 | Clone a largefiles repo. |
|
373 | 374 | |
|
374 | 375 | $ hg clone . ../b |
|
375 | 376 | updating to branch default |
|
376 | 377 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
377 | 378 | getting changed largefiles |
|
378 | 379 | 3 largefiles updated, 0 removed |
|
379 | 380 | $ cd ../b |
|
380 | 381 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
381 | 382 | 7:daea875e9014 add/edit more largefiles |
|
382 | 383 | 6:4355d653f84f edit files yet again |
|
383 | 384 | 5:9d5af5072dbd edit files again |
|
384 | 385 | 4:74c02385b94c move files |
|
385 | 386 | 3:9e8fbc4bce62 copy files |
|
386 | 387 | 2:51a0ae4d5864 remove files |
|
387 | 388 | 1:ce8896473775 edit files |
|
388 | 389 | 0:30d30fe6a5be add files |
|
389 | 390 | $ cat normal3 |
|
390 | 391 | normal33 |
|
391 | 392 | $ cat sub/normal4 |
|
392 | 393 | normal44 |
|
393 | 394 | $ cat sub/large4 |
|
394 | 395 | large44 |
|
395 | 396 | $ cat sub2/large6 |
|
396 | 397 | large6 |
|
397 | 398 | $ cat sub2/large7 |
|
398 | 399 | large7 |
|
399 | 400 | $ cd .. |
|
400 | 401 | $ hg clone a -r 3 c |
|
401 | 402 | adding changesets |
|
402 | 403 | adding manifests |
|
403 | 404 | adding file changes |
|
404 | 405 | added 4 changesets with 10 changes to 4 files |
|
405 | 406 | updating to branch default |
|
406 | 407 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
407 | 408 | getting changed largefiles |
|
408 | 409 | 2 largefiles updated, 0 removed |
|
409 | 410 | $ cd c |
|
410 | 411 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
411 | 412 | 3:9e8fbc4bce62 copy files |
|
412 | 413 | 2:51a0ae4d5864 remove files |
|
413 | 414 | 1:ce8896473775 edit files |
|
414 | 415 | 0:30d30fe6a5be add files |
|
415 | 416 | $ cat normal1 |
|
416 | 417 | normal22 |
|
417 | 418 | $ cat large1 |
|
418 | 419 | large22 |
|
419 | 420 | $ cat sub/normal2 |
|
420 | 421 | normal22 |
|
421 | 422 | $ cat sub/large2 |
|
422 | 423 | large22 |
|
423 | 424 | |
|
424 | 425 | Old revisions of a clone have correct largefiles content (this also |
|
425 | 426 | tests update). |
|
426 | 427 | |
|
427 | 428 | $ hg update -r 1 |
|
428 | 429 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
429 | 430 | getting changed largefiles |
|
430 | 431 | 1 largefiles updated, 0 removed |
|
431 | 432 | $ cat large1 |
|
432 | 433 | large11 |
|
433 | 434 | $ cat sub/large2 |
|
434 | 435 | large22 |
|
435 | 436 | $ cd .. |
|
436 | 437 | |
|
437 | 438 | Test cloning with --all-largefiles flag |
|
438 | 439 | |
|
439 | $ rm -Rf ${USERCACHE}/* | |
|
440 | $ rm -Rf "${USERCACHE}"/* | |
|
440 | 441 | $ hg clone --all-largefiles a a-backup |
|
441 | 442 | updating to branch default |
|
442 | 443 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
443 | 444 | getting changed largefiles |
|
444 | 445 | 3 largefiles updated, 0 removed |
|
445 | 446 | 8 additional largefiles cached |
|
446 | 447 | |
|
447 | 448 | $ hg clone --all-largefiles a ssh://localhost/a |
|
448 | 449 | abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a |
|
449 | 450 | [255] |
|
450 | 451 | |
|
451 | 452 | Test pulling with --all-largefiles flag |
|
452 | 453 | |
|
453 | 454 | $ rm -Rf a-backup |
|
454 | 455 | $ hg clone -r 1 a a-backup |
|
455 | 456 | adding changesets |
|
456 | 457 | adding manifests |
|
457 | 458 | adding file changes |
|
458 | 459 | added 2 changesets with 8 changes to 4 files |
|
459 | 460 | updating to branch default |
|
460 | 461 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
461 | 462 | getting changed largefiles |
|
462 | 463 | 2 largefiles updated, 0 removed |
|
463 | $ rm -Rf ${USERCACHE}/* | |
|
464 | $ rm -Rf "${USERCACHE}"/* | |
|
464 | 465 | $ cd a-backup |
|
465 | 466 | $ hg pull --all-largefiles |
|
466 | 467 | pulling from $TESTTMP/a (glob) |
|
467 | 468 | searching for changes |
|
468 | 469 | adding changesets |
|
469 | 470 | adding manifests |
|
470 | 471 | adding file changes |
|
471 | 472 | added 6 changesets with 16 changes to 8 files |
|
472 | 473 | (run 'hg update' to get a working copy) |
|
473 | 474 | caching new largefiles |
|
474 | 475 | 3 largefiles cached |
|
475 | 476 | 3 additional largefiles cached |
|
476 | 477 | $ cd .. |
|
477 | 478 | |
|
478 | 479 | Rebasing between two repositories does not revert largefiles to old |
|
479 | 480 | revisions (this was a very bad bug that took a lot of work to fix). |
|
480 | 481 | |
|
481 | 482 | $ hg clone a d |
|
482 | 483 | updating to branch default |
|
483 | 484 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
484 | 485 | getting changed largefiles |
|
485 | 486 | 3 largefiles updated, 0 removed |
|
486 | 487 | $ cd b |
|
487 | 488 | $ echo large4-modified > sub/large4 |
|
488 | 489 | $ echo normal3-modified > normal3 |
|
489 | 490 | $ hg commit -m "modify normal file and largefile in repo b" |
|
490 | 491 | Invoking status precommit hook |
|
491 | 492 | M normal3 |
|
492 | 493 | M sub/large4 |
|
493 | 494 | $ cd ../d |
|
494 | 495 | $ echo large6-modified > sub2/large6 |
|
495 | 496 | $ echo normal4-modified > sub/normal4 |
|
496 | 497 | $ hg commit -m "modify normal file largefile in repo d" |
|
497 | 498 | Invoking status precommit hook |
|
498 | 499 | M sub/normal4 |
|
499 | 500 | M sub2/large6 |
|
500 | 501 | $ cd .. |
|
501 | 502 | $ hg clone d e |
|
502 | 503 | updating to branch default |
|
503 | 504 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
504 | 505 | getting changed largefiles |
|
505 | 506 | 3 largefiles updated, 0 removed |
|
506 | 507 | $ cd d |
|
507 | 508 | $ hg pull --rebase ../b |
|
508 | 509 | pulling from ../b |
|
509 | 510 | searching for changes |
|
510 | 511 | adding changesets |
|
511 | 512 | adding manifests |
|
512 | 513 | adding file changes |
|
513 | 514 | added 1 changesets with 2 changes to 2 files (+1 heads) |
|
514 | 515 | Invoking status precommit hook |
|
515 | 516 | M sub/normal4 |
|
516 | 517 | M sub2/large6 |
|
517 | 518 | saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob) |
|
518 | 519 | nothing to rebase |
|
519 | 520 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
520 | 521 | 9:598410d3eb9a modify normal file largefile in repo d |
|
521 | 522 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
522 | 523 | 7:daea875e9014 add/edit more largefiles |
|
523 | 524 | 6:4355d653f84f edit files yet again |
|
524 | 525 | 5:9d5af5072dbd edit files again |
|
525 | 526 | 4:74c02385b94c move files |
|
526 | 527 | 3:9e8fbc4bce62 copy files |
|
527 | 528 | 2:51a0ae4d5864 remove files |
|
528 | 529 | 1:ce8896473775 edit files |
|
529 | 530 | 0:30d30fe6a5be add files |
|
530 | 531 | $ cat normal3 |
|
531 | 532 | normal3-modified |
|
532 | 533 | $ cat sub/normal4 |
|
533 | 534 | normal4-modified |
|
534 | 535 | $ cat sub/large4 |
|
535 | 536 | large4-modified |
|
536 | 537 | $ cat sub2/large6 |
|
537 | 538 | large6-modified |
|
538 | 539 | $ cat sub2/large7 |
|
539 | 540 | large7 |
|
540 | 541 | $ cd ../e |
|
541 | 542 | $ hg pull ../b |
|
542 | 543 | pulling from ../b |
|
543 | 544 | searching for changes |
|
544 | 545 | adding changesets |
|
545 | 546 | adding manifests |
|
546 | 547 | adding file changes |
|
547 | 548 | added 1 changesets with 2 changes to 2 files (+1 heads) |
|
548 | 549 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
549 | 550 | caching new largefiles |
|
550 | 551 | 0 largefiles cached |
|
551 | 552 | $ hg rebase |
|
552 | 553 | Invoking status precommit hook |
|
553 | 554 | M sub/normal4 |
|
554 | 555 | M sub2/large6 |
|
555 | 556 | saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob) |
|
556 | 557 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
557 | 558 | 9:598410d3eb9a modify normal file largefile in repo d |
|
558 | 559 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
559 | 560 | 7:daea875e9014 add/edit more largefiles |
|
560 | 561 | 6:4355d653f84f edit files yet again |
|
561 | 562 | 5:9d5af5072dbd edit files again |
|
562 | 563 | 4:74c02385b94c move files |
|
563 | 564 | 3:9e8fbc4bce62 copy files |
|
564 | 565 | 2:51a0ae4d5864 remove files |
|
565 | 566 | 1:ce8896473775 edit files |
|
566 | 567 | 0:30d30fe6a5be add files |
|
567 | 568 | $ cat normal3 |
|
568 | 569 | normal3-modified |
|
569 | 570 | $ cat sub/normal4 |
|
570 | 571 | normal4-modified |
|
571 | 572 | $ cat sub/large4 |
|
572 | 573 | large4-modified |
|
573 | 574 | $ cat sub2/large6 |
|
574 | 575 | large6-modified |
|
575 | 576 | $ cat sub2/large7 |
|
576 | 577 | large7 |
|
577 | 578 | |
|
578 | 579 | Rollback on largefiles. |
|
579 | 580 | |
|
580 | 581 | $ echo large4-modified-again > sub/large4 |
|
581 | 582 | $ hg commit -m "Modify large4 again" |
|
582 | 583 | Invoking status precommit hook |
|
583 | 584 | M sub/large4 |
|
584 | 585 | $ hg rollback |
|
585 | 586 | repository tip rolled back to revision 9 (undo commit) |
|
586 | 587 | working directory now based on revision 9 |
|
587 | 588 | $ hg st |
|
588 | 589 | M sub/large4 |
|
589 | 590 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
590 | 591 | 9:598410d3eb9a modify normal file largefile in repo d |
|
591 | 592 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
592 | 593 | 7:daea875e9014 add/edit more largefiles |
|
593 | 594 | 6:4355d653f84f edit files yet again |
|
594 | 595 | 5:9d5af5072dbd edit files again |
|
595 | 596 | 4:74c02385b94c move files |
|
596 | 597 | 3:9e8fbc4bce62 copy files |
|
597 | 598 | 2:51a0ae4d5864 remove files |
|
598 | 599 | 1:ce8896473775 edit files |
|
599 | 600 | 0:30d30fe6a5be add files |
|
600 | 601 | $ cat sub/large4 |
|
601 | 602 | large4-modified-again |
|
602 | 603 | |
|
603 | 604 | "update --check" refuses to update with uncommitted changes. |
|
604 | 605 | $ hg update --check 8 |
|
605 | 606 | abort: uncommitted local changes |
|
606 | 607 | [255] |
|
607 | 608 | |
|
608 | 609 | "update --clean" leaves correct largefiles in working copy. |
|
609 | 610 | |
|
610 | 611 | $ hg update --clean |
|
611 | 612 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
612 | 613 | getting changed largefiles |
|
613 | 614 | 1 largefiles updated, 0 removed |
|
614 | 615 | $ cat normal3 |
|
615 | 616 | normal3-modified |
|
616 | 617 | $ cat sub/normal4 |
|
617 | 618 | normal4-modified |
|
618 | 619 | $ cat sub/large4 |
|
619 | 620 | large4-modified |
|
620 | 621 | $ cat sub2/large6 |
|
621 | 622 | large6-modified |
|
622 | 623 | $ cat sub2/large7 |
|
623 | 624 | large7 |
|
624 | 625 | |
|
625 | 626 | Now "update check" is happy. |
|
626 | 627 | $ hg update --check 8 |
|
627 | 628 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
628 | 629 | getting changed largefiles |
|
629 | 630 | 1 largefiles updated, 0 removed |
|
630 | 631 | $ hg update --check |
|
631 | 632 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
632 | 633 | getting changed largefiles |
|
633 | 634 | 1 largefiles updated, 0 removed |
|
634 | 635 | |
|
635 | 636 | Test removing empty largefiles directories on update |
|
636 | 637 | $ test -d sub2 && echo "sub2 exists" |
|
637 | 638 | sub2 exists |
|
638 | 639 | $ hg update -q null |
|
639 | 640 | $ test -d sub2 && echo "error: sub2 should not exist anymore" |
|
640 | 641 | [1] |
|
641 | 642 | $ hg update -q |
|
642 | 643 | |
|
643 | 644 | Test hg remove removes empty largefiles directories |
|
644 | 645 | $ test -d sub2 && echo "sub2 exists" |
|
645 | 646 | sub2 exists |
|
646 | 647 | $ hg remove sub2/* |
|
647 | 648 | $ test -d sub2 && echo "error: sub2 should not exist anymore" |
|
648 | 649 | [1] |
|
649 | 650 | $ hg revert sub2/large6 sub2/large7 |
|
650 | 651 | |
|
651 | 652 | "revert" works on largefiles (and normal files too). |
|
652 | 653 | $ echo hack3 >> normal3 |
|
653 | 654 | $ echo hack4 >> sub/normal4 |
|
654 | 655 | $ echo hack4 >> sub/large4 |
|
655 | 656 | $ rm sub2/large6 |
|
656 | 657 | $ hg revert sub2/large6 |
|
657 | 658 | $ hg rm sub2/large6 |
|
658 | 659 | $ echo new >> sub2/large8 |
|
659 | 660 | $ hg add --large sub2/large8 |
|
660 | 661 | # XXX we don't really want to report that we're reverting the standin; |
|
661 | 662 | # that's just an implementation detail. But I don't see an obvious fix. ;-( |
|
662 | 663 | $ hg revert sub |
|
663 | 664 | reverting .hglf/sub/large4 (glob) |
|
664 | 665 | reverting sub/normal4 (glob) |
|
665 | 666 | $ hg status |
|
666 | 667 | M normal3 |
|
667 | 668 | A sub2/large8 |
|
668 | 669 | R sub2/large6 |
|
669 | 670 | ? sub/large4.orig |
|
670 | 671 | ? sub/normal4.orig |
|
671 | 672 | $ cat sub/normal4 |
|
672 | 673 | normal4-modified |
|
673 | 674 | $ cat sub/large4 |
|
674 | 675 | large4-modified |
|
675 | 676 | $ hg revert -a --no-backup |
|
676 | 677 | undeleting .hglf/sub2/large6 (glob) |
|
677 | 678 | forgetting .hglf/sub2/large8 (glob) |
|
678 | 679 | reverting normal3 |
|
679 | 680 | $ hg status |
|
680 | 681 | ? sub/large4.orig |
|
681 | 682 | ? sub/normal4.orig |
|
682 | 683 | ? sub2/large8 |
|
683 | 684 | $ cat normal3 |
|
684 | 685 | normal3-modified |
|
685 | 686 | $ cat sub2/large6 |
|
686 | 687 | large6-modified |
|
687 | 688 | $ rm sub/*.orig sub2/large8 |
|
688 | 689 | |
|
689 | 690 | revert some files to an older revision |
|
690 | 691 | $ hg revert --no-backup -r 8 sub2 |
|
691 | 692 | reverting .hglf/sub2/large6 (glob) |
|
692 | 693 | $ cat sub2/large6 |
|
693 | 694 | large6 |
|
694 | 695 | $ hg revert --no-backup sub2 |
|
695 | 696 | reverting .hglf/sub2/large6 (glob) |
|
696 | 697 | $ hg status |
|
697 | 698 | |
|
698 | 699 | "verify --large" actually verifies largefiles |
|
699 | 700 | |
|
700 | 701 | $ hg verify --large |
|
701 | 702 | checking changesets |
|
702 | 703 | checking manifests |
|
703 | 704 | crosschecking files in changesets and manifests |
|
704 | 705 | checking files |
|
705 | 706 | 10 files, 10 changesets, 28 total revisions |
|
706 | 707 | searching 1 changesets for largefiles |
|
707 | 708 | verified existence of 3 revisions of 3 largefiles |
|
708 | 709 | |
|
709 | 710 | Merging does not revert to old versions of largefiles and also check |
|
710 | 711 | that merging after having pulled from a non-default remote works |
|
711 | 712 | correctly. |
|
712 | 713 | |
|
713 | 714 | $ cd .. |
|
714 | 715 | $ hg clone -r 7 e temp |
|
715 | 716 | adding changesets |
|
716 | 717 | adding manifests |
|
717 | 718 | adding file changes |
|
718 | 719 | added 8 changesets with 24 changes to 10 files |
|
719 | 720 | updating to branch default |
|
720 | 721 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
721 | 722 | getting changed largefiles |
|
722 | 723 | 3 largefiles updated, 0 removed |
|
723 | 724 | $ hg clone temp f |
|
724 | 725 | updating to branch default |
|
725 | 726 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
726 | 727 | getting changed largefiles |
|
727 | 728 | 3 largefiles updated, 0 removed |
|
728 | 729 | # Delete the largefiles in the largefiles system cache so that we have an |
|
729 | 730 | # opportunity to test that caching after a pull works. |
|
730 | $ rm ${USERCACHE}/* | |
|
731 | $ rm "${USERCACHE}"/* | |
|
731 | 732 | $ cd f |
|
732 | 733 | $ echo "large4-merge-test" > sub/large4 |
|
733 | 734 | $ hg commit -m "Modify large4 to test merge" |
|
734 | 735 | Invoking status precommit hook |
|
735 | 736 | M sub/large4 |
|
736 | 737 | $ hg pull ../e |
|
737 | 738 | pulling from ../e |
|
738 | 739 | searching for changes |
|
739 | 740 | adding changesets |
|
740 | 741 | adding manifests |
|
741 | 742 | adding file changes |
|
742 | 743 | added 2 changesets with 4 changes to 4 files (+1 heads) |
|
743 | 744 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
744 | 745 | caching new largefiles |
|
745 | 746 | 2 largefiles cached |
|
746 | 747 | $ hg merge |
|
747 | 748 | merging sub/large4 |
|
748 | 749 | largefile sub/large4 has a merge conflict |
|
749 | 750 | keep (l)ocal or take (o)ther? l |
|
750 | 751 | 3 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
751 | 752 | (branch merge, don't forget to commit) |
|
752 | 753 | getting changed largefiles |
|
753 | 754 | 1 largefiles updated, 0 removed |
|
754 | 755 | $ hg commit -m "Merge repos e and f" |
|
755 | 756 | Invoking status precommit hook |
|
756 | 757 | M normal3 |
|
757 | 758 | M sub/normal4 |
|
758 | 759 | M sub2/large6 |
|
759 | 760 | $ cat normal3 |
|
760 | 761 | normal3-modified |
|
761 | 762 | $ cat sub/normal4 |
|
762 | 763 | normal4-modified |
|
763 | 764 | $ cat sub/large4 |
|
764 | 765 | large4-merge-test |
|
765 | 766 | $ cat sub2/large6 |
|
766 | 767 | large6-modified |
|
767 | 768 | $ cat sub2/large7 |
|
768 | 769 | large7 |
|
769 | 770 | |
|
770 | 771 | Test status after merging with a branch that introduces a new largefile: |
|
771 | 772 | |
|
772 | 773 | $ echo large > large |
|
773 | 774 | $ hg add --large large |
|
774 | 775 | $ hg commit -m 'add largefile' |
|
775 | 776 | Invoking status precommit hook |
|
776 | 777 | A large |
|
777 | 778 | $ hg update -q ".^" |
|
778 | 779 | $ echo change >> normal3 |
|
779 | 780 | $ hg commit -m 'some change' |
|
780 | 781 | Invoking status precommit hook |
|
781 | 782 | M normal3 |
|
782 | 783 | created new head |
|
783 | 784 | $ hg merge |
|
784 | 785 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
785 | 786 | (branch merge, don't forget to commit) |
|
786 | 787 | getting changed largefiles |
|
787 | 788 | 1 largefiles updated, 0 removed |
|
788 | 789 | $ hg status |
|
789 | 790 | M large |
|
790 | 791 | |
|
791 | 792 | Test that a normal file and a largefile with the same name and path cannot |
|
792 | 793 | coexist. |
|
793 | 794 | |
|
794 | 795 | $ rm sub2/large7 |
|
795 | 796 | $ echo "largeasnormal" > sub2/large7 |
|
796 | 797 | $ hg add sub2/large7 |
|
797 | 798 | sub2/large7 already a largefile |
|
798 | 799 | |
|
799 | 800 | Test that transplanting a largefile change works correctly. |
|
800 | 801 | |
|
801 | 802 | $ cd .. |
|
802 | 803 | $ hg clone -r 8 d g |
|
803 | 804 | adding changesets |
|
804 | 805 | adding manifests |
|
805 | 806 | adding file changes |
|
806 | 807 | added 9 changesets with 26 changes to 10 files |
|
807 | 808 | updating to branch default |
|
808 | 809 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
809 | 810 | getting changed largefiles |
|
810 | 811 | 3 largefiles updated, 0 removed |
|
811 | 812 | $ cd g |
|
812 | 813 | $ hg transplant -s ../d 598410d3eb9a |
|
813 | 814 | searching for changes |
|
814 | 815 | searching for changes |
|
815 | 816 | adding changesets |
|
816 | 817 | adding manifests |
|
817 | 818 | adding file changes |
|
818 | 819 | added 1 changesets with 2 changes to 2 files |
|
819 | 820 | getting changed largefiles |
|
820 | 821 | 1 largefiles updated, 0 removed |
|
821 | 822 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
822 | 823 | 9:598410d3eb9a modify normal file largefile in repo d |
|
823 | 824 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
824 | 825 | 7:daea875e9014 add/edit more largefiles |
|
825 | 826 | 6:4355d653f84f edit files yet again |
|
826 | 827 | 5:9d5af5072dbd edit files again |
|
827 | 828 | 4:74c02385b94c move files |
|
828 | 829 | 3:9e8fbc4bce62 copy files |
|
829 | 830 | 2:51a0ae4d5864 remove files |
|
830 | 831 | 1:ce8896473775 edit files |
|
831 | 832 | 0:30d30fe6a5be add files |
|
832 | 833 | $ cat normal3 |
|
833 | 834 | normal3-modified |
|
834 | 835 | $ cat sub/normal4 |
|
835 | 836 | normal4-modified |
|
836 | 837 | $ cat sub/large4 |
|
837 | 838 | large4-modified |
|
838 | 839 | $ cat sub2/large6 |
|
839 | 840 | large6-modified |
|
840 | 841 | $ cat sub2/large7 |
|
841 | 842 | large7 |
|
842 | 843 | |
|
843 | 844 | Cat a largefile |
|
844 | 845 | $ hg cat normal3 |
|
845 | 846 | normal3-modified |
|
846 | 847 | $ hg cat sub/large4 |
|
847 | 848 | large4-modified |
|
848 | $ rm ${USERCACHE}/* | |
|
849 | $ rm "${USERCACHE}"/* | |
|
849 | 850 | $ hg cat -r a381d2c8c80e -o cat.out sub/large4 |
|
850 | 851 | $ cat cat.out |
|
851 | 852 | large4-modified |
|
852 | 853 | $ rm cat.out |
|
853 | 854 | $ hg cat -r a381d2c8c80e normal3 |
|
854 | 855 | normal3-modified |
|
855 | 856 | |
|
856 | 857 | Test that renaming a largefile results in correct output for status |
|
857 | 858 | |
|
858 | 859 | $ hg rename sub/large4 large4-renamed |
|
859 | 860 | $ hg commit -m "test rename output" |
|
860 | 861 | Invoking status precommit hook |
|
861 | 862 | A large4-renamed |
|
862 | 863 | R sub/large4 |
|
863 | 864 | $ cat large4-renamed |
|
864 | 865 | large4-modified |
|
865 | 866 | $ cd sub2 |
|
866 | 867 | $ hg rename large6 large6-renamed |
|
867 | 868 | $ hg st |
|
868 | 869 | A sub2/large6-renamed |
|
869 | 870 | R sub2/large6 |
|
870 | 871 | $ cd .. |
|
871 | 872 | |
|
872 | 873 | Test --normal flag |
|
873 | 874 | |
|
874 | 875 | $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null |
|
875 | 876 | $ hg add --normal --large new-largefile |
|
876 | 877 | abort: --normal cannot be used with --large |
|
877 | 878 | [255] |
|
878 | 879 | $ hg add --normal new-largefile |
|
879 | 880 | new-largefile: up to 69 MB of RAM may be required to manage this file |
|
880 | 881 | (use 'hg revert new-largefile' to cancel the pending addition) |
|
881 | 882 | $ cd .. |
|
882 | 883 | |
|
884 | #if serve | |
|
883 | 885 | vanilla clients not locked out from largefiles servers on vanilla repos |
|
884 | 886 | $ mkdir r1 |
|
885 | 887 | $ cd r1 |
|
886 | 888 | $ hg init |
|
887 | 889 | $ echo c1 > f1 |
|
888 | 890 | $ hg add f1 |
|
889 | 891 | $ hg commit -m "m1" |
|
890 | 892 | Invoking status precommit hook |
|
891 | 893 | A f1 |
|
892 | 894 | $ cd .. |
|
893 | 895 | $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid |
|
894 | 896 | $ cat hg.pid >> $DAEMON_PIDS |
|
895 | 897 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2 |
|
896 | 898 | requesting all changes |
|
897 | 899 | adding changesets |
|
898 | 900 | adding manifests |
|
899 | 901 | adding file changes |
|
900 | 902 | added 1 changesets with 1 changes to 1 files |
|
901 | 903 | updating to branch default |
|
902 | 904 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
903 | 905 | |
|
904 | 906 | largefiles clients still work with vanilla servers |
|
905 | 907 | $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid |
|
906 | 908 | $ cat hg.pid >> $DAEMON_PIDS |
|
907 | 909 | $ hg clone http://localhost:$HGPORT1 r3 |
|
908 | 910 | requesting all changes |
|
909 | 911 | adding changesets |
|
910 | 912 | adding manifests |
|
911 | 913 | adding file changes |
|
912 | 914 | added 1 changesets with 1 changes to 1 files |
|
913 | 915 | updating to branch default |
|
914 | 916 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
917 | #endif | |
|
918 | ||
|
915 | 919 | |
|
916 | 920 | vanilla clients locked out from largefiles http repos |
|
917 | 921 | $ mkdir r4 |
|
918 | 922 | $ cd r4 |
|
919 | 923 | $ hg init |
|
920 | 924 | $ echo c1 > f1 |
|
921 | 925 | $ hg add --large f1 |
|
922 | 926 | $ hg commit -m "m1" |
|
923 | 927 | Invoking status precommit hook |
|
924 | 928 | A f1 |
|
925 | 929 | $ cd .. |
|
930 | ||
|
931 | #if serve | |
|
926 | 932 | $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid |
|
927 | 933 | $ cat hg.pid >> $DAEMON_PIDS |
|
928 | 934 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5 |
|
929 | 935 | abort: remote error: |
|
930 | 936 | |
|
931 | 937 | This repository uses the largefiles extension. |
|
932 | 938 | |
|
933 | 939 | Please enable it in your Mercurial config file. |
|
934 | 940 | [255] |
|
935 | 941 | |
|
936 | 942 | used all HGPORTs, kill all daemons |
|
937 | 943 | $ "$TESTDIR/killdaemons.py" |
|
944 | #endif | |
|
938 | 945 | |
|
939 | 946 | vanilla clients locked out from largefiles ssh repos |
|
940 | 947 | $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5 |
|
941 | 948 | abort: remote error: |
|
942 | 949 | |
|
943 | 950 | This repository uses the largefiles extension. |
|
944 | 951 | |
|
945 | 952 | Please enable it in your Mercurial config file. |
|
946 | 953 | [255] |
|
947 | 954 | |
|
955 | #if serve | |
|
956 | ||
|
948 | 957 | largefiles clients refuse to push largefiles repos to vanilla servers |
|
949 | 958 | $ mkdir r6 |
|
950 | 959 | $ cd r6 |
|
951 | 960 | $ hg init |
|
952 | 961 | $ echo c1 > f1 |
|
953 | 962 | $ hg add f1 |
|
954 | 963 | $ hg commit -m "m1" |
|
955 | 964 | Invoking status precommit hook |
|
956 | 965 | A f1 |
|
957 | 966 | $ cat >> .hg/hgrc <<! |
|
958 | 967 | > [web] |
|
959 | 968 | > push_ssl = false |
|
960 | 969 | > allow_push = * |
|
961 | 970 | > ! |
|
962 | 971 | $ cd .. |
|
963 | 972 | $ hg clone r6 r7 |
|
964 | 973 | updating to branch default |
|
965 | 974 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
966 | 975 | $ cd r7 |
|
967 | 976 | $ echo c2 > f2 |
|
968 | 977 | $ hg add --large f2 |
|
969 | 978 | $ hg commit -m "m2" |
|
970 | 979 | Invoking status precommit hook |
|
971 | 980 | A f2 |
|
972 | 981 | $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid |
|
973 | 982 | $ cat ../hg.pid >> $DAEMON_PIDS |
|
974 | 983 | $ hg push http://localhost:$HGPORT |
|
975 | 984 | pushing to http://localhost:$HGPORT/ |
|
976 | 985 | searching for changes |
|
977 | 986 | abort: http://localhost:$HGPORT/ does not appear to be a largefile store |
|
978 | 987 | [255] |
|
979 | 988 | $ cd .. |
|
980 | 989 | |
|
981 | 990 | putlfile errors are shown (issue3123) |
|
982 | 991 | Corrupt the cached largefile in r7 |
|
983 | $ echo corruption > $USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8 | |
|
992 | $ echo corruption > "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8" | |
|
984 | 993 | $ hg init empty |
|
985 | 994 | $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \ |
|
986 | 995 | > --config 'web.allow_push=*' --config web.push_ssl=False |
|
987 | 996 | $ cat hg.pid >> $DAEMON_PIDS |
|
988 | 997 | $ hg push -R r7 http://localhost:$HGPORT1 |
|
989 | 998 | pushing to http://localhost:$HGPORT1/ |
|
990 | 999 | searching for changes |
|
991 | 1000 | remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash |
|
992 | 1001 | abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob) |
|
993 | 1002 | [255] |
|
994 | 1003 | $ rm -rf empty |
|
995 | 1004 | |
|
996 | 1005 | Push a largefiles repository to a served empty repository |
|
997 | 1006 | $ hg init r8 |
|
998 | 1007 | $ echo c3 > r8/f1 |
|
999 | 1008 | $ hg add --large r8/f1 -R r8 |
|
1000 | 1009 | $ hg commit -m "m1" -R r8 |
|
1001 | 1010 | Invoking status precommit hook |
|
1002 | 1011 | A f1 |
|
1003 | 1012 | $ hg init empty |
|
1004 | 1013 | $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \ |
|
1005 | 1014 | > --config 'web.allow_push=*' --config web.push_ssl=False |
|
1006 | 1015 | $ cat hg.pid >> $DAEMON_PIDS |
|
1007 | $ rm ${USERCACHE}/* | |
|
1016 | $ rm "${USERCACHE}"/* | |
|
1008 | 1017 | $ hg push -R r8 http://localhost:$HGPORT2 |
|
1009 | 1018 | pushing to http://localhost:$HGPORT2/ |
|
1010 | 1019 | searching for changes |
|
1011 | 1020 | searching for changes |
|
1012 | 1021 | remote: adding changesets |
|
1013 | 1022 | remote: adding manifests |
|
1014 | 1023 | remote: adding file changes |
|
1015 | 1024 | remote: added 1 changesets with 1 changes to 1 files |
|
1016 | 1025 | $ rm -rf empty |
|
1017 | 1026 | |
|
1018 | 1027 | used all HGPORTs, kill all daemons |
|
1019 | 1028 | $ "$TESTDIR/killdaemons.py" |
|
1020 | 1029 | |
|
1030 | #endif | |
|
1031 | ||
|
1032 | ||
|
1021 | 1033 | #if unix-permissions |
|
1022 | 1034 | |
|
1023 | 1035 | Clone a local repository owned by another user |
|
1024 | 1036 | We have to simulate that here by setting $HOME and removing write permissions |
|
1025 | 1037 | $ ORIGHOME="$HOME" |
|
1026 | 1038 | $ mkdir alice |
|
1027 | 1039 | $ HOME="`pwd`/alice" |
|
1028 | 1040 | $ cd alice |
|
1029 | 1041 | $ hg init pubrepo |
|
1030 | 1042 | $ cd pubrepo |
|
1031 | 1043 | $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null |
|
1032 | 1044 | $ hg add --large a-large-file |
|
1033 | 1045 | $ hg commit -m "Add a large file" |
|
1034 | 1046 | Invoking status precommit hook |
|
1035 | 1047 | A a-large-file |
|
1036 | 1048 | $ cd .. |
|
1037 | 1049 | $ chmod -R a-w pubrepo |
|
1038 | 1050 | $ cd .. |
|
1039 | 1051 | $ mkdir bob |
|
1040 | 1052 | $ HOME="`pwd`/bob" |
|
1041 | 1053 | $ cd bob |
|
1042 | 1054 | $ hg clone --pull ../alice/pubrepo pubrepo |
|
1043 | 1055 | requesting all changes |
|
1044 | 1056 | adding changesets |
|
1045 | 1057 | adding manifests |
|
1046 | 1058 | adding file changes |
|
1047 | 1059 | added 1 changesets with 1 changes to 1 files |
|
1048 | 1060 | updating to branch default |
|
1049 | 1061 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1050 | 1062 | getting changed largefiles |
|
1051 | 1063 | 1 largefiles updated, 0 removed |
|
1052 | 1064 | $ cd .. |
|
1053 | 1065 | $ chmod -R u+w alice/pubrepo |
|
1054 | 1066 | $ HOME="$ORIGHOME" |
|
1055 | 1067 | |
|
1056 | 1068 | #endif |
|
1057 | 1069 | |
|
1058 | 1070 | #if symlink |
|
1059 | 1071 | |
|
1060 | 1072 | Symlink to a large largefile should behave the same as a symlink to a normal file |
|
1061 | 1073 | $ hg init largesymlink |
|
1062 | 1074 | $ cd largesymlink |
|
1063 | 1075 | $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null |
|
1064 | 1076 | $ hg add --large largefile |
|
1065 | 1077 | $ hg commit -m "commit a large file" |
|
1066 | 1078 | Invoking status precommit hook |
|
1067 | 1079 | A largefile |
|
1068 | 1080 | $ ln -s largefile largelink |
|
1069 | 1081 | $ hg add largelink |
|
1070 | 1082 | $ hg commit -m "commit a large symlink" |
|
1071 | 1083 | Invoking status precommit hook |
|
1072 | 1084 | A largelink |
|
1073 | 1085 | $ rm -f largelink |
|
1074 | 1086 | $ hg up >/dev/null |
|
1075 | 1087 | $ test -f largelink |
|
1076 | 1088 | [1] |
|
1077 | 1089 | $ test -L largelink |
|
1078 | 1090 | [1] |
|
1079 | 1091 | $ rm -f largelink # make next part of the test independent of the previous |
|
1080 | 1092 | $ hg up -C >/dev/null |
|
1081 | 1093 | $ test -f largelink |
|
1082 | 1094 | $ test -L largelink |
|
1083 | 1095 | $ cd .. |
|
1084 | 1096 | |
|
1085 | 1097 | #endif |
|
1086 | 1098 | |
|
1087 | 1099 | test for pattern matching on 'hg status': |
|
1088 | 1100 | to boost performance, largefiles checks whether specified patterns are |
|
1089 | 1101 | related to largefiles in working directory (NOT to STANDIN) or not. |
|
1090 | 1102 | |
|
1091 | 1103 | $ hg init statusmatch |
|
1092 | 1104 | $ cd statusmatch |
|
1093 | 1105 | |
|
1094 | 1106 | $ mkdir -p a/b/c/d |
|
1095 | 1107 | $ echo normal > a/b/c/d/e.normal.txt |
|
1096 | 1108 | $ hg add a/b/c/d/e.normal.txt |
|
1097 | 1109 | $ echo large > a/b/c/d/e.large.txt |
|
1098 | 1110 | $ hg add --large a/b/c/d/e.large.txt |
|
1099 | 1111 | $ mkdir -p a/b/c/x |
|
1100 | 1112 | $ echo normal > a/b/c/x/y.normal.txt |
|
1101 | 1113 | $ hg add a/b/c/x/y.normal.txt |
|
1102 | 1114 | $ hg commit -m 'add files' |
|
1103 | 1115 | Invoking status precommit hook |
|
1104 | 1116 | A a/b/c/d/e.large.txt |
|
1105 | 1117 | A a/b/c/d/e.normal.txt |
|
1106 | 1118 | A a/b/c/x/y.normal.txt |
|
1107 | 1119 | |
|
1108 | 1120 | (1) no pattern: no performance boost |
|
1109 | 1121 | $ hg status -A |
|
1110 | 1122 | C a/b/c/d/e.large.txt |
|
1111 | 1123 | C a/b/c/d/e.normal.txt |
|
1112 | 1124 | C a/b/c/x/y.normal.txt |
|
1113 | 1125 | |
|
1114 | 1126 | (2) pattern not related to largefiles: performance boost |
|
1115 | 1127 | $ hg status -A a/b/c/x |
|
1116 | 1128 | C a/b/c/x/y.normal.txt |
|
1117 | 1129 | |
|
1118 | 1130 | (3) pattern related to largefiles: no performance boost |
|
1119 | 1131 | $ hg status -A a/b/c/d |
|
1120 | 1132 | C a/b/c/d/e.large.txt |
|
1121 | 1133 | C a/b/c/d/e.normal.txt |
|
1122 | 1134 | |
|
1123 | 1135 | (4) pattern related to STANDIN (not to largefiles): performance boost |
|
1124 | 1136 | $ hg status -A .hglf/a |
|
1125 | 1137 | C .hglf/a/b/c/d/e.large.txt |
|
1126 | 1138 | |
|
1127 | 1139 | (5) mixed case: no performance boost |
|
1128 | 1140 | $ hg status -A a/b/c/x a/b/c/d |
|
1129 | 1141 | C a/b/c/d/e.large.txt |
|
1130 | 1142 | C a/b/c/d/e.normal.txt |
|
1131 | 1143 | C a/b/c/x/y.normal.txt |
|
1132 | 1144 | |
|
1133 | 1145 | verify that largefiles doesn't break filesets |
|
1134 | 1146 | |
|
1135 | 1147 | $ hg log --rev . --exclude "set:binary()" |
|
1136 | 1148 | changeset: 0:41bd42f10efa |
|
1137 | 1149 | tag: tip |
|
1138 | 1150 | user: test |
|
1139 | 1151 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1140 | 1152 | summary: add files |
|
1141 | 1153 | |
|
1142 | 1154 | verify that large files in subrepos handled properly |
|
1143 | 1155 | $ hg init subrepo |
|
1144 | 1156 | $ echo "subrepo = subrepo" > .hgsub |
|
1145 | 1157 | $ hg add .hgsub |
|
1146 | 1158 | $ hg ci -m "add subrepo" |
|
1147 | 1159 | Invoking status precommit hook |
|
1148 | 1160 | A .hgsub |
|
1149 | 1161 | ? .hgsubstate |
|
1150 | 1162 | $ echo "rev 1" > subrepo/large.txt |
|
1151 | 1163 | $ hg -R subrepo add --large subrepo/large.txt |
|
1152 | 1164 | $ hg sum |
|
1153 | 1165 | parent: 1:8ee150ea2e9c tip |
|
1154 | 1166 | add subrepo |
|
1155 | 1167 | branch: default |
|
1156 | 1168 | commit: 1 subrepos |
|
1157 | 1169 | update: (current) |
|
1158 | 1170 | $ hg st |
|
1159 | 1171 | $ hg st -S |
|
1160 | 1172 | A subrepo/large.txt |
|
1161 | 1173 | $ hg ci -S -m "commit top repo" |
|
1162 | 1174 | committing subrepository subrepo |
|
1163 | 1175 | Invoking status precommit hook |
|
1164 | 1176 | A large.txt |
|
1165 | 1177 | Invoking status precommit hook |
|
1166 | 1178 | M .hgsubstate |
|
1167 | 1179 | # No differences |
|
1168 | 1180 | $ hg st -S |
|
1169 | 1181 | $ hg sum |
|
1170 | 1182 | parent: 2:ce4cd0c527a6 tip |
|
1171 | 1183 | commit top repo |
|
1172 | 1184 | branch: default |
|
1173 | 1185 | commit: (clean) |
|
1174 | 1186 | update: (current) |
|
1175 | 1187 | $ echo "rev 2" > subrepo/large.txt |
|
1176 | 1188 | $ hg st -S |
|
1177 | 1189 | M subrepo/large.txt |
|
1178 | 1190 | $ hg sum |
|
1179 | 1191 | parent: 2:ce4cd0c527a6 tip |
|
1180 | 1192 | commit top repo |
|
1181 | 1193 | branch: default |
|
1182 | 1194 | commit: 1 subrepos |
|
1183 | 1195 | update: (current) |
|
1184 | 1196 | $ hg ci -m "this commit should fail without -S" |
|
1185 | 1197 | abort: uncommitted changes in subrepo subrepo |
|
1186 | 1198 | (use --subrepos for recursive commit) |
|
1187 | 1199 | [255] |
|
1188 | 1200 | |
|
1189 | 1201 | Add a normal file to the subrepo, then test archiving |
|
1190 | 1202 | |
|
1191 | 1203 | $ echo 'normal file' > subrepo/normal.txt |
|
1192 | 1204 | $ hg -R subrepo add subrepo/normal.txt |
|
1193 | 1205 | |
|
1194 | 1206 | Lock in subrepo, otherwise the change isn't archived |
|
1195 | 1207 | |
|
1196 | 1208 | $ hg ci -S -m "add normal file to top level" |
|
1197 | 1209 | committing subrepository subrepo |
|
1198 | 1210 | Invoking status precommit hook |
|
1199 | 1211 | M large.txt |
|
1200 | 1212 | A normal.txt |
|
1201 | 1213 | Invoking status precommit hook |
|
1202 | 1214 | M .hgsubstate |
|
1203 | 1215 | $ hg archive -S lf_subrepo_archive |
|
1204 | 1216 | $ find lf_subrepo_archive | sort |
|
1205 | 1217 | lf_subrepo_archive |
|
1206 | 1218 | lf_subrepo_archive/.hg_archival.txt |
|
1207 | 1219 | lf_subrepo_archive/.hgsub |
|
1208 | 1220 | lf_subrepo_archive/.hgsubstate |
|
1209 | 1221 | lf_subrepo_archive/a |
|
1210 | 1222 | lf_subrepo_archive/a/b |
|
1211 | 1223 | lf_subrepo_archive/a/b/c |
|
1212 | 1224 | lf_subrepo_archive/a/b/c/d |
|
1213 | 1225 | lf_subrepo_archive/a/b/c/d/e.large.txt |
|
1214 | 1226 | lf_subrepo_archive/a/b/c/d/e.normal.txt |
|
1215 | 1227 | lf_subrepo_archive/a/b/c/x |
|
1216 | 1228 | lf_subrepo_archive/a/b/c/x/y.normal.txt |
|
1217 | 1229 | lf_subrepo_archive/subrepo |
|
1218 | 1230 | lf_subrepo_archive/subrepo/large.txt |
|
1219 | 1231 | lf_subrepo_archive/subrepo/normal.txt |
|
1220 | 1232 | |
|
1221 | 1233 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now