Mercurial > hg-stable
diff tests/test-rebase-parameters.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 | 3cbb5bf4035d |
line wrap: on
line diff
--- a/tests/test-rebase-parameters.t Mon Jan 12 18:01:20 2015 -0700 +++ b/tests/test-rebase-parameters.t Fri Jan 09 10:52:14 2015 -0800 @@ -123,7 +123,7 @@ rebasing 1:42ccdea3bb16 "B" rebasing 2:5fddd98957c8 "C" rebasing 3:32af7686d403 "D" - saved backup bundle to $TESTTMP/a1/.hg/strip-backup/42ccdea3bb16-backup.hg (glob) + saved backup bundle to $TESTTMP/a1/.hg/strip-backup/42ccdea3bb16-3cb021d3-backup.hg (glob) $ hg tglog @ 8: 'D' @@ -161,7 +161,7 @@ rebasing 1:42ccdea3bb16 "B" rebasing 2:5fddd98957c8 "C" rebasing 3:32af7686d403 "D" - saved backup bundle to $TESTTMP/a2/.hg/strip-backup/42ccdea3bb16-backup.hg (glob) + saved backup bundle to $TESTTMP/a2/.hg/strip-backup/42ccdea3bb16-3cb021d3-backup.hg (glob) $ hg tglog @ 8: 'D' @@ -194,7 +194,7 @@ rebasing 1:42ccdea3bb16 "B" rebasing 2:5fddd98957c8 "C" rebasing 3:32af7686d403 "D" - saved backup bundle to $TESTTMP/a3/.hg/strip-backup/42ccdea3bb16-backup.hg (glob) + saved backup bundle to $TESTTMP/a3/.hg/strip-backup/42ccdea3bb16-3cb021d3-backup.hg (glob) $ hg tglog @ 8: 'D' @@ -226,7 +226,7 @@ $ hg rebase --source 'desc("C")' rebasing 2:5fddd98957c8 "C" rebasing 3:32af7686d403 "D" - saved backup bundle to $TESTTMP/a4/.hg/strip-backup/5fddd98957c8-backup.hg (glob) + saved backup bundle to $TESTTMP/a4/.hg/strip-backup/5fddd98957c8-f9244fa1-backup.hg (glob) $ hg tglog o 8: 'D' @@ -259,7 +259,7 @@ rebasing 1:42ccdea3bb16 "B" rebasing 2:5fddd98957c8 "C" rebasing 3:32af7686d403 "D" - saved backup bundle to $TESTTMP/a5/.hg/strip-backup/42ccdea3bb16-backup.hg (glob) + saved backup bundle to $TESTTMP/a5/.hg/strip-backup/42ccdea3bb16-3cb021d3-backup.hg (glob) $ hg tglog @ 8: 'D' @@ -292,7 +292,7 @@ rebasing 1:42ccdea3bb16 "B" rebasing 2:5fddd98957c8 "C" rebasing 3:32af7686d403 "D" - saved backup bundle to $TESTTMP/a6/.hg/strip-backup/42ccdea3bb16-backup.hg (glob) + saved backup bundle to $TESTTMP/a6/.hg/strip-backup/42ccdea3bb16-3cb021d3-backup.hg (glob) $ hg tglog o 8: 'D' @@ -324,7 +324,7 @@ $ hg rebase --source 2 --dest 7 rebasing 2:5fddd98957c8 "C" rebasing 3:32af7686d403 "D" - saved backup bundle to $TESTTMP/a7/.hg/strip-backup/5fddd98957c8-backup.hg (glob) + saved backup bundle to $TESTTMP/a7/.hg/strip-backup/5fddd98957c8-f9244fa1-backup.hg (glob) $ hg tglog o 8: 'D' @@ -357,7 +357,7 @@ rebasing 1:42ccdea3bb16 "B" rebasing 2:5fddd98957c8 "C" rebasing 3:32af7686d403 "D" - saved backup bundle to $TESTTMP/a8/.hg/strip-backup/42ccdea3bb16-backup.hg (glob) + saved backup bundle to $TESTTMP/a8/.hg/strip-backup/42ccdea3bb16-3cb021d3-backup.hg (glob) $ hg tglog o 8: 'D' @@ -389,7 +389,7 @@ $ hg rebase --rev 'desc("C")::' rebasing 2:5fddd98957c8 "C" rebasing 3:32af7686d403 "D" - saved backup bundle to $TESTTMP/a9/.hg/strip-backup/5fddd98957c8-backup.hg (glob) + saved backup bundle to $TESTTMP/a9/.hg/strip-backup/5fddd98957c8-f9244fa1-backup.hg (glob) $ hg tglog o 8: 'D' @@ -439,7 +439,7 @@ $ hg rebase -s 2 -d 1 --tool internal:local rebasing 2:e4e3f3546619 "c2b" (tip) note: rebase of 2:e4e3f3546619 created no changes to commit - saved backup bundle to $TESTTMP/b1/.hg/strip-backup/e4e3f3546619-backup.hg (glob) + saved backup bundle to $TESTTMP/b1/.hg/strip-backup/e4e3f3546619-b0841178-backup.hg (glob) $ hg cat c2 c2 @@ -452,7 +452,7 @@ $ hg rebase -s 2 -d 1 --tool internal:other rebasing 2:e4e3f3546619 "c2b" (tip) - saved backup bundle to $TESTTMP/b2/.hg/strip-backup/e4e3f3546619-backup.hg (glob) + saved backup bundle to $TESTTMP/b2/.hg/strip-backup/e4e3f3546619-b0841178-backup.hg (glob) $ hg cat c2 c2b @@ -487,7 +487,7 @@ tool option will be ignored rebasing 2:e4e3f3546619 "c2b" (tip) note: rebase of 2:e4e3f3546619 created no changes to commit - saved backup bundle to $TESTTMP/b3/.hg/strip-backup/e4e3f3546619-backup.hg (glob) + saved backup bundle to $TESTTMP/b3/.hg/strip-backup/e4e3f3546619-b0841178-backup.hg (glob) $ hg rebase -i abort: interactive history editing is supported by the 'histedit' extension (see 'hg help histedit')