comparison tests/test-rebase-named-branches.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 4bb348ae43cb
comparison
equal deleted inserted replaced
23834:bf07c19b4c82 23835:aa4a1672583e
71 $ hg rebase -b dev-two -d dev-one --keepbranches 71 $ hg rebase -b dev-two -d dev-one --keepbranches
72 rebasing 5:24b6387c8c8c "F" 72 rebasing 5:24b6387c8c8c "F"
73 rebasing 6:eea13746799a "G" 73 rebasing 6:eea13746799a "G"
74 rebasing 7:02de42196ebe "H" 74 rebasing 7:02de42196ebe "H"
75 rebasing 9:cb039b7cae8e "dev-two named branch" (tip) 75 rebasing 9:cb039b7cae8e "dev-two named branch" (tip)
76 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/24b6387c8c8c-backup.hg (glob) 76 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/24b6387c8c8c-24cb8001-backup.hg (glob)
77 77
78 $ hg tglog 78 $ hg tglog
79 @ 9: 'dev-two named branch' dev-two 79 @ 9: 'dev-two named branch' dev-two
80 | 80 |
81 o 8: 'H' 81 o 8: 'H'
101 note: rebase of 5:643fc9128048 created no changes to commit 101 note: rebase of 5:643fc9128048 created no changes to commit
102 rebasing 6:24de4aff8e28 "F" 102 rebasing 6:24de4aff8e28 "F"
103 rebasing 7:4b988a958030 "G" 103 rebasing 7:4b988a958030 "G"
104 rebasing 8:31d0e4ba75e6 "H" 104 rebasing 8:31d0e4ba75e6 "H"
105 rebasing 9:9e70cd31750f "dev-two named branch" (tip) 105 rebasing 9:9e70cd31750f "dev-two named branch" (tip)
106 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/643fc9128048-backup.hg (glob) 106 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/643fc9128048-c4ee9ef5-backup.hg (glob)
107 107
108 $ hg tglog 108 $ hg tglog
109 @ 8: 'dev-two named branch' dev-two 109 @ 8: 'dev-two named branch' dev-two
110 | 110 |
111 o 7: 'H' 111 o 7: 'H'
155 $ hg rebase -b 'max(branch("dev-two"))' -d dev-one --keepbranches 155 $ hg rebase -b 'max(branch("dev-two"))' -d dev-one --keepbranches
156 rebasing 5:77854864208c "F" 156 rebasing 5:77854864208c "F"
157 rebasing 6:63b4f9c788a1 "G" 157 rebasing 6:63b4f9c788a1 "G"
158 rebasing 7:87861e68abd3 "H" 158 rebasing 7:87861e68abd3 "H"
159 rebasing 8:ec00d4e0efca "dev-two named branch" 159 rebasing 8:ec00d4e0efca "dev-two named branch"
160 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/77854864208c-backup.hg (glob) 160 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/77854864208c-74d59436-backup.hg (glob)
161 161
162 $ hg tglog 162 $ hg tglog
163 o 9: 'dev-two named branch' dev-two 163 o 9: 'dev-two named branch' dev-two
164 | 164 |
165 o 8: 'H' 165 o 8: 'H'
185 note: rebase of 5:643fc9128048 created no changes to commit 185 note: rebase of 5:643fc9128048 created no changes to commit
186 rebasing 6:05584c618d45 "F" 186 rebasing 6:05584c618d45 "F"
187 rebasing 7:471695f5257d "G" 187 rebasing 7:471695f5257d "G"
188 rebasing 8:8382a539a2df "H" 188 rebasing 8:8382a539a2df "H"
189 rebasing 9:11f718458b32 "dev-two named branch" (tip) 189 rebasing 9:11f718458b32 "dev-two named branch" (tip)
190 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/643fc9128048-backup.hg (glob) 190 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/643fc9128048-177f3c5c-backup.hg (glob)
191 191
192 $ hg tglog 192 $ hg tglog
193 o 8: 'dev-two named branch' dev-two 193 o 8: 'dev-two named branch' dev-two
194 | 194 |
195 o 7: 'H' 195 o 7: 'H'
213 213
214 $ hg rebase -s 1 -d 8 --keepbranches 214 $ hg rebase -s 1 -d 8 --keepbranches
215 rebasing 1:42ccdea3bb16 "B" 215 rebasing 1:42ccdea3bb16 "B"
216 rebasing 2:5fddd98957c8 "C" 216 rebasing 2:5fddd98957c8 "C"
217 rebasing 3:32af7686d403 "D" 217 rebasing 3:32af7686d403 "D"
218 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/42ccdea3bb16-backup.hg (glob) 218 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/42ccdea3bb16-3cb021d3-backup.hg (glob)
219 219
220 $ hg tglog 220 $ hg tglog
221 o 8: 'D' 221 o 8: 'D'
222 | 222 |
223 o 7: 'C' 223 o 7: 'C'
243 $ hg rebase -s 5 -d 4 243 $ hg rebase -s 5 -d 4
244 rebasing 5:32d3b0de7f37 "dev-two named branch" 244 rebasing 5:32d3b0de7f37 "dev-two named branch"
245 rebasing 6:580fcd9fd48f "B" 245 rebasing 6:580fcd9fd48f "B"
246 rebasing 7:32aba0402ed2 "C" 246 rebasing 7:32aba0402ed2 "C"
247 rebasing 8:e4787b575338 "D" (tip) 247 rebasing 8:e4787b575338 "D" (tip)
248 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/32d3b0de7f37-backup.hg (glob) 248 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/32d3b0de7f37-c37815ca-backup.hg (glob)
249 249
250 $ hg tglog 250 $ hg tglog
251 o 8: 'D' 251 o 8: 'D'
252 | 252 |
253 o 7: 'C' 253 o 7: 'C'
278 rebasing 4:86693275b2ef "H" 278 rebasing 4:86693275b2ef "H"
279 rebasing 5:2149726d0970 "dev-two named branch" 279 rebasing 5:2149726d0970 "dev-two named branch"
280 rebasing 6:81e55225e95d "B" 280 rebasing 6:81e55225e95d "B"
281 rebasing 7:09eda3dc3195 "C" 281 rebasing 7:09eda3dc3195 "C"
282 rebasing 8:31298fc9d159 "D" 282 rebasing 8:31298fc9d159 "D"
283 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/86693275b2ef-backup.hg (glob) 283 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/86693275b2ef-f9fcf4e2-backup.hg (glob)
284 284
285 $ cd .. 285 $ cd ..
286 286
287 Rebase to other head on branch 287 Rebase to other head on branch
288 288
333 333
334 $ cd ../case2 334 $ cd ../case2
335 $ hg up -qr 1 335 $ hg up -qr 1
336 $ hg rebase 336 $ hg rebase
337 rebasing 1:40039acb7ca5 "b1" 337 rebasing 1:40039acb7ca5 "b1"
338 saved backup bundle to $TESTTMP/case2/.hg/strip-backup/40039acb7ca5-backup.hg (glob) 338 saved backup bundle to $TESTTMP/case2/.hg/strip-backup/40039acb7ca5-342b72d1-backup.hg (glob)
339 $ hg tglog 339 $ hg tglog
340 @ 3: 'b1' b 340 @ 3: 'b1' b
341 | 341 |
342 | o 2: 'c1' c 342 | o 2: 'c1' c
343 | | 343 | |