Mercurial > hg
comparison tests/test-rebase-bookmarks.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 | 4f18e80d9c30 |
children | ef1eb6df7071 |
comparison
equal
deleted
inserted
replaced
23834:bf07c19b4c82 | 23835:aa4a1672583e |
---|---|
73 |/ | 73 |/ |
74 o 0: 'A' bookmarks: Y@diverge | 74 o 0: 'A' bookmarks: Y@diverge |
75 | 75 |
76 $ hg rebase -s Y -d 3 | 76 $ hg rebase -s Y -d 3 |
77 rebasing 2:49cb3485fa0c "C" (Y Z) | 77 rebasing 2:49cb3485fa0c "C" (Y Z) |
78 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/49cb3485fa0c-backup.hg (glob) | 78 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/49cb3485fa0c-126f3e97-backup.hg (glob) |
79 | 79 |
80 $ hg tglog | 80 $ hg tglog |
81 @ 3: 'C' bookmarks: Y Z | 81 @ 3: 'C' bookmarks: Y Z |
82 | | 82 | |
83 o 2: 'D' bookmarks: W X@diverge | 83 o 2: 'D' bookmarks: W X@diverge |
95 $ hg up -q 2 | 95 $ hg up -q 2 |
96 $ hg book W@diverge | 96 $ hg book W@diverge |
97 | 97 |
98 $ hg rebase -s W -d . | 98 $ hg rebase -s W -d . |
99 rebasing 3:41acb9dca9eb "D" (tip W) | 99 rebasing 3:41acb9dca9eb "D" (tip W) |
100 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/41acb9dca9eb-backup.hg (glob) | 100 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/41acb9dca9eb-b35a6a63-backup.hg (glob) |
101 | 101 |
102 $ hg bookmarks | 102 $ hg bookmarks |
103 W 3:0d3554f74897 | 103 W 3:0d3554f74897 |
104 X 1:6c81ed0049f8 | 104 X 1:6c81ed0049f8 |
105 Y 2:49cb3485fa0c | 105 Y 2:49cb3485fa0c |
114 $ hg up -q Z | 114 $ hg up -q Z |
115 | 115 |
116 $ hg rebase -s 1 -d 3 | 116 $ hg rebase -s 1 -d 3 |
117 rebasing 1:6c81ed0049f8 "B" (X) | 117 rebasing 1:6c81ed0049f8 "B" (X) |
118 rebasing 2:49cb3485fa0c "C" (Y Z) | 118 rebasing 2:49cb3485fa0c "C" (Y Z) |
119 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/6c81ed0049f8-backup.hg (glob) | 119 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/6c81ed0049f8-a687065f-backup.hg (glob) |
120 | 120 |
121 $ hg tglog | 121 $ hg tglog |
122 @ 3: 'C' bookmarks: Y Z | 122 @ 3: 'C' bookmarks: Y Z |
123 | | 123 | |
124 o 2: 'B' bookmarks: X | 124 o 2: 'B' bookmarks: X |
137 $ hg up -q X | 137 $ hg up -q X |
138 | 138 |
139 $ hg rebase -d W | 139 $ hg rebase -d W |
140 rebasing 1:6c81ed0049f8 "B" (X) | 140 rebasing 1:6c81ed0049f8 "B" (X) |
141 rebasing 2:49cb3485fa0c "C" (Y Z) | 141 rebasing 2:49cb3485fa0c "C" (Y Z) |
142 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/6c81ed0049f8-backup.hg (glob) | 142 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/6c81ed0049f8-a687065f-backup.hg (glob) |
143 | 143 |
144 $ hg tglog | 144 $ hg tglog |
145 o 3: 'C' bookmarks: Y Z | 145 o 3: 'C' bookmarks: Y Z |
146 | | 146 | |
147 @ 2: 'B' bookmarks: X | 147 @ 2: 'B' bookmarks: X |
177 $ echo 'c' > c | 177 $ echo 'c' > c |
178 $ hg resolve --mark c | 178 $ hg resolve --mark c |
179 (no more unresolved files) | 179 (no more unresolved files) |
180 $ hg rebase --continue | 180 $ hg rebase --continue |
181 rebasing 3:3d5fa227f4b5 "C" (Y Z) | 181 rebasing 3:3d5fa227f4b5 "C" (Y Z) |
182 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/3d5fa227f4b5-backup.hg (glob) | 182 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/3d5fa227f4b5-c6ea2371-backup.hg (glob) |
183 $ hg tglog | 183 $ hg tglog |
184 @ 4: 'C' bookmarks: Y Z | 184 @ 4: 'C' bookmarks: Y Z |
185 | | 185 | |
186 o 3: 'other C' bookmarks: | 186 o 3: 'other C' bookmarks: |
187 | | 187 | |
207 $ hg update -q Y | 207 $ hg update -q Y |
208 $ hg rebase -r '"bisect"^^::"bisect"^' -r bisect -d Z | 208 $ hg rebase -r '"bisect"^^::"bisect"^' -r bisect -d Z |
209 rebasing 5:345c90f326a4 "bisect" | 209 rebasing 5:345c90f326a4 "bisect" |
210 rebasing 6:f677a2907404 "bisect2" | 210 rebasing 6:f677a2907404 "bisect2" |
211 rebasing 7:325c16001345 "bisect3" (tip bisect) | 211 rebasing 7:325c16001345 "bisect3" (tip bisect) |
212 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/345c90f326a4-backup.hg (glob) | 212 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/345c90f326a4-b4840586-backup.hg (glob) |