comparison tests/test-rebase-named-branches.t @ 26360:b2415e94b2f5

rebase: avoid losing branch commits with --keepbranch (issue4835)
author timeless@mozdev.org
date Thu, 24 Sep 2015 17:51:05 -0400
parents 701df761aa94
children fac3a24be50e
comparison
equal deleted inserted replaced
26359:c545d51c901e 26360:b2415e94b2f5
95 |/ 95 |/
96 o 0: 'A' 96 o 0: 'A'
97 97
98 $ hg rebase -s dev-one -d 0 --keepbranches 98 $ hg rebase -s dev-one -d 0 --keepbranches
99 rebasing 5:643fc9128048 "dev-one named branch" 99 rebasing 5:643fc9128048 "dev-one named branch"
100 note: rebase of 5:643fc9128048 created no changes to commit
101 rebasing 6:24de4aff8e28 "F" 100 rebasing 6:24de4aff8e28 "F"
102 rebasing 7:4b988a958030 "G" 101 rebasing 7:4b988a958030 "G"
103 rebasing 8:31d0e4ba75e6 "H" 102 rebasing 8:31d0e4ba75e6 "H"
104 rebasing 9:9e70cd31750f "dev-two named branch" (tip) 103 rebasing 9:9e70cd31750f "dev-two named branch" (tip)
105 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/643fc9128048-c4ee9ef5-backup.hg (glob) 104 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/643fc9128048-c4ee9ef5-backup.hg (glob)
106 105
107 $ hg tglog 106 $ hg tglog
108 @ 8: 'dev-two named branch' dev-two 107 @ 9: 'dev-two named branch' dev-two
109 | 108 |
110 o 7: 'H' 109 o 8: 'H'
111 | 110 |
112 | o 6: 'G' 111 | o 7: 'G'
113 |/| 112 |/|
114 o | 5: 'F' 113 o | 6: 'F'
114 | |
115 o | 5: 'dev-one named branch' dev-one
115 | | 116 | |
116 | o 4: 'E' 117 | o 4: 'E'
117 |/ 118 |/
118 | o 3: 'D' 119 | o 3: 'D'
119 | | 120 | |
123 |/ 124 |/
124 o 0: 'A' 125 o 0: 'A'
125 126
126 $ hg update 3 127 $ hg update 3
127 3 files updated, 0 files merged, 3 files removed, 0 files unresolved 128 3 files updated, 0 files merged, 3 files removed, 0 files unresolved
128 $ hg branch dev-one 129 $ hg branch -f dev-one
129 marked working directory as branch dev-one 130 marked working directory as branch dev-one
130 $ hg ci -m 'dev-one named branch' 131 $ hg ci -m 'dev-one named branch'
131 132 created new head
132 $ hg tglog 133
133 @ 9: 'dev-one named branch' dev-one 134 $ hg tglog
134 | 135 @ 10: 'dev-one named branch' dev-one
135 | o 8: 'dev-two named branch' dev-two 136 |
136 | | 137 | o 9: 'dev-two named branch' dev-two
137 | o 7: 'H' 138 | |
138 | | 139 | o 8: 'H'
139 | | o 6: 'G' 140 | |
141 | | o 7: 'G'
140 | |/| 142 | |/|
141 | o | 5: 'F' 143 | o | 6: 'F'
144 | | |
145 | o | 5: 'dev-one named branch' dev-one
142 | | | 146 | | |
143 | | o 4: 'E' 147 | | o 4: 'E'
144 | |/ 148 | |/
145 o | 3: 'D' 149 o | 3: 'D'
146 | | 150 | |
149 o | 1: 'B' 153 o | 1: 'B'
150 |/ 154 |/
151 o 0: 'A' 155 o 0: 'A'
152 156
153 $ hg rebase -b 'max(branch("dev-two"))' -d dev-one --keepbranches 157 $ hg rebase -b 'max(branch("dev-two"))' -d dev-one --keepbranches
154 rebasing 5:77854864208c "F" 158 rebasing 5:bc8139ee757c "dev-one named branch"
155 rebasing 6:63b4f9c788a1 "G" 159 note: rebase of 5:bc8139ee757c created no changes to commit
156 rebasing 7:87861e68abd3 "H" 160 rebasing 6:42aa3cf0fa7a "F"
157 rebasing 8:ec00d4e0efca "dev-two named branch" 161 rebasing 7:1a1e6f72ec38 "G"
158 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/77854864208c-74d59436-backup.hg (glob) 162 rebasing 8:904590360559 "H"
163 rebasing 9:59c2e59309fe "dev-two named branch"
164 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/bc8139ee757c-f11c1080-backup.hg (glob)
159 165
160 $ hg tglog 166 $ hg tglog
161 o 9: 'dev-two named branch' dev-two 167 o 9: 'dev-two named branch' dev-two
162 | 168 |
163 o 8: 'H' 169 o 8: 'H'
178 |/ 184 |/
179 o 0: 'A' 185 o 0: 'A'
180 186
181 $ hg rebase -s 'max(branch("dev-one"))' -d 0 --keepbranches 187 $ hg rebase -s 'max(branch("dev-one"))' -d 0 --keepbranches
182 rebasing 5:643fc9128048 "dev-one named branch" 188 rebasing 5:643fc9128048 "dev-one named branch"
183 note: rebase of 5:643fc9128048 created no changes to commit 189 rebasing 6:679f28760620 "F"
184 rebasing 6:05584c618d45 "F" 190 rebasing 7:549f007a9f5f "G"
185 rebasing 7:471695f5257d "G" 191 rebasing 8:12b2bc666e20 "H"
186 rebasing 8:8382a539a2df "H" 192 rebasing 9:71325f8bc082 "dev-two named branch" (tip)
187 rebasing 9:11f718458b32 "dev-two named branch" (tip) 193 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/643fc9128048-6cdd1a52-backup.hg (glob)
188 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/643fc9128048-177f3c5c-backup.hg (glob) 194
189 195 $ hg tglog
190 $ hg tglog 196 o 9: 'dev-two named branch' dev-two
191 o 8: 'dev-two named branch' dev-two 197 |
192 | 198 o 8: 'H'
193 o 7: 'H' 199 |
194 | 200 | o 7: 'G'
195 | o 6: 'G' 201 |/|
196 |/| 202 o | 6: 'F'
197 o | 5: 'F' 203 | |
204 @ | 5: 'dev-one named branch' dev-one
198 | | 205 | |
199 | o 4: 'E' 206 | o 4: 'E'
200 |/ 207 |/
201 | o 3: 'D' 208 | o 3: 'D'
202 | | 209 | |
203 | o 2: 'C' 210 | o 2: 'C'
204 | | 211 | |
205 | o 1: 'B' 212 | o 1: 'B'
206 |/ 213 |/
207 @ 0: 'A' 214 o 0: 'A'
208 215
216 $ hg up -r 0 > /dev/null
209 217
210 Rebasing descendant onto ancestor across different named branches 218 Rebasing descendant onto ancestor across different named branches
211 219
212 $ hg rebase -s 1 -d 8 --keepbranches 220 $ hg rebase -s 1 -d 9 --keepbranches
213 rebasing 1:42ccdea3bb16 "B" 221 rebasing 1:42ccdea3bb16 "B"
214 rebasing 2:5fddd98957c8 "C" 222 rebasing 2:5fddd98957c8 "C"
215 rebasing 3:32af7686d403 "D" 223 rebasing 3:32af7686d403 "D"
216 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/42ccdea3bb16-3cb021d3-backup.hg (glob) 224 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/42ccdea3bb16-3cb021d3-backup.hg (glob)
217 225
218 $ hg tglog 226 $ hg tglog
219 o 8: 'D' 227 o 9: 'D'
220 | 228 |
221 o 7: 'C' 229 o 8: 'C'
222 | 230 |
223 o 6: 'B' 231 o 7: 'B'
224 | 232 |
225 o 5: 'dev-two named branch' dev-two 233 o 6: 'dev-two named branch' dev-two
226 | 234 |
227 o 4: 'H' 235 o 5: 'H'
228 | 236 |
229 | o 3: 'G' 237 | o 4: 'G'
230 |/| 238 |/|
231 o | 2: 'F' 239 o | 3: 'F'
240 | |
241 o | 2: 'dev-one named branch' dev-one
232 | | 242 | |
233 | o 1: 'E' 243 | o 1: 'E'
234 |/ 244 |/
235 @ 0: 'A' 245 @ 0: 'A'
236 246
237 $ hg rebase -s 4 -d 5 247 $ hg rebase -s 5 -d 6
238 abort: source is ancestor of destination 248 abort: source is ancestor of destination
239 [255] 249 [255]
240 250
241 $ hg rebase -s 5 -d 4 251 $ hg rebase -s 6 -d 5
242 rebasing 5:32d3b0de7f37 "dev-two named branch" 252 rebasing 6:3944801ae4ea "dev-two named branch"
243 rebasing 6:580fcd9fd48f "B" 253 rebasing 7:3bdb949809d9 "B"
244 rebasing 7:32aba0402ed2 "C" 254 rebasing 8:a0d543090fa4 "C"
245 rebasing 8:e4787b575338 "D" (tip) 255 rebasing 9:e9f862ce8bad "D" (tip)
246 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/32d3b0de7f37-c37815ca-backup.hg (glob) 256 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/3944801ae4ea-fb46ed74-backup.hg (glob)
247 257
248 $ hg tglog 258 $ hg tglog
249 o 8: 'D' 259 o 9: 'D'
250 | 260 |
251 o 7: 'C' 261 o 8: 'C'
252 | 262 |
253 o 6: 'B' 263 o 7: 'B'
254 | 264 |
255 o 5: 'dev-two named branch' 265 o 6: 'dev-two named branch'
256 | 266 |
257 o 4: 'H' 267 o 5: 'H'
258 | 268 |
259 | o 3: 'G' 269 | o 4: 'G'
260 |/| 270 |/|
261 o | 2: 'F' 271 o | 3: 'F'
272 | |
273 o | 2: 'dev-one named branch' dev-one
262 | | 274 | |
263 | o 1: 'E' 275 | o 1: 'E'
264 |/ 276 |/
265 @ 0: 'A' 277 @ 0: 'A'
266 278
270 $ hg up -qr3 282 $ hg up -qr3
271 $ hg branch -q b 283 $ hg branch -q b
272 $ hg ci -m 'create b' 284 $ hg ci -m 'create b'
273 $ hg ci -m 'close b' --close 285 $ hg ci -m 'close b' --close
274 $ hg rebase -b 8 -d b 286 $ hg rebase -b 8 -d b
275 reopening closed branch head ea9de14a36c6 287 reopening closed branch head 2b586e70108d
276 rebasing 4:86693275b2ef "H" 288 rebasing 5:8e279d293175 "H"
277 rebasing 5:2149726d0970 "dev-two named branch" 289 rebasing 6:c57724c84928 "dev-two named branch"
278 rebasing 6:81e55225e95d "B" 290 rebasing 7:160b0930ccc6 "B"
279 rebasing 7:09eda3dc3195 "C" 291 rebasing 8:810110211f50 "C"
280 rebasing 8:31298fc9d159 "D" 292 rebasing 9:e522577ccdbd "D"
281 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/86693275b2ef-f9fcf4e2-backup.hg (glob) 293 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/8e279d293175-b023e27c-backup.hg (glob)
282 294
283 $ cd .. 295 $ cd ..
284 296
285 Rebase to other head on branch 297 Rebase to other head on branch
286 298