Show More
@@ -1,819 +1,819 b'' | |||
|
1 | 1 | $ cat >> $HGRCPATH <<EOF |
|
2 | 2 | > [extensions] |
|
3 | 3 | > rebase= |
|
4 | 4 | > mq= |
|
5 | 5 | > drawdag=$TESTDIR/drawdag.py |
|
6 | 6 | > |
|
7 | 7 | > [phases] |
|
8 | 8 | > publish=False |
|
9 | 9 | > |
|
10 | 10 | > [alias] |
|
11 | 11 | > tglog = log -G --template "{rev}: {node|short} '{desc}' {branches}\n" |
|
12 | 12 | > tglogp = log -G --template "{rev}: {node|short} {phase} '{desc}' {branches}\n" |
|
13 | 13 | > EOF |
|
14 | 14 | |
|
15 | 15 | Highest phase of source commits is used: |
|
16 | 16 | |
|
17 | 17 | $ hg init phase |
|
18 | 18 | $ cd phase |
|
19 | 19 | $ hg debugdrawdag << 'EOF' |
|
20 | 20 | > D |
|
21 | 21 | > | |
|
22 | 22 | > F C |
|
23 | 23 | > | | |
|
24 | 24 | > E B |
|
25 | 25 | > |/ |
|
26 | 26 | > A |
|
27 | 27 | > EOF |
|
28 | 28 | |
|
29 | 29 | $ hg phase --force --secret D |
|
30 | 30 | |
|
31 | 31 | $ cat > $TESTTMP/editor.sh <<EOF |
|
32 | 32 | > echo "==== before editing" |
|
33 | 33 | > cat \$1 |
|
34 | 34 | > echo "====" |
|
35 | 35 | > echo "edited manually" >> \$1 |
|
36 | 36 | > EOF |
|
37 | $ HGEDITOR="sh $TESTTMP/editor.sh" hg rebase --collapse --keepbranches -e --dest F | |
|
37 | $ HGEDITOR="sh $TESTTMP/editor.sh" hg rebase --collapse --keepbranches -e --source B --dest F | |
|
38 | 38 | rebasing 1:112478962961 "B" (B) |
|
39 | 39 | rebasing 3:26805aba1e60 "C" (C) |
|
40 | 40 | rebasing 5:f585351a92f8 "D" (D tip) |
|
41 | 41 | ==== before editing |
|
42 | 42 | Collapsed revision |
|
43 | 43 | * B |
|
44 | 44 | * C |
|
45 | 45 | * D |
|
46 | 46 | |
|
47 | 47 | |
|
48 | 48 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
49 | 49 | HG: Leave message empty to abort commit. |
|
50 | 50 | HG: -- |
|
51 | 51 | HG: user: test |
|
52 | 52 | HG: branch 'default' |
|
53 | 53 | HG: added B |
|
54 | 54 | HG: added C |
|
55 | 55 | HG: added D |
|
56 | 56 | ==== |
|
57 | 57 | saved backup bundle to $TESTTMP/phase/.hg/strip-backup/112478962961-cb2a9b47-rebase.hg |
|
58 | 58 | |
|
59 | 59 | $ hg tglogp |
|
60 | 60 | o 3: 92fa5f5fe108 secret 'Collapsed revision |
|
61 | 61 | | * B |
|
62 | 62 | | * C |
|
63 | 63 | | * D |
|
64 | 64 | | |
|
65 | 65 | | |
|
66 | 66 | | edited manually' |
|
67 | 67 | o 2: 64a8289d2492 draft 'F' |
|
68 | 68 | | |
|
69 | 69 | o 1: 7fb047a69f22 draft 'E' |
|
70 | 70 | | |
|
71 | 71 | o 0: 426bada5c675 draft 'A' |
|
72 | 72 | |
|
73 | 73 | $ hg manifest --rev tip |
|
74 | 74 | A |
|
75 | 75 | B |
|
76 | 76 | C |
|
77 | 77 | D |
|
78 | 78 | E |
|
79 | 79 | F |
|
80 | 80 | |
|
81 | 81 | $ cd .. |
|
82 | 82 | |
|
83 | 83 | |
|
84 | 84 | Merge gets linearized: |
|
85 | 85 | |
|
86 | 86 | $ hg init linearized-merge |
|
87 | 87 | $ cd linearized-merge |
|
88 | 88 | |
|
89 | 89 | $ hg debugdrawdag << 'EOF' |
|
90 | 90 | > F D |
|
91 | 91 | > |/| |
|
92 | 92 | > C B |
|
93 | 93 | > |/ |
|
94 | 94 | > A |
|
95 | 95 | > EOF |
|
96 | 96 | |
|
97 | 97 | $ hg phase --force --secret D |
|
98 | 98 | $ hg rebase --source B --collapse --dest F |
|
99 | 99 | rebasing 1:112478962961 "B" (B) |
|
100 | 100 | rebasing 3:4e4f9194f9f1 "D" (D) |
|
101 | 101 | saved backup bundle to $TESTTMP/linearized-merge/.hg/strip-backup/112478962961-e389075b-rebase.hg |
|
102 | 102 | |
|
103 | 103 | $ hg tglog |
|
104 | 104 | o 3: 5bdc08b7da2b 'Collapsed revision |
|
105 | 105 | | * B |
|
106 | 106 | | * D' |
|
107 | 107 | o 2: afc707c82df0 'F' |
|
108 | 108 | | |
|
109 | 109 | o 1: dc0947a82db8 'C' |
|
110 | 110 | | |
|
111 | 111 | o 0: 426bada5c675 'A' |
|
112 | 112 | |
|
113 | 113 | $ hg manifest --rev tip |
|
114 | 114 | A |
|
115 | 115 | B |
|
116 | 116 | C |
|
117 | 117 | F |
|
118 | 118 | |
|
119 | 119 | $ cd .. |
|
120 | 120 | |
|
121 | 121 | Custom message: |
|
122 | 122 | |
|
123 | 123 | $ hg init message |
|
124 | 124 | $ cd message |
|
125 | 125 | |
|
126 | 126 | $ hg debugdrawdag << 'EOF' |
|
127 | 127 | > C |
|
128 | 128 | > | |
|
129 | 129 | > D B |
|
130 | 130 | > |/ |
|
131 | 131 | > A |
|
132 | 132 | > EOF |
|
133 | 133 | |
|
134 | 134 | |
|
135 | 135 | $ hg rebase --base B -m 'custom message' |
|
136 | 136 | abort: message can only be specified with collapse |
|
137 | 137 | [255] |
|
138 | 138 | |
|
139 | 139 | $ cat > $TESTTMP/checkeditform.sh <<EOF |
|
140 | 140 | > env | grep HGEDITFORM |
|
141 | 141 | > true |
|
142 | 142 | > EOF |
|
143 | 143 | $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg rebase --source B --collapse -m 'custom message' -e --dest D |
|
144 | 144 | rebasing 1:112478962961 "B" (B) |
|
145 | 145 | rebasing 3:26805aba1e60 "C" (C tip) |
|
146 | 146 | HGEDITFORM=rebase.collapse |
|
147 | 147 | saved backup bundle to $TESTTMP/message/.hg/strip-backup/112478962961-f4131707-rebase.hg |
|
148 | 148 | |
|
149 | 149 | $ hg tglog |
|
150 | 150 | o 2: 2f197b9a08f3 'custom message' |
|
151 | 151 | | |
|
152 | 152 | o 1: b18e25de2cf5 'D' |
|
153 | 153 | | |
|
154 | 154 | o 0: 426bada5c675 'A' |
|
155 | 155 | |
|
156 | 156 | $ hg manifest --rev tip |
|
157 | 157 | A |
|
158 | 158 | B |
|
159 | 159 | C |
|
160 | 160 | D |
|
161 | 161 | |
|
162 | 162 | $ cd .. |
|
163 | 163 | |
|
164 | 164 | Rebase and collapse - more than one external (fail): |
|
165 | 165 | |
|
166 | 166 | $ hg init multiple-external-parents |
|
167 | 167 | $ cd multiple-external-parents |
|
168 | 168 | |
|
169 | 169 | $ hg debugdrawdag << 'EOF' |
|
170 | 170 | > G |
|
171 | 171 | > |\ |
|
172 | 172 | > | F |
|
173 | 173 | > | | |
|
174 | 174 | > D E |
|
175 | 175 | > |\| |
|
176 | 176 | > H C B |
|
177 | 177 | > \|/ |
|
178 | 178 | > A |
|
179 | 179 | > EOF |
|
180 | 180 | |
|
181 | 181 | $ hg rebase -s C --dest H --collapse |
|
182 | 182 | abort: unable to collapse on top of 3, there is more than one external parent: 1, 6 |
|
183 | 183 | [255] |
|
184 | 184 | |
|
185 | 185 | Rebase and collapse - E onto H: |
|
186 | 186 | |
|
187 | 187 | $ hg rebase -s E --dest I --collapse # root (E) is not a merge |
|
188 | 188 | abort: unknown revision 'I'! |
|
189 | 189 | [255] |
|
190 | 190 | |
|
191 | 191 | $ hg tglog |
|
192 | 192 | o 7: 64e264db77f0 'G' |
|
193 | 193 | |\ |
|
194 | 194 | | o 6: 11abe3fb10b8 'F' |
|
195 | 195 | | | |
|
196 | 196 | | o 5: 49cb92066bfd 'E' |
|
197 | 197 | | | |
|
198 | 198 | o | 4: 4e4f9194f9f1 'D' |
|
199 | 199 | |\| |
|
200 | 200 | | | o 3: 575c4b5ec114 'H' |
|
201 | 201 | | | | |
|
202 | 202 | o---+ 2: dc0947a82db8 'C' |
|
203 | 203 | / / |
|
204 | 204 | o / 1: 112478962961 'B' |
|
205 | 205 | |/ |
|
206 | 206 | o 0: 426bada5c675 'A' |
|
207 | 207 | |
|
208 | 208 | $ hg manifest --rev tip |
|
209 | 209 | A |
|
210 | 210 | B |
|
211 | 211 | C |
|
212 | 212 | E |
|
213 | 213 | F |
|
214 | 214 | |
|
215 | 215 | $ cd .. |
|
216 | 216 | |
|
217 | 217 | |
|
218 | 218 | |
|
219 | 219 | |
|
220 | 220 | Test that branchheads cache is updated correctly when doing a strip in which |
|
221 | 221 | the parent of the ancestor node to be stripped does not become a head and also, |
|
222 | 222 | the parent of a node that is a child of the node stripped becomes a head (node |
|
223 | 223 | 3). The code is now much simpler and we could just test a simpler scenario |
|
224 | 224 | We keep it the test this way in case new complexity is injected. |
|
225 | 225 | |
|
226 | 226 | Create repo b: |
|
227 | 227 | |
|
228 | 228 | $ hg init branch-heads |
|
229 | 229 | $ cd branch-heads |
|
230 | 230 | |
|
231 | 231 | $ hg debugdrawdag << 'EOF' |
|
232 | 232 | > G |
|
233 | 233 | > |\ |
|
234 | 234 | > | F |
|
235 | 235 | > | | |
|
236 | 236 | > D E |
|
237 | 237 | > |\| |
|
238 | 238 | > H C B |
|
239 | 239 | > \|/ |
|
240 | 240 | > A |
|
241 | 241 | > EOF |
|
242 | 242 | |
|
243 | 243 | $ hg heads --template="{rev}:{node} {branch}\n" |
|
244 | 244 | 7:64e264db77f061f16d9132b70c5a58e2461fb630 default |
|
245 | 245 | 3:575c4b5ec114d64b681d33f8792853568bfb2b2c default |
|
246 | 246 | |
|
247 | 247 | $ cat $TESTTMP/branch-heads/.hg/cache/branch2-served |
|
248 | 248 | 64e264db77f061f16d9132b70c5a58e2461fb630 7 |
|
249 | 249 | 575c4b5ec114d64b681d33f8792853568bfb2b2c o default |
|
250 | 250 | 64e264db77f061f16d9132b70c5a58e2461fb630 o default |
|
251 | 251 | |
|
252 | 252 | $ hg strip 4 |
|
253 | 253 | saved backup bundle to $TESTTMP/branch-heads/.hg/strip-backup/4e4f9194f9f1-5ec4b5e6-backup.hg |
|
254 | 254 | |
|
255 | 255 | $ cat $TESTTMP/branch-heads/.hg/cache/branch2-served |
|
256 | 256 | 11abe3fb10b8689b560681094b17fe161871d043 5 |
|
257 | 257 | dc0947a82db884575bb76ea10ac97b08536bfa03 o default |
|
258 | 258 | 575c4b5ec114d64b681d33f8792853568bfb2b2c o default |
|
259 | 259 | 11abe3fb10b8689b560681094b17fe161871d043 o default |
|
260 | 260 | |
|
261 | 261 | $ hg heads --template="{rev}:{node} {branch}\n" |
|
262 | 262 | 5:11abe3fb10b8689b560681094b17fe161871d043 default |
|
263 | 263 | 3:575c4b5ec114d64b681d33f8792853568bfb2b2c default |
|
264 | 264 | 2:dc0947a82db884575bb76ea10ac97b08536bfa03 default |
|
265 | 265 | |
|
266 | 266 | $ cd .. |
|
267 | 267 | |
|
268 | 268 | |
|
269 | 269 | |
|
270 | 270 | Preserves external parent |
|
271 | 271 | |
|
272 | 272 | $ hg init external-parent |
|
273 | 273 | $ cd external-parent |
|
274 | 274 | |
|
275 | 275 | $ hg debugdrawdag << 'EOF' |
|
276 | 276 | > H |
|
277 | 277 | > |\ |
|
278 | 278 | > | G |
|
279 | 279 | > | | |
|
280 | 280 | > | F # F/E = F\n |
|
281 | 281 | > | | |
|
282 | 282 | > D E # D/D = D\n |
|
283 | 283 | > |\| |
|
284 | 284 | > I C B |
|
285 | 285 | > \|/ |
|
286 | 286 | > A |
|
287 | 287 | > EOF |
|
288 | 288 | |
|
289 | 289 | $ hg rebase -s F --dest I --collapse # root (F) is not a merge |
|
290 | 290 | rebasing 6:c82b08f646f1 "F" (F) |
|
291 | 291 | rebasing 7:a6db7fa104e1 "G" (G) |
|
292 | 292 | rebasing 8:e1d201b72d91 "H" (H tip) |
|
293 | 293 | saved backup bundle to $TESTTMP/external-parent/.hg/strip-backup/c82b08f646f1-f2721fbf-rebase.hg |
|
294 | 294 | |
|
295 | 295 | $ hg tglog |
|
296 | 296 | o 6: 681daa3e686d 'Collapsed revision |
|
297 | 297 | |\ * F |
|
298 | 298 | | | * G |
|
299 | 299 | | | * H' |
|
300 | 300 | | | o 5: 49cb92066bfd 'E' |
|
301 | 301 | | | | |
|
302 | 302 | | o | 4: 09143c0bf13e 'D' |
|
303 | 303 | | |\| |
|
304 | 304 | o | | 3: 08ebfeb61bac 'I' |
|
305 | 305 | | | | |
|
306 | 306 | | o | 2: dc0947a82db8 'C' |
|
307 | 307 | |/ / |
|
308 | 308 | | o 1: 112478962961 'B' |
|
309 | 309 | |/ |
|
310 | 310 | o 0: 426bada5c675 'A' |
|
311 | 311 | |
|
312 | 312 | $ hg manifest --rev tip |
|
313 | 313 | A |
|
314 | 314 | C |
|
315 | 315 | D |
|
316 | 316 | E |
|
317 | 317 | F |
|
318 | 318 | G |
|
319 | 319 | I |
|
320 | 320 | |
|
321 | 321 | $ hg up tip -q |
|
322 | 322 | $ cat E |
|
323 | 323 | F |
|
324 | 324 | |
|
325 | 325 | $ cd .. |
|
326 | 326 | |
|
327 | 327 | Rebasing from multiple bases: |
|
328 | 328 | |
|
329 | 329 | $ hg init multiple-bases |
|
330 | 330 | $ cd multiple-bases |
|
331 | 331 | $ hg debugdrawdag << 'EOF' |
|
332 | 332 | > C B |
|
333 | 333 | > D |/ |
|
334 | 334 | > |/ |
|
335 | 335 | > A |
|
336 | 336 | > EOF |
|
337 | 337 | $ hg rebase --collapse -r 'B+C' -d D |
|
338 | 338 | rebasing 1:fc2b737bb2e5 "B" (B) |
|
339 | 339 | rebasing 2:dc0947a82db8 "C" (C) |
|
340 | 340 | saved backup bundle to $TESTTMP/multiple-bases/.hg/strip-backup/dc0947a82db8-b0c1a7ea-rebase.hg |
|
341 | 341 | $ hg tglog |
|
342 | 342 | o 2: 2127ae44d291 'Collapsed revision |
|
343 | 343 | | * B |
|
344 | 344 | | * C' |
|
345 | 345 | o 1: b18e25de2cf5 'D' |
|
346 | 346 | | |
|
347 | 347 | o 0: 426bada5c675 'A' |
|
348 | 348 | |
|
349 | 349 | $ cd .. |
|
350 | 350 | |
|
351 | 351 | With non-contiguous commits: |
|
352 | 352 | |
|
353 | 353 | $ hg init non-contiguous |
|
354 | 354 | $ cd non-contiguous |
|
355 | 355 | $ cat >> .hg/hgrc <<EOF |
|
356 | 356 | > [experimental] |
|
357 | 357 | > evolution=all |
|
358 | 358 | > EOF |
|
359 | 359 | |
|
360 | 360 | $ hg debugdrawdag << 'EOF' |
|
361 | 361 | > F |
|
362 | 362 | > | |
|
363 | 363 | > E |
|
364 | 364 | > | |
|
365 | 365 | > D |
|
366 | 366 | > | |
|
367 | 367 | > C |
|
368 | 368 | > | |
|
369 | 369 | > B G |
|
370 | 370 | > |/ |
|
371 | 371 | > A |
|
372 | 372 | > EOF |
|
373 | 373 | |
|
374 | 374 | BROKEN: should be allowed |
|
375 | 375 | $ hg rebase --collapse -r 'B+D+F' -d G |
|
376 | 376 | abort: unable to collapse on top of 2, there is more than one external parent: 3, 5 |
|
377 | 377 | [255] |
|
378 | 378 | $ cd .. |
|
379 | 379 | |
|
380 | 380 | |
|
381 | 381 | $ hg init multiple-external-parents-2 |
|
382 | 382 | $ cd multiple-external-parents-2 |
|
383 | 383 | $ hg debugdrawdag << 'EOF' |
|
384 | 384 | > D G |
|
385 | 385 | > |\ /| |
|
386 | 386 | > B C E F |
|
387 | 387 | > \| |/ |
|
388 | 388 | > \ H / |
|
389 | 389 | > \|/ |
|
390 | 390 | > A |
|
391 | 391 | > EOF |
|
392 | 392 | |
|
393 | 393 | $ hg rebase --collapse -d H -s 'B+F' |
|
394 | 394 | abort: unable to collapse on top of 5, there is more than one external parent: 1, 3 |
|
395 | 395 | [255] |
|
396 | 396 | $ cd .. |
|
397 | 397 | |
|
398 | 398 | With internal merge: |
|
399 | 399 | |
|
400 | 400 | $ hg init internal-merge |
|
401 | 401 | $ cd internal-merge |
|
402 | 402 | |
|
403 | 403 | $ hg debugdrawdag << 'EOF' |
|
404 | 404 | > E |
|
405 | 405 | > |\ |
|
406 | 406 | > C D |
|
407 | 407 | > |/ |
|
408 | 408 | > F B |
|
409 | 409 | > |/ |
|
410 | 410 | > A |
|
411 | 411 | > EOF |
|
412 | 412 | |
|
413 | 413 | |
|
414 | 414 | $ hg rebase -s B --collapse --dest F |
|
415 | 415 | rebasing 1:112478962961 "B" (B) |
|
416 | 416 | rebasing 3:26805aba1e60 "C" (C) |
|
417 | 417 | rebasing 4:be0ef73c17ad "D" (D) |
|
418 | 418 | rebasing 5:02c4367d6973 "E" (E tip) |
|
419 | 419 | saved backup bundle to $TESTTMP/internal-merge/.hg/strip-backup/112478962961-1dfb057b-rebase.hg |
|
420 | 420 | |
|
421 | 421 | $ hg tglog |
|
422 | 422 | o 2: c0512a1797b0 'Collapsed revision |
|
423 | 423 | | * B |
|
424 | 424 | | * C |
|
425 | 425 | | * D |
|
426 | 426 | | * E' |
|
427 | 427 | o 1: 8908a377a434 'F' |
|
428 | 428 | | |
|
429 | 429 | o 0: 426bada5c675 'A' |
|
430 | 430 | |
|
431 | 431 | $ hg manifest --rev tip |
|
432 | 432 | A |
|
433 | 433 | B |
|
434 | 434 | C |
|
435 | 435 | D |
|
436 | 436 | F |
|
437 | 437 | $ cd .. |
|
438 | 438 | |
|
439 | 439 | Interactions between collapse and keepbranches |
|
440 | 440 | $ hg init e |
|
441 | 441 | $ cd e |
|
442 | 442 | $ echo 'a' > a |
|
443 | 443 | $ hg ci -Am 'A' |
|
444 | 444 | adding a |
|
445 | 445 | |
|
446 | 446 | $ hg branch 'one' |
|
447 | 447 | marked working directory as branch one |
|
448 | 448 | (branches are permanent and global, did you want a bookmark?) |
|
449 | 449 | $ echo 'b' > b |
|
450 | 450 | $ hg ci -Am 'B' |
|
451 | 451 | adding b |
|
452 | 452 | |
|
453 | 453 | $ hg branch 'two' |
|
454 | 454 | marked working directory as branch two |
|
455 | 455 | $ echo 'c' > c |
|
456 | 456 | $ hg ci -Am 'C' |
|
457 | 457 | adding c |
|
458 | 458 | |
|
459 | 459 | $ hg up -q 0 |
|
460 | 460 | $ echo 'd' > d |
|
461 | 461 | $ hg ci -Am 'D' |
|
462 | 462 | adding d |
|
463 | 463 | |
|
464 | 464 | $ hg tglog |
|
465 | 465 | @ 3: 41acb9dca9eb 'D' |
|
466 | 466 | | |
|
467 | 467 | | o 2: 8ac4a08debf1 'C' two |
|
468 | 468 | | | |
|
469 | 469 | | o 1: 1ba175478953 'B' one |
|
470 | 470 | |/ |
|
471 | 471 | o 0: 1994f17a630e 'A' |
|
472 | 472 | |
|
473 | 473 | $ hg rebase --keepbranches --collapse -s 1 -d 3 |
|
474 | 474 | abort: cannot collapse multiple named branches |
|
475 | 475 | [255] |
|
476 | 476 | |
|
477 | 477 | $ repeatchange() { |
|
478 | 478 | > hg checkout $1 |
|
479 | 479 | > hg cp d z |
|
480 | 480 | > echo blah >> z |
|
481 | 481 | > hg commit -Am "$2" --user "$3" |
|
482 | 482 | > } |
|
483 | 483 | $ repeatchange 3 "E" "user1" |
|
484 | 484 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
485 | 485 | $ repeatchange 3 "E" "user2" |
|
486 | 486 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
487 | 487 | created new head |
|
488 | 488 | $ hg tglog |
|
489 | 489 | @ 5: fbfb97b1089a 'E' |
|
490 | 490 | | |
|
491 | 491 | | o 4: f338eb3c2c7c 'E' |
|
492 | 492 | |/ |
|
493 | 493 | o 3: 41acb9dca9eb 'D' |
|
494 | 494 | | |
|
495 | 495 | | o 2: 8ac4a08debf1 'C' two |
|
496 | 496 | | | |
|
497 | 497 | | o 1: 1ba175478953 'B' one |
|
498 | 498 | |/ |
|
499 | 499 | o 0: 1994f17a630e 'A' |
|
500 | 500 | |
|
501 | 501 | $ hg rebase -s 5 -d 4 |
|
502 | 502 | rebasing 5:fbfb97b1089a "E" (tip) |
|
503 | 503 | note: not rebasing 5:fbfb97b1089a "E" (tip), its destination already has all its changes |
|
504 | 504 | saved backup bundle to $TESTTMP/e/.hg/strip-backup/fbfb97b1089a-553e1d85-rebase.hg |
|
505 | 505 | $ hg tglog |
|
506 | 506 | @ 4: f338eb3c2c7c 'E' |
|
507 | 507 | | |
|
508 | 508 | o 3: 41acb9dca9eb 'D' |
|
509 | 509 | | |
|
510 | 510 | | o 2: 8ac4a08debf1 'C' two |
|
511 | 511 | | | |
|
512 | 512 | | o 1: 1ba175478953 'B' one |
|
513 | 513 | |/ |
|
514 | 514 | o 0: 1994f17a630e 'A' |
|
515 | 515 | |
|
516 | 516 | $ hg export tip |
|
517 | 517 | # HG changeset patch |
|
518 | 518 | # User user1 |
|
519 | 519 | # Date 0 0 |
|
520 | 520 | # Thu Jan 01 00:00:00 1970 +0000 |
|
521 | 521 | # Node ID f338eb3c2c7cc5b5915676a2376ba7ac558c5213 |
|
522 | 522 | # Parent 41acb9dca9eb976e84cd21fcb756b4afa5a35c09 |
|
523 | 523 | E |
|
524 | 524 | |
|
525 | 525 | diff -r 41acb9dca9eb -r f338eb3c2c7c z |
|
526 | 526 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
527 | 527 | +++ b/z Thu Jan 01 00:00:00 1970 +0000 |
|
528 | 528 | @@ -0,0 +1,2 @@ |
|
529 | 529 | +d |
|
530 | 530 | +blah |
|
531 | 531 | |
|
532 | 532 | $ cd .. |
|
533 | 533 | |
|
534 | 534 | Rebase, collapse and copies |
|
535 | 535 | |
|
536 | 536 | $ hg init copies |
|
537 | 537 | $ cd copies |
|
538 | 538 | $ hg unbundle "$TESTDIR/bundles/renames.hg" |
|
539 | 539 | adding changesets |
|
540 | 540 | adding manifests |
|
541 | 541 | adding file changes |
|
542 | 542 | added 4 changesets with 11 changes to 7 files (+1 heads) |
|
543 | 543 | new changesets f447d5abf5ea:338e84e2e558 (4 drafts) |
|
544 | 544 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
545 | 545 | $ hg up -q tip |
|
546 | 546 | $ hg tglog |
|
547 | 547 | @ 3: 338e84e2e558 'move2' |
|
548 | 548 | | |
|
549 | 549 | o 2: 6e7340ee38c0 'move1' |
|
550 | 550 | | |
|
551 | 551 | | o 1: 1352765a01d4 'change' |
|
552 | 552 | |/ |
|
553 | 553 | o 0: f447d5abf5ea 'add' |
|
554 | 554 | |
|
555 | 555 | $ hg rebase --collapse -d 1 |
|
556 | 556 | rebasing 2:6e7340ee38c0 "move1" |
|
557 | 557 | merging a and d to d |
|
558 | 558 | merging b and e to e |
|
559 | 559 | merging c and f to f |
|
560 | 560 | rebasing 3:338e84e2e558 "move2" (tip) |
|
561 | 561 | merging f and c to c |
|
562 | 562 | merging e and g to g |
|
563 | 563 | saved backup bundle to $TESTTMP/copies/.hg/strip-backup/6e7340ee38c0-ef8ef003-rebase.hg |
|
564 | 564 | $ hg st |
|
565 | 565 | $ hg st --copies --change tip |
|
566 | 566 | A d |
|
567 | 567 | a |
|
568 | 568 | A g |
|
569 | 569 | b |
|
570 | 570 | R b |
|
571 | 571 | $ hg up tip -q |
|
572 | 572 | $ cat c |
|
573 | 573 | c |
|
574 | 574 | c |
|
575 | 575 | $ cat d |
|
576 | 576 | a |
|
577 | 577 | a |
|
578 | 578 | $ cat g |
|
579 | 579 | b |
|
580 | 580 | b |
|
581 | 581 | $ hg log -r . --template "{file_copies}\n" |
|
582 | 582 | d (a)g (b) |
|
583 | 583 | |
|
584 | 584 | Test collapsing a middle revision in-place |
|
585 | 585 | |
|
586 | 586 | $ hg tglog |
|
587 | 587 | @ 2: 64b456429f67 'Collapsed revision |
|
588 | 588 | | * move1 |
|
589 | 589 | | * move2' |
|
590 | 590 | o 1: 1352765a01d4 'change' |
|
591 | 591 | | |
|
592 | 592 | o 0: f447d5abf5ea 'add' |
|
593 | 593 | |
|
594 | 594 | $ hg rebase --collapse -r 1 -d 0 |
|
595 | 595 | abort: can't remove original changesets with unrebased descendants |
|
596 | 596 | (use --keep to keep original changesets) |
|
597 | 597 | [255] |
|
598 | 598 | |
|
599 | 599 | Test collapsing in place |
|
600 | 600 | |
|
601 | 601 | $ hg rebase --collapse -b . -d 0 |
|
602 | 602 | rebasing 1:1352765a01d4 "change" |
|
603 | 603 | rebasing 2:64b456429f67 "Collapsed revision" (tip) |
|
604 | 604 | saved backup bundle to $TESTTMP/copies/.hg/strip-backup/1352765a01d4-45a352ea-rebase.hg |
|
605 | 605 | $ hg st --change tip --copies |
|
606 | 606 | M a |
|
607 | 607 | M c |
|
608 | 608 | A d |
|
609 | 609 | a |
|
610 | 610 | A g |
|
611 | 611 | b |
|
612 | 612 | R b |
|
613 | 613 | $ hg up tip -q |
|
614 | 614 | $ cat a |
|
615 | 615 | a |
|
616 | 616 | a |
|
617 | 617 | $ cat c |
|
618 | 618 | c |
|
619 | 619 | c |
|
620 | 620 | $ cat d |
|
621 | 621 | a |
|
622 | 622 | a |
|
623 | 623 | $ cat g |
|
624 | 624 | b |
|
625 | 625 | b |
|
626 | 626 | $ cd .. |
|
627 | 627 | |
|
628 | 628 | |
|
629 | 629 | Test stripping a revision with another child |
|
630 | 630 | |
|
631 | 631 | $ hg init f |
|
632 | 632 | $ cd f |
|
633 | 633 | |
|
634 | 634 | $ hg debugdrawdag << 'EOF' |
|
635 | 635 | > C B |
|
636 | 636 | > |/ |
|
637 | 637 | > A |
|
638 | 638 | > EOF |
|
639 | 639 | |
|
640 | 640 | $ hg heads --template="{rev}:{node} {branch}: {desc}\n" |
|
641 | 641 | 2:dc0947a82db884575bb76ea10ac97b08536bfa03 default: C |
|
642 | 642 | 1:112478962961147124edd43549aedd1a335e44bf default: B |
|
643 | 643 | |
|
644 | 644 | $ hg strip C |
|
645 | 645 | saved backup bundle to $TESTTMP/f/.hg/strip-backup/dc0947a82db8-d21b92a4-backup.hg |
|
646 | 646 | |
|
647 | 647 | $ hg tglog |
|
648 | 648 | o 1: 112478962961 'B' |
|
649 | 649 | | |
|
650 | 650 | o 0: 426bada5c675 'A' |
|
651 | 651 | |
|
652 | 652 | |
|
653 | 653 | |
|
654 | 654 | $ hg heads --template="{rev}:{node} {branch}: {desc}\n" |
|
655 | 655 | 1:112478962961147124edd43549aedd1a335e44bf default: B |
|
656 | 656 | |
|
657 | 657 | $ cd .. |
|
658 | 658 | |
|
659 | 659 | Test collapsing changes that add then remove a file |
|
660 | 660 | |
|
661 | 661 | $ hg init collapseaddremove |
|
662 | 662 | $ cd collapseaddremove |
|
663 | 663 | |
|
664 | 664 | $ touch base |
|
665 | 665 | $ hg commit -Am base |
|
666 | 666 | adding base |
|
667 | 667 | $ touch a |
|
668 | 668 | $ hg commit -Am a |
|
669 | 669 | adding a |
|
670 | 670 | $ hg rm a |
|
671 | 671 | $ touch b |
|
672 | 672 | $ hg commit -Am b |
|
673 | 673 | adding b |
|
674 | 674 | $ hg book foo |
|
675 | 675 | $ hg rebase -d 0 -r "1::2" --collapse -m collapsed |
|
676 | 676 | rebasing 1:6d8d9f24eec3 "a" |
|
677 | 677 | rebasing 2:1cc73eca5ecc "b" (foo tip) |
|
678 | 678 | saved backup bundle to $TESTTMP/collapseaddremove/.hg/strip-backup/6d8d9f24eec3-77d3b6e2-rebase.hg |
|
679 | 679 | $ hg log -G --template "{rev}: '{desc}' {bookmarks}" |
|
680 | 680 | @ 1: 'collapsed' foo |
|
681 | 681 | | |
|
682 | 682 | o 0: 'base' |
|
683 | 683 | |
|
684 | 684 | $ hg manifest --rev tip |
|
685 | 685 | b |
|
686 | 686 | base |
|
687 | 687 | |
|
688 | 688 | $ cd .. |
|
689 | 689 | |
|
690 | 690 | Test that rebase --collapse will remember message after |
|
691 | 691 | running into merge conflict and invoking rebase --continue. |
|
692 | 692 | |
|
693 | 693 | $ hg init collapse_remember_message |
|
694 | 694 | $ cd collapse_remember_message |
|
695 | 695 | $ hg debugdrawdag << 'EOF' |
|
696 | 696 | > C B # B/A = B\n |
|
697 | 697 | > |/ # C/A = C\n |
|
698 | 698 | > A |
|
699 | 699 | > EOF |
|
700 | 700 | $ hg rebase --collapse -m "new message" -b B -d C |
|
701 | 701 | rebasing 1:81e5401e4d37 "B" (B) |
|
702 | 702 | merging A |
|
703 | 703 | warning: conflicts while merging A! (edit, then use 'hg resolve --mark') |
|
704 | 704 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
705 | 705 | [1] |
|
706 | 706 | $ rm A.orig |
|
707 | 707 | $ hg resolve --mark A |
|
708 | 708 | (no more unresolved files) |
|
709 | 709 | continue: hg rebase --continue |
|
710 | 710 | $ hg rebase --continue |
|
711 | 711 | rebasing 1:81e5401e4d37 "B" (B) |
|
712 | 712 | saved backup bundle to $TESTTMP/collapse_remember_message/.hg/strip-backup/81e5401e4d37-96c3dd30-rebase.hg |
|
713 | 713 | $ hg log |
|
714 | 714 | changeset: 2:17186933e123 |
|
715 | 715 | tag: tip |
|
716 | 716 | user: test |
|
717 | 717 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
718 | 718 | summary: new message |
|
719 | 719 | |
|
720 | 720 | changeset: 1:043039e9df84 |
|
721 | 721 | tag: C |
|
722 | 722 | user: test |
|
723 | 723 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
724 | 724 | summary: C |
|
725 | 725 | |
|
726 | 726 | changeset: 0:426bada5c675 |
|
727 | 727 | tag: A |
|
728 | 728 | user: test |
|
729 | 729 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
730 | 730 | summary: A |
|
731 | 731 | |
|
732 | 732 | $ cd .. |
|
733 | 733 | |
|
734 | 734 | Test aborted editor on final message |
|
735 | 735 | |
|
736 | 736 | $ HGMERGE=:merge3 |
|
737 | 737 | $ export HGMERGE |
|
738 | 738 | $ hg init aborted-editor |
|
739 | 739 | $ cd aborted-editor |
|
740 | 740 | $ hg debugdrawdag << 'EOF' |
|
741 | 741 | > C # D/A = D\n |
|
742 | 742 | > | # C/A = C\n |
|
743 | 743 | > B D # B/A = B\n |
|
744 | 744 | > |/ # A/A = A\n |
|
745 | 745 | > A |
|
746 | 746 | > EOF |
|
747 | 747 | $ hg rebase --collapse -t internal:merge3 -s B -d D |
|
748 | 748 | rebasing 1:f899f3910ce7 "B" (B) |
|
749 | 749 | merging A |
|
750 | 750 | warning: conflicts while merging A! (edit, then use 'hg resolve --mark') |
|
751 | 751 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
752 | 752 | [1] |
|
753 | 753 | $ hg tglog |
|
754 | 754 | o 3: 63668d570d21 'C' |
|
755 | 755 | | |
|
756 | 756 | | @ 2: 82b8abf9c185 'D' |
|
757 | 757 | | | |
|
758 | 758 | @ | 1: f899f3910ce7 'B' |
|
759 | 759 | |/ |
|
760 | 760 | o 0: 4a2df7238c3b 'A' |
|
761 | 761 | |
|
762 | 762 | $ cat A |
|
763 | 763 | <<<<<<< dest: 82b8abf9c185 D - test: D |
|
764 | 764 | D |
|
765 | 765 | ||||||| base |
|
766 | 766 | A |
|
767 | 767 | ======= |
|
768 | 768 | B |
|
769 | 769 | >>>>>>> source: f899f3910ce7 B - test: B |
|
770 | 770 | $ echo BC > A |
|
771 | 771 | $ hg resolve -m |
|
772 | 772 | (no more unresolved files) |
|
773 | 773 | continue: hg rebase --continue |
|
774 | 774 | $ hg rebase --continue |
|
775 | 775 | rebasing 1:f899f3910ce7 "B" (B) |
|
776 | 776 | rebasing 3:63668d570d21 "C" (C tip) |
|
777 | 777 | merging A |
|
778 | 778 | warning: conflicts while merging A! (edit, then use 'hg resolve --mark') |
|
779 | 779 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
780 | 780 | [1] |
|
781 | 781 | $ hg tglog |
|
782 | 782 | @ 3: 63668d570d21 'C' |
|
783 | 783 | | |
|
784 | 784 | | @ 2: 82b8abf9c185 'D' |
|
785 | 785 | | | |
|
786 | 786 | o | 1: f899f3910ce7 'B' |
|
787 | 787 | |/ |
|
788 | 788 | o 0: 4a2df7238c3b 'A' |
|
789 | 789 | |
|
790 | 790 | $ cat A |
|
791 | 791 | <<<<<<< dest: 82b8abf9c185 D - test: D |
|
792 | 792 | BC |
|
793 | 793 | ||||||| base |
|
794 | 794 | B |
|
795 | 795 | ======= |
|
796 | 796 | C |
|
797 | 797 | >>>>>>> source: 63668d570d21 C tip - test: C |
|
798 | 798 | $ echo BD > A |
|
799 | 799 | $ hg resolve -m |
|
800 | 800 | (no more unresolved files) |
|
801 | 801 | continue: hg rebase --continue |
|
802 | 802 | $ HGEDITOR=false hg rebase --continue --config ui.interactive=1 |
|
803 | 803 | already rebased 1:f899f3910ce7 "B" (B) as 82b8abf9c185 |
|
804 | 804 | rebasing 3:63668d570d21 "C" (C tip) |
|
805 | 805 | abort: edit failed: false exited with status 1 |
|
806 | 806 | [255] |
|
807 | 807 | $ hg tglog |
|
808 | 808 | o 3: 63668d570d21 'C' |
|
809 | 809 | | |
|
810 | 810 | | @ 2: 82b8abf9c185 'D' |
|
811 | 811 | | | |
|
812 | 812 | o | 1: f899f3910ce7 'B' |
|
813 | 813 | |/ |
|
814 | 814 | o 0: 4a2df7238c3b 'A' |
|
815 | 815 | |
|
816 | 816 | $ hg rebase --continue |
|
817 | 817 | already rebased 1:f899f3910ce7 "B" (B) as 82b8abf9c185 |
|
818 | 818 | already rebased 3:63668d570d21 "C" (C tip) as 82b8abf9c185 |
|
819 | 819 | saved backup bundle to $TESTTMP/aborted-editor/.hg/strip-backup/f899f3910ce7-7cab5e15-rebase.hg |
General Comments 0
You need to be logged in to leave comments.
Login now