Mercurial > public > mercurial-scm > hg
diff tests/test-rebase-cache.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 | 2fb0504b8175 |
children | 701df761aa94 |
line wrap: on
line diff
--- a/tests/test-rebase-cache.t Mon Jan 12 18:01:20 2015 -0700 +++ b/tests/test-rebase-cache.t Fri Jan 09 10:52:14 2015 -0800 @@ -107,7 +107,7 @@ $ hg rebase -s 5 -d 8 rebasing 5:635859577d0b "D" rebasing 6:5097051d331d "E" - saved backup bundle to $TESTTMP/a1/.hg/strip-backup/635859577d0b-backup.hg (glob) + saved backup bundle to $TESTTMP/a1/.hg/strip-backup/635859577d0b-89160bff-backup.hg (glob) $ hg branches branch3 8:466cdfb14b62 @@ -169,7 +169,7 @@ $ hg rebase -s 8 -d 6 rebasing 8:4666b71e8e32 "F" (tip) - saved backup bundle to $TESTTMP/a2/.hg/strip-backup/4666b71e8e32-backup.hg (glob) + saved backup bundle to $TESTTMP/a2/.hg/strip-backup/4666b71e8e32-fc1c4e96-backup.hg (glob) $ hg branches branch2 8:6b4bdc1b5ac0 @@ -236,7 +236,7 @@ rebasing 7:653b9feb4616 "branch3" note: rebase of 7:653b9feb4616 created no changes to commit rebasing 8:4666b71e8e32 "F" (tip) - saved backup bundle to $TESTTMP/a3/.hg/strip-backup/653b9feb4616-backup.hg (glob) + saved backup bundle to $TESTTMP/a3/.hg/strip-backup/653b9feb4616-3c88de16-backup.hg (glob) $ hg branches branch2 7:6b4bdc1b5ac0 @@ -273,7 +273,7 @@ $ hg strip 2 0 files updated, 0 files merged, 4 files removed, 0 files unresolved - saved backup bundle to $TESTTMP/a3/.hg/strip-backup/0a03079c47fd-backup.hg (glob) + saved backup bundle to $TESTTMP/a3/.hg/strip-backup/0a03079c47fd-11b7c407-backup.hg (glob) $ hg tglog o 3: 'C' branch2 @@ -334,7 +334,7 @@ $ hg strip 2 0 files updated, 0 files merged, 1 files removed, 0 files unresolved - saved backup bundle to $TESTTMP/a3/b/.hg/strip-backup/a5b4b27ed7b4-backup.hg (glob) + saved backup bundle to $TESTTMP/a3/b/.hg/strip-backup/a5b4b27ed7b4-a3b6984e-backup.hg (glob) $ hg theads 1: 'branch2' branch2 @@ -379,14 +379,14 @@ $ hg strip 3 4 0 files updated, 0 files merged, 2 files removed, 0 files unresolved - saved backup bundle to $TESTTMP/a3/c/.hg/strip-backup/67a385d4e6f2-backup.hg (glob) + saved backup bundle to $TESTTMP/a3/c/.hg/strip-backup/67a385d4e6f2-b9243789-backup.hg (glob) $ hg theads 2: 'C' $ hg strip 2 1 0 files updated, 0 files merged, 2 files removed, 0 files unresolved - saved backup bundle to $TESTTMP/a3/c/.hg/strip-backup/6c81ed0049f8-backup.hg (glob) + saved backup bundle to $TESTTMP/a3/c/.hg/strip-backup/6c81ed0049f8-a687065f-backup.hg (glob) $ hg theads 0: 'A' @@ -485,4 +485,4 @@ HGEDITFORM=rebase.merge rebasing 8:326cfedc031c "I" (tip) HGEDITFORM=rebase.normal - saved backup bundle to $TESTTMP/a3/c4/.hg/strip-backup/361a99976cc9-backup.hg (glob) + saved backup bundle to $TESTTMP/a3/c4/.hg/strip-backup/361a99976cc9-35e980d0-backup.hg (glob)