Mercurial > hg
comparison tests/test-largefiles-update.t @ 23835:aa4a1672583e
bundles: do not overwrite existing backup bundles (BC)
Previously, a backup bundle could overwrite an existing bundle and cause user
data loss. For instance, if you have A<-B<-C and strip B, it produces backup
bundle B-backup.hg. If you then hg pull -r B B-backup.hg and strip it again, it
overwrites the existing B-backup.hg and C is lost.
The fix is to add a hash of all the nodes inside that bundle to the filename.
Fixed up existing tests and added a new test in test-strip.t
author | Durham Goode <durham@fb.com> |
---|---|
date | Fri, 09 Jan 2015 10:52:14 -0800 |
parents | 3314664606e6 |
children | ddc17eaf0f1b |
comparison
equal
deleted
inserted
replaced
23834:bf07c19b4c82 | 23835:aa4a1672583e |
---|---|
364 Test that the internal linear merging works correctly | 364 Test that the internal linear merging works correctly |
365 (both heads are stripped to keep pairing of revision number and commit log) | 365 (both heads are stripped to keep pairing of revision number and commit log) |
366 | 366 |
367 $ hg update -q -C 2 | 367 $ hg update -q -C 2 |
368 $ hg strip 3 4 | 368 $ hg strip 3 4 |
369 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9530e27857f7-backup.hg (glob) | 369 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9530e27857f7-2e7b195d-backup.hg (glob) |
370 $ mv .hg/strip-backup/9530e27857f7-backup.hg $TESTTMP | 370 $ mv .hg/strip-backup/9530e27857f7-2e7b195d-backup.hg $TESTTMP |
371 | 371 |
372 (internal linear merging at "hg pull --update") | 372 (internal linear merging at "hg pull --update") |
373 | 373 |
374 $ echo 'large1 for linear merge (conflict)' > large1 | 374 $ echo 'large1 for linear merge (conflict)' > large1 |
375 $ echo 'large2 for linear merge (conflict with normal file)' > large2 | 375 $ echo 'large2 for linear merge (conflict with normal file)' > large2 |
376 $ hg pull --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-backup.hg | 376 $ hg pull --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg |
377 pulling from $TESTTMP/9530e27857f7-backup.hg (glob) | 377 pulling from $TESTTMP/9530e27857f7-2e7b195d-backup.hg (glob) |
378 searching for changes | 378 searching for changes |
379 adding changesets | 379 adding changesets |
380 adding manifests | 380 adding manifests |
381 adding file changes | 381 adding file changes |
382 added 3 changesets with 5 changes to 5 files | 382 added 3 changesets with 5 changes to 5 files |
406 $ hg update -q -C 2 | 406 $ hg update -q -C 2 |
407 $ hg rollback -q | 407 $ hg rollback -q |
408 | 408 |
409 $ echo 'large1 for linear merge (conflict)' > large1 | 409 $ echo 'large1 for linear merge (conflict)' > large1 |
410 $ echo 'large2 for linear merge (conflict with normal file)' > large2 | 410 $ echo 'large2 for linear merge (conflict with normal file)' > large2 |
411 $ hg unbundle --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-backup.hg | 411 $ hg unbundle --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg |
412 adding changesets | 412 adding changesets |
413 adding manifests | 413 adding manifests |
414 adding file changes | 414 adding file changes |
415 added 3 changesets with 5 changes to 5 files | 415 added 3 changesets with 5 changes to 5 files |
416 remote turned local largefile large2 into a normal file | 416 remote turned local largefile large2 into a normal file |