diff 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
line wrap: on
line diff
--- a/tests/test-largefiles-update.t	Mon Jan 12 18:01:20 2015 -0700
+++ b/tests/test-largefiles-update.t	Fri Jan 09 10:52:14 2015 -0800
@@ -366,15 +366,15 @@
 
   $ hg update -q -C 2
   $ hg strip 3 4
-  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9530e27857f7-backup.hg (glob)
-  $ mv .hg/strip-backup/9530e27857f7-backup.hg $TESTTMP
+  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9530e27857f7-2e7b195d-backup.hg (glob)
+  $ mv .hg/strip-backup/9530e27857f7-2e7b195d-backup.hg $TESTTMP
 
 (internal linear merging at "hg pull --update")
 
   $ echo 'large1 for linear merge (conflict)' > large1
   $ echo 'large2 for linear merge (conflict with normal file)' > large2
-  $ hg pull --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-backup.hg
-  pulling from $TESTTMP/9530e27857f7-backup.hg (glob)
+  $ hg pull --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg
+  pulling from $TESTTMP/9530e27857f7-2e7b195d-backup.hg (glob)
   searching for changes
   adding changesets
   adding manifests
@@ -408,7 +408,7 @@
 
   $ echo 'large1 for linear merge (conflict)' > large1
   $ echo 'large2 for linear merge (conflict with normal file)' > large2
-  $ hg unbundle --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-backup.hg
+  $ hg unbundle --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg
   adding changesets
   adding manifests
   adding file changes