##// END OF EJS Templates
largefiles: test coverage of fatal interruption of update...
Mads Kiilerich -
r30189:4999c12c stable
parent child Browse files
Show More
@@ -1,744 +1,790 b''
1 1 This file focuses mainly on updating largefiles in the working
2 2 directory (and ".hg/largefiles/dirstate")
3 3
4 4 $ cat >> $HGRCPATH <<EOF
5 5 > [ui]
6 6 > merge = internal:fail
7 7 > [extensions]
8 8 > largefiles =
9 9 > [extdiff]
10 10 > # for portability:
11 11 > pdiff = sh "$RUNTESTDIR/pdiff"
12 12 > EOF
13 13
14 14 $ hg init repo
15 15 $ cd repo
16 16
17 17 $ echo large1 > large1
18 18 $ echo large2 > large2
19 19 $ hg add --large large1 large2
20 20 $ echo normal1 > normal1
21 21 $ hg add normal1
22 22 $ hg commit -m '#0'
23 23 $ echo 'large1 in #1' > large1
24 24 $ echo 'normal1 in #1' > normal1
25 25 $ hg commit -m '#1'
26 26 $ hg pdiff -r '.^' --config extensions.extdiff=
27 27 diff -Nru repo.0d9d9b8dc9a3/.hglf/large1 repo/.hglf/large1
28 28 --- repo.0d9d9b8dc9a3/.hglf/large1 * (glob)
29 29 +++ repo/.hglf/large1 * (glob)
30 30 @@ -1* +1* @@ (glob)
31 31 -4669e532d5b2c093a78eca010077e708a071bb64
32 32 +58e24f733a964da346e2407a2bee99d9001184f5
33 33 diff -Nru repo.0d9d9b8dc9a3/normal1 repo/normal1
34 34 --- repo.0d9d9b8dc9a3/normal1 * (glob)
35 35 +++ repo/normal1 * (glob)
36 36 @@ -1* +1* @@ (glob)
37 37 -normal1
38 38 +normal1 in #1
39 39 [1]
40 40 $ hg update -q -C 0
41 41 $ echo 'large2 in #2' > large2
42 42 $ hg commit -m '#2'
43 43 created new head
44 44
45 45 Test that update also updates the lfdirstate of 'unsure' largefiles after
46 46 hashing them:
47 47
48 48 The previous operations will usually have left us with largefiles with a mtime
49 49 within the same second as the dirstate was written.
50 50 The lfdirstate entries will thus have been written with an invalidated/unset
51 51 mtime to make sure further changes within the same second is detected.
52 52 We will however occasionally be "lucky" and get a tick between writing
53 53 largefiles and writing dirstate so we get valid lfdirstate timestamps. The
54 54 following verification is thus disabled but can be verified manually.
55 55
56 56 #if false
57 57 $ hg debugdirstate --large --nodate
58 58 n 644 7 unset large1
59 59 n 644 13 unset large2
60 60 #endif
61 61
62 62 Wait to make sure we get a tick so the mtime of the largefiles become valid.
63 63
64 64 $ sleep 1
65 65
66 66 A linear merge will update standins before performing the actual merge. It will
67 67 do a lfdirstate status walk and find 'unset'/'unsure' files, hash them, and
68 68 update the corresponding standins.
69 69 Verify that it actually marks the clean files as clean in lfdirstate so
70 70 we don't have to hash them again next time we update.
71 71
72 72 $ hg up
73 73 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
74 74 1 other heads for branch "default"
75 75 $ hg debugdirstate --large --nodate
76 76 n 644 7 set large1
77 77 n 644 13 set large2
78 78
79 79 Test that lfdirstate keeps track of last modification of largefiles and
80 80 prevents unnecessary hashing of content - also after linear/noop update
81 81
82 82 $ sleep 1
83 83 $ hg st
84 84 $ hg debugdirstate --large --nodate
85 85 n 644 7 set large1
86 86 n 644 13 set large2
87 87 $ hg up
88 88 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
89 89 1 other heads for branch "default"
90 90 $ hg debugdirstate --large --nodate
91 91 n 644 7 set large1
92 92 n 644 13 set large2
93 93
94 94 Test that "hg merge" updates largefiles from "other" correctly
95 95
96 96 (getting largefiles from "other" normally)
97 97
98 98 $ hg status -A large1
99 99 C large1
100 100 $ cat large1
101 101 large1
102 102 $ cat .hglf/large1
103 103 4669e532d5b2c093a78eca010077e708a071bb64
104 104 $ hg merge --config debug.dirstate.delaywrite=2
105 105 getting changed largefiles
106 106 1 largefiles updated, 0 removed
107 107 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
108 108 (branch merge, don't forget to commit)
109 109 $ hg status -A large1
110 110 M large1
111 111 $ cat large1
112 112 large1 in #1
113 113 $ cat .hglf/large1
114 114 58e24f733a964da346e2407a2bee99d9001184f5
115 115 $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
116 116 -4669e532d5b2c093a78eca010077e708a071bb64
117 117 +58e24f733a964da346e2407a2bee99d9001184f5
118 118
119 119 (getting largefiles from "other" via conflict prompt)
120 120
121 121 $ hg update -q -C 2
122 122 $ echo 'large1 in #3' > large1
123 123 $ echo 'normal1 in #3' > normal1
124 124 $ hg commit -m '#3'
125 125 $ cat .hglf/large1
126 126 e5bb990443d6a92aaf7223813720f7566c9dd05b
127 127 $ hg merge --config debug.dirstate.delaywrite=2 --config ui.interactive=True <<EOF
128 128 > o
129 129 > EOF
130 130 largefile large1 has a merge conflict
131 131 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
132 132 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
133 133 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
134 134 merging normal1
135 135 warning: conflicts while merging normal1! (edit, then use 'hg resolve --mark')
136 136 getting changed largefiles
137 137 1 largefiles updated, 0 removed
138 138 0 files updated, 1 files merged, 0 files removed, 1 files unresolved
139 139 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
140 140 [1]
141 141 $ hg status -A large1
142 142 M large1
143 143 $ cat large1
144 144 large1 in #1
145 145 $ cat .hglf/large1
146 146 58e24f733a964da346e2407a2bee99d9001184f5
147 $ rm normal1.orig
147 148
148 149 (merge non-existing largefiles from "other" via conflict prompt -
149 150 make sure the following commit doesn't abort in a confusing way when trying to
150 151 mark the non-existing file as normal in lfdirstate)
151 152
152 153 $ mv .hg/largefiles/58e24f733a964da346e2407a2bee99d9001184f5 .
153 154 $ hg update -q -C 3
154 155 $ hg merge --config largefiles.usercache=not --config debug.dirstate.delaywrite=2 --tool :local --config ui.interactive=True <<EOF
155 156 > o
156 157 > EOF
157 158 largefile large1 has a merge conflict
158 159 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
159 160 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
160 161 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
161 162 getting changed largefiles
162 163 large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from file:/*/$TESTTMP/repo (glob)
163 164 0 largefiles updated, 0 removed
164 165 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
165 166 (branch merge, don't forget to commit)
166 167 $ hg commit -m '1-2-3 testing' --config largefiles.usercache=not
167 168 large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from local store
168 169 $ hg up -C . --config largefiles.usercache=not
169 170 getting changed largefiles
170 171 large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from file:/*/$TESTTMP/repo (glob)
171 172 0 largefiles updated, 0 removed
172 173 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
173 174 $ hg st large1
174 175 ! large1
175 176 $ hg rollback -q
176 177 $ mv 58e24f733a964da346e2407a2bee99d9001184f5 .hg/largefiles/
177 178
178 179 Test that "hg revert -r REV" updates largefiles from "REV" correctly
179 180
180 181 $ hg update -q -C 3
181 182 $ hg status -A large1
182 183 C large1
183 184 $ cat large1
184 185 large1 in #3
185 186 $ cat .hglf/large1
186 187 e5bb990443d6a92aaf7223813720f7566c9dd05b
187 188 $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
188 189 -4669e532d5b2c093a78eca010077e708a071bb64
189 190 +58e24f733a964da346e2407a2bee99d9001184f5
190 191 $ hg revert --no-backup -r 1 --config debug.dirstate.delaywrite=2 large1
191 192 $ hg status -A large1
192 193 M large1
193 194 $ cat large1
194 195 large1 in #1
195 196 $ cat .hglf/large1
196 197 58e24f733a964da346e2407a2bee99d9001184f5
197 198
198 199 Test that "hg rollback" restores status of largefiles correctly
199 200
200 201 $ hg update -C -q
201 202 $ hg remove large1
202 203 $ test -f .hglf/large1
203 204 [1]
204 205 $ hg forget large2
205 206 $ test -f .hglf/large2
206 207 [1]
207 208 $ echo largeX > largeX
208 209 $ hg add --large largeX
209 210 $ cat .hglf/largeX
210 211
211 212 $ hg commit -m 'will be rollback-ed soon'
212 213 $ echo largeY > largeY
213 214 $ hg add --large largeY
214 215 #if windows
215 216 $ hg status -A large1
216 217 large1: * (glob)
217 218 #else
218 219 $ hg status -A large1
219 220 large1: No such file or directory
220 221 #endif
221 222 $ hg status -A large2
222 223 ? large2
223 224 $ hg status -A largeX
224 225 C largeX
225 226 $ hg status -A largeY
226 227 A largeY
227 228 $ hg rollback
228 229 repository tip rolled back to revision 3 (undo commit)
229 230 working directory now based on revision 3
230 231 $ hg status -A large1
231 232 R large1
232 233 $ test -f .hglf/large1
233 234 [1]
234 235 $ hg status -A large2
235 236 R large2
236 237 $ test -f .hglf/large2
237 238 [1]
238 239 $ hg status -A largeX
239 240 A largeX
240 241 $ cat .hglf/largeX
241 242
242 243 $ hg status -A largeY
243 244 ? largeY
244 245 $ test -f .hglf/largeY
245 246 [1]
247 $ rm largeY
246 248
247 249 Test that "hg rollback" restores standins correctly
248 250
249 251 $ hg commit -m 'will be rollback-ed soon'
250 252 $ hg update -q -C 2
251 253 $ cat large1
252 254 large1
253 255 $ cat .hglf/large1
254 256 4669e532d5b2c093a78eca010077e708a071bb64
255 257 $ cat large2
256 258 large2 in #2
257 259 $ cat .hglf/large2
258 260 3cfce6277e7668985707b6887ce56f9f62f6ccd9
259 261
260 262 $ hg rollback -q -f
261 263 $ cat large1
262 264 large1
263 265 $ cat .hglf/large1
264 266 4669e532d5b2c093a78eca010077e708a071bb64
265 267 $ cat large2
266 268 large2 in #2
267 269 $ cat .hglf/large2
268 270 3cfce6277e7668985707b6887ce56f9f62f6ccd9
269 271
270 272 (rollback the parent of the working directory, when the parent of it
271 273 is not branch-tip)
272 274
273 275 $ hg update -q -C 1
274 276 $ cat .hglf/large1
275 277 58e24f733a964da346e2407a2bee99d9001184f5
276 278 $ cat .hglf/large2
277 279 1deebade43c8c498a3c8daddac0244dc55d1331d
278 280
279 281 $ echo normalX > normalX
280 282 $ hg add normalX
281 283 $ hg commit -m 'will be rollback-ed soon'
282 284 $ hg rollback -q
283 285
284 286 $ cat .hglf/large1
285 287 58e24f733a964da346e2407a2bee99d9001184f5
286 288 $ cat .hglf/large2
287 289 1deebade43c8c498a3c8daddac0244dc55d1331d
290 $ rm normalX
288 291
289 292 Test that "hg status" shows status of largefiles correctly just after
290 293 automated commit like rebase/transplant
291 294
292 295 $ cat >> .hg/hgrc <<EOF
293 296 > [extensions]
294 297 > rebase =
295 298 > strip =
296 299 > transplant =
297 300 > EOF
298 301 $ hg update -q -C 1
299 302 $ hg remove large1
300 303 $ echo largeX > largeX
301 304 $ hg add --large largeX
302 305 $ hg commit -m '#4'
303 306
304 307 $ hg rebase -s 1 -d 2 --keep
305 308 rebasing 1:72518492caa6 "#1"
306 309 rebasing 4:07d6153b5c04 "#4" (tip)
307 310 #if windows
308 311 $ hg status -A large1
309 312 large1: * (glob)
310 313 #else
311 314 $ hg status -A large1
312 315 large1: No such file or directory
313 316 #endif
314 317 $ hg status -A largeX
315 318 C largeX
316 319 $ hg strip -q 5
317 320
318 321 $ hg update -q -C 2
319 322 $ hg transplant -q 1 4
320 323 #if windows
321 324 $ hg status -A large1
322 325 large1: * (glob)
323 326 #else
324 327 $ hg status -A large1
325 328 large1: No such file or directory
326 329 #endif
327 330 $ hg status -A largeX
328 331 C largeX
329 332 $ hg strip -q 5
330 333
331 334 $ hg update -q -C 2
332 335 $ hg transplant -q --merge 1 --merge 4
333 336 #if windows
334 337 $ hg status -A large1
335 338 large1: * (glob)
336 339 #else
337 340 $ hg status -A large1
338 341 large1: No such file or directory
339 342 #endif
340 343 $ hg status -A largeX
341 344 C largeX
342 345 $ hg strip -q 5
343 346
344 347 Test that linear merge can detect modification (and conflict) correctly
345 348
346 349 (linear merge without conflict)
347 350
348 351 $ echo 'large2 for linear merge (no conflict)' > large2
349 352 $ hg update 3 --config debug.dirstate.delaywrite=2
350 353 getting changed largefiles
351 354 1 largefiles updated, 0 removed
352 355 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
353 356 $ hg status -A large2
354 357 M large2
355 358 $ cat large2
356 359 large2 for linear merge (no conflict)
357 360 $ cat .hglf/large2
358 361 9c4bf8f1b33536d6e5f89447e10620cfe52ea710
359 362
360 363 (linear merge with conflict, choosing "other")
361 364
362 365 $ hg update -q -C 2
363 366 $ echo 'large1 for linear merge (conflict)' > large1
364 367 $ hg update 3 --config ui.interactive=True <<EOF
365 368 > o
366 369 > EOF
367 370 largefile large1 has a merge conflict
368 371 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
369 372 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
370 373 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? o
371 374 getting changed largefiles
372 375 1 largefiles updated, 0 removed
373 376 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
374 377 $ hg status -A large1
375 378 C large1
376 379 $ cat large1
377 380 large1 in #3
378 381 $ cat .hglf/large1
379 382 e5bb990443d6a92aaf7223813720f7566c9dd05b
380 383
381 384 (linear merge with conflict, choosing "local")
382 385
383 386 $ hg update -q -C 2
384 387 $ echo 'large1 for linear merge (conflict)' > large1
385 388 $ hg update 3 --config debug.dirstate.delaywrite=2
386 389 largefile large1 has a merge conflict
387 390 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
388 391 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
389 392 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
390 393 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
391 394 $ hg status -A large1
392 395 M large1
393 396 $ cat large1
394 397 large1 for linear merge (conflict)
395 398 $ cat .hglf/large1
396 399 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
397 400
398 401 Test a linear merge to a revision containing same-name normal file
399 402
400 403 $ hg update -q -C 3
401 404 $ hg remove large2
402 405 $ echo 'large2 as normal file' > large2
403 406 $ hg add large2
404 407 $ echo 'large3 as normal file' > large3
405 408 $ hg add large3
406 409 $ hg commit -m '#5'
407 410 $ hg manifest
408 411 .hglf/large1
409 412 large2
410 413 large3
411 414 normal1
412 415
413 416 (modified largefile is already switched to normal)
414 417
415 418 $ hg update -q -C 2
416 419 $ echo 'modified large2 for linear merge' > large2
417 420 $ hg update -q 5
418 421 remote turned local largefile large2 into a normal file
419 422 keep (l)argefile or use (n)ormal file? l
420 423 $ hg debugdirstate --nodates | grep large2
421 424 a 0 -1 unset .hglf/large2
422 425 r 0 0 set large2
423 426 $ hg status -A large2
424 427 A large2
425 428 $ cat large2
426 429 modified large2 for linear merge
427 430
428 431 (added largefile is already committed as normal)
429 432
430 433 $ hg update -q -C 2
431 434 $ echo 'large3 as large file for linear merge' > large3
432 435 $ hg add --large large3
433 436 $ hg update -q 5
434 437 remote turned local largefile large3 into a normal file
435 438 keep (l)argefile or use (n)ormal file? l
436 439 $ hg debugdirstate --nodates | grep large3
437 440 a 0 -1 unset .hglf/large3
438 441 r 0 0 set large3
439 442 $ hg status -A large3
440 443 A large3
441 444 $ cat large3
442 445 large3 as large file for linear merge
443 446 $ rm -f large3 .hglf/large3
444 447
445 448 Test that the internal linear merging works correctly
446 449 (both heads are stripped to keep pairing of revision number and commit log)
447 450
448 451 $ hg update -q -C 2
449 452 $ hg strip 3 4
450 453 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9530e27857f7-2e7b195d-backup.hg (glob)
451 454 $ mv .hg/strip-backup/9530e27857f7-2e7b195d-backup.hg $TESTTMP
452 455
453 456 (internal linear merging at "hg pull --update")
454 457
455 458 $ echo 'large1 for linear merge (conflict)' > large1
456 459 $ echo 'large2 for linear merge (conflict with normal file)' > large2
457 460 $ hg pull --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg
458 461 pulling from $TESTTMP/9530e27857f7-2e7b195d-backup.hg (glob)
459 462 searching for changes
460 463 adding changesets
461 464 adding manifests
462 465 adding file changes
463 466 added 3 changesets with 5 changes to 5 files
464 467 remote turned local largefile large2 into a normal file
465 468 keep (l)argefile or use (n)ormal file? l
466 469 largefile large1 has a merge conflict
467 470 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
468 471 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
469 472 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
470 473 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
471 474 1 other heads for branch "default"
472 475
473 476 $ hg status -A large1
474 477 M large1
475 478 $ cat large1
476 479 large1 for linear merge (conflict)
477 480 $ cat .hglf/large1
478 481 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
479 482 $ hg status -A large2
480 483 A large2
481 484 $ cat large2
482 485 large2 for linear merge (conflict with normal file)
483 486 $ cat .hglf/large2
484 487 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
485 488
486 489 (internal linear merging at "hg unbundle --update")
487 490
488 491 $ hg update -q -C 2
489 492 $ hg rollback -q
490 493
491 494 $ echo 'large1 for linear merge (conflict)' > large1
492 495 $ echo 'large2 for linear merge (conflict with normal file)' > large2
493 496 $ hg unbundle --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg
494 497 adding changesets
495 498 adding manifests
496 499 adding file changes
497 500 added 3 changesets with 5 changes to 5 files
498 501 remote turned local largefile large2 into a normal file
499 502 keep (l)argefile or use (n)ormal file? l
500 503 largefile large1 has a merge conflict
501 504 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
502 505 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
503 506 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
504 507 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
505 508 1 other heads for branch "default"
506 509
507 510 $ hg status -A large1
508 511 M large1
509 512 $ cat large1
510 513 large1 for linear merge (conflict)
511 514 $ cat .hglf/large1
512 515 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
513 516 $ hg status -A large2
514 517 A large2
515 518 $ cat large2
516 519 large2 for linear merge (conflict with normal file)
517 520 $ cat .hglf/large2
518 521 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
519 522
520 523 (internal linear merging in subrepo at "hg update")
521 524
522 525 $ cd ..
523 526 $ hg init subparent
524 527 $ cd subparent
525 528
526 529 $ hg clone -q -u 2 ../repo sub
527 530 $ cat > .hgsub <<EOF
528 531 > sub = sub
529 532 > EOF
530 533 $ hg add .hgsub
531 534 $ hg commit -m '#0@parent'
532 535 $ cat .hgsubstate
533 536 f74e50bd9e5594b7cf1e6c5cbab86ddd25f3ca2f sub
534 537 $ hg -R sub update -q
535 538 $ hg commit -m '#1@parent'
536 539 $ cat .hgsubstate
537 540 d65e59e952a9638e2ce863b41a420ca723dd3e8d sub
538 541 $ hg update -q 0
539 542
540 543 $ echo 'large1 for linear merge (conflict)' > sub/large1
541 544 $ echo 'large2 for linear merge (conflict with normal file)' > sub/large2
542 545 $ hg update --config ui.interactive=True --config debug.dirstate.delaywrite=2 <<EOF
543 546 > m
544 547 > r
545 548 > l
546 549 > l
547 550 > EOF
548 551 subrepository sub diverged (local revision: f74e50bd9e55, remote revision: d65e59e952a9)
549 552 (M)erge, keep (l)ocal or keep (r)emote? m
550 553 subrepository sources for sub differ (in checked out version)
551 554 use (l)ocal source (f74e50bd9e55) or (r)emote source (d65e59e952a9)? r
552 555 remote turned local largefile large2 into a normal file
553 556 keep (l)argefile or use (n)ormal file? l
554 557 largefile large1 has a merge conflict
555 558 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
556 559 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
557 560 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
558 561 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
559 562 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
560 563
561 564 $ hg -R sub status -A sub/large1
562 565 M sub/large1
563 566 $ cat sub/large1
564 567 large1 for linear merge (conflict)
565 568 $ cat sub/.hglf/large1
566 569 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
567 570 $ hg -R sub status -A sub/large2
568 571 A sub/large2
569 572 $ cat sub/large2
570 573 large2 for linear merge (conflict with normal file)
571 574 $ cat sub/.hglf/large2
572 575 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
573 576
574 577 $ cd ..
575 578 $ cd repo
576 579
577 580 Test that rebase updates largefiles in the working directory even if
578 581 it is aborted by conflict.
579 582
580 583 $ hg update -q -C 3
581 584 $ cat .hglf/large1
582 585 e5bb990443d6a92aaf7223813720f7566c9dd05b
583 586 $ cat large1
584 587 large1 in #3
585 588 $ hg rebase -s 1 -d 3 --keep --config ui.interactive=True <<EOF
586 589 > o
587 590 > EOF
588 591 rebasing 1:72518492caa6 "#1"
589 592 largefile large1 has a merge conflict
590 593 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
591 594 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
592 595 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
593 596 merging normal1
594 597 warning: conflicts while merging normal1! (edit, then use 'hg resolve --mark')
595 598 unresolved conflicts (see hg resolve, then hg rebase --continue)
596 599 [1]
597 600 $ cat .hglf/large1
598 601 58e24f733a964da346e2407a2bee99d9001184f5
599 602 $ cat large1
600 603 large1 in #1
604 $ rm normal1.orig
601 605
602 606 Test that rebase updates standins for manually modified largefiles at
603 607 the 1st commit of resuming.
604 608
605 609 $ echo "manually modified before 'hg rebase --continue'" > large1
606 610 $ hg resolve -m normal1
607 611 (no more unresolved files)
608 612 continue: hg rebase --continue
609 613 $ hg rebase --continue --config ui.interactive=True <<EOF
610 614 > c
611 615 > EOF
612 616 rebasing 1:72518492caa6 "#1"
613 617 rebasing 4:07d6153b5c04 "#4"
614 618 local changed .hglf/large1 which remote deleted
615 619 use (c)hanged version, (d)elete, or leave (u)nresolved? c
616 620
617 621 $ hg diff -c "tip~1" --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
618 622 -e5bb990443d6a92aaf7223813720f7566c9dd05b
619 623 +8a4f783556e7dea21139ca0466eafce954c75c13
620 624 $ rm -f large1
621 625 $ hg update -q -C tip
622 626 $ cat large1
623 627 manually modified before 'hg rebase --continue'
624 628
625 629 Test that transplant updates largefiles, of which standins are safely
626 630 changed, even if it is aborted by conflict of other.
627 631
628 632 $ hg update -q -C 5
629 633 $ cat .hglf/large1
630 634 e5bb990443d6a92aaf7223813720f7566c9dd05b
631 635 $ cat large1
632 636 large1 in #3
633 637 $ hg diff -c 4 .hglf/largeX | grep '^[+-][0-9a-z]'
634 638 +fa44618ea25181aff4f48b70428294790cec9f61
635 639 $ hg transplant 4
636 640 applying 07d6153b5c04
637 641 patching file .hglf/large1
638 642 Hunk #1 FAILED at 0
639 643 1 out of 1 hunks FAILED -- saving rejects to file .hglf/large1.rej
640 644 patch failed to apply
641 645 abort: fix up the working directory and run hg transplant --continue
642 646 [255]
643 647 $ hg status -A large1
644 648 C large1
645 649 $ cat .hglf/large1
646 650 e5bb990443d6a92aaf7223813720f7566c9dd05b
647 651 $ cat large1
648 652 large1 in #3
649 653 $ hg status -A largeX
650 654 A largeX
651 655 $ cat .hglf/largeX
652 656 fa44618ea25181aff4f48b70428294790cec9f61
653 657 $ cat largeX
654 658 largeX
655 659
656 660 Test that transplant updates standins for manually modified largefiles
657 661 at the 1st commit of resuming.
658 662
659 663 $ echo "manually modified before 'hg transplant --continue'" > large1
660 664 $ hg transplant --continue
661 665 07d6153b5c04 transplanted as f1bf30eb88cc
662 666 $ hg diff -c tip .hglf/large1 | grep '^[+-][0-9a-z]'
663 667 -e5bb990443d6a92aaf7223813720f7566c9dd05b
664 668 +6a4f36d4075fbe0f30ec1d26ca44e63c05903671
665 669 $ rm -f large1
666 670 $ hg update -q -C tip
667 671 $ cat large1
668 672 manually modified before 'hg transplant --continue'
669 673
670 674 Test that "hg status" doesn't show removal of largefiles not managed
671 675 in the target context.
672 676
673 677 $ hg update -q -C 4
674 678 $ hg remove largeX
675 679 $ hg status -A largeX
676 680 R largeX
677 681 $ hg status -A --rev '.^1' largeX
678 682
679 683 #if execbit
680 684
681 685 Test that "hg status" against revisions other than parent notices exec
682 686 bit changes of largefiles.
683 687
684 688 $ hg update -q -C 4
685 689
686 690 (the case that large2 doesn't have exec bit in the target context but
687 691 in the working context)
688 692
689 693 $ chmod +x large2
690 694 $ hg status -A --rev 0 large2
691 695 M large2
692 696 $ hg commit -m 'chmod +x large2'
693 697
694 698 (the case that large2 has exec bit in the target context but not in
695 699 the working context)
696 700
697 701 $ echo dummy > dummy
698 702 $ hg add dummy
699 703 $ hg commit -m 'revision for separation'
700 704 $ chmod -x large2
701 705 $ hg status -A --rev '.^1' large2
702 706 M large2
703 707
704 708 #else
705 709
706 710 Test that "hg status" against revisions other than parent ignores exec
707 711 bit correctly on the platform being unaware of it.
708 712
709 713 $ hg update -q -C 4
710 714
711 715 $ cat > exec-bit.patch <<EOF
712 716 > # HG changeset patch
713 717 > # User test
714 718 > # Date 0 0
715 719 > # Thu Jan 01 00:00:00 1970 +0000
716 720 > # Node ID be1b433a65b12b27b5519d92213e14f7e1769b90
717 721 > # Parent 07d6153b5c04313efb75deec9ba577de7faeb727
718 722 > chmod +x large2
719 723 >
720 724 > diff --git a/.hglf/large2 b/.hglf/large2
721 725 > old mode 100644
722 726 > new mode 100755
723 727 > EOF
724 728 $ hg import --exact --bypass exec-bit.patch
725 729 applying exec-bit.patch
726 730 $ hg status -A --rev tip large2
727 731 C large2
728 732
729 733 #endif
730 734
735 Test a fatal error interrupting an update. lfdirstate doesn't realize that
736 .hglf has been updated while the largefile hasn't. Status thus shows a clean
737 state ... but rebuilding lfdirstate and checking all hashes reveals it isn't
738 clean.
739
740 Start with clean dirstates:
741 $ hg up -qcr "8^"
742 $ sleep 1
743 $ hg st
744 Update standins without updating largefiles:
745 $ cat << EOF > ../crashupdatelfiles.py
746 > import hgext.largefiles.lfutil
747 > def getlfilestoupdate(oldstandins, newstandins):
748 > raise SystemExit(7)
749 > hgext.largefiles.lfutil.getlfilestoupdate = getlfilestoupdate
750 > EOF
751 $ hg up -Cr "8" --config extensions.crashupdatelfiles=../crashupdatelfiles.py
752 [7]
753 Check large1 content and status:
754 BUG: largeX is R and large1 is not M and update does nothing
755 $ cat large1
756 large1 in #3
757 $ hg st
758 R largeX
759 $ hg up -Cr .
760 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
761 $ hg st
762 R largeX
763 Force largefiles rehashing and check again - revealing modifications that
764 update now can remove:
765 $ rm .hg/largefiles/dirstate
766 $ hg st
767 M large1
768 ! largeX
769 $ hg up -Cr .
770 getting changed largefiles
771 2 largefiles updated, 0 removed
772 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
773 $ hg st
774 $ cat large1
775 manually modified before 'hg transplant --continue'
776
731 777 $ cd ..
732 778
733 779 Test that "hg convert" avoids copying largefiles from the working
734 780 directory into store, because "hg convert" doesn't update largefiles
735 781 in the working directory (removing files under ".cache/largefiles"
736 782 forces "hg convert" to copy corresponding largefiles)
737 783
738 784 $ cat >> $HGRCPATH <<EOF
739 785 > [extensions]
740 786 > convert =
741 787 > EOF
742 788
743 789 $ rm $TESTTMP/.cache/largefiles/6a4f36d4075fbe0f30ec1d26ca44e63c05903671
744 790 $ hg convert -q repo repo.converted
General Comments 0
You need to be logged in to leave comments. Login now