##// END OF EJS Templates
tests: have a more elaborated test for _destrebase...
Pierre-Yves David -
r28135:ecfa8244 default
parent child Browse files
Show More
@@ -1,773 +1,830 b''
1 1 $ cat >> $HGRCPATH <<EOF
2 2 > [extensions]
3 3 > rebase=
4 4 >
5 5 > [phases]
6 6 > publish=False
7 7 >
8 8 > [alias]
9 9 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
10 10 > EOF
11 11
12 12
13 13 $ hg init a
14 14 $ cd a
15 15 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
16 16 adding changesets
17 17 adding manifests
18 18 adding file changes
19 19 added 8 changesets with 7 changes to 7 files (+2 heads)
20 20 (run 'hg heads' to see heads, 'hg merge' to merge)
21 21 $ hg up tip
22 22 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
23 23 $ cd ..
24 24
25 25
26 26 Rebasing
27 27 D onto H - simple rebase:
28 28 (this also tests that editor is invoked if '--edit' is specified, and that we
29 29 can abort or warn for colliding untracked files)
30 30
31 31 $ hg clone -q -u . a a1
32 32 $ cd a1
33 33
34 34 $ hg tglog
35 35 @ 7: 'H'
36 36 |
37 37 | o 6: 'G'
38 38 |/|
39 39 o | 5: 'F'
40 40 | |
41 41 | o 4: 'E'
42 42 |/
43 43 | o 3: 'D'
44 44 | |
45 45 | o 2: 'C'
46 46 | |
47 47 | o 1: 'B'
48 48 |/
49 49 o 0: 'A'
50 50
51 51
52 52 $ hg status --rev "3^1" --rev 3
53 53 A D
54 54 $ echo collide > D
55 55 $ HGEDITOR=cat hg rebase -s 3 -d 7 --edit --config merge.checkunknown=warn
56 56 rebasing 3:32af7686d403 "D"
57 57 D: replacing untracked file
58 58 D
59 59
60 60
61 61 HG: Enter commit message. Lines beginning with 'HG:' are removed.
62 62 HG: Leave message empty to abort commit.
63 63 HG: --
64 64 HG: user: Nicolas Dumazet <nicdumz.commits@gmail.com>
65 65 HG: branch 'default'
66 66 HG: added D
67 67 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/32af7686d403-6f7dface-backup.hg (glob)
68 68 $ cat D.orig
69 69 collide
70 70 $ rm D.orig
71 71
72 72 $ hg tglog
73 73 o 7: 'D'
74 74 |
75 75 @ 6: 'H'
76 76 |
77 77 | o 5: 'G'
78 78 |/|
79 79 o | 4: 'F'
80 80 | |
81 81 | o 3: 'E'
82 82 |/
83 83 | o 2: 'C'
84 84 | |
85 85 | o 1: 'B'
86 86 |/
87 87 o 0: 'A'
88 88
89 89 $ cd ..
90 90
91 91
92 92 D onto F - intermediate point:
93 93 (this also tests that editor is not invoked if '--edit' is not specified, and
94 94 that we can ignore for colliding untracked files)
95 95
96 96 $ hg clone -q -u . a a2
97 97 $ cd a2
98 98 $ echo collide > D
99 99
100 100 $ HGEDITOR=cat hg rebase -s 3 -d 5 --config merge.checkunknown=ignore
101 101 rebasing 3:32af7686d403 "D"
102 102 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/32af7686d403-6f7dface-backup.hg (glob)
103 103 $ cat D.orig
104 104 collide
105 105 $ rm D.orig
106 106
107 107 $ hg tglog
108 108 o 7: 'D'
109 109 |
110 110 | @ 6: 'H'
111 111 |/
112 112 | o 5: 'G'
113 113 |/|
114 114 o | 4: 'F'
115 115 | |
116 116 | o 3: 'E'
117 117 |/
118 118 | o 2: 'C'
119 119 | |
120 120 | o 1: 'B'
121 121 |/
122 122 o 0: 'A'
123 123
124 124 $ cd ..
125 125
126 126
127 127 E onto H - skip of G:
128 128 (this also tests that we can overwrite untracked files and don't create backups
129 129 if they have the same contents)
130 130
131 131 $ hg clone -q -u . a a3
132 132 $ cd a3
133 133 $ hg cat -r 4 E | tee E
134 134 E
135 135
136 136 $ hg rebase -s 4 -d 7
137 137 rebasing 4:9520eea781bc "E"
138 138 rebasing 6:eea13746799a "G"
139 139 note: rebase of 6:eea13746799a created no changes to commit
140 140 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/9520eea781bc-fcd8edd4-backup.hg (glob)
141 141 $ f E.orig
142 142 E.orig: file not found
143 143
144 144 $ hg tglog
145 145 o 6: 'E'
146 146 |
147 147 @ 5: 'H'
148 148 |
149 149 o 4: 'F'
150 150 |
151 151 | o 3: 'D'
152 152 | |
153 153 | o 2: 'C'
154 154 | |
155 155 | o 1: 'B'
156 156 |/
157 157 o 0: 'A'
158 158
159 159 $ cd ..
160 160
161 161
162 162 F onto E - rebase of a branching point (skip G):
163 163
164 164 $ hg clone -q -u . a a4
165 165 $ cd a4
166 166
167 167 $ hg rebase -s 5 -d 4
168 168 rebasing 5:24b6387c8c8c "F"
169 169 rebasing 6:eea13746799a "G"
170 170 note: rebase of 6:eea13746799a created no changes to commit
171 171 rebasing 7:02de42196ebe "H" (tip)
172 172 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/24b6387c8c8c-c3fe765d-backup.hg (glob)
173 173
174 174 $ hg tglog
175 175 @ 6: 'H'
176 176 |
177 177 o 5: 'F'
178 178 |
179 179 o 4: 'E'
180 180 |
181 181 | o 3: 'D'
182 182 | |
183 183 | o 2: 'C'
184 184 | |
185 185 | o 1: 'B'
186 186 |/
187 187 o 0: 'A'
188 188
189 189 $ cd ..
190 190
191 191
192 192 G onto H - merged revision having a parent in ancestors of target:
193 193
194 194 $ hg clone -q -u . a a5
195 195 $ cd a5
196 196
197 197 $ hg rebase -s 6 -d 7
198 198 rebasing 6:eea13746799a "G"
199 199 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/eea13746799a-883828ed-backup.hg (glob)
200 200
201 201 $ hg tglog
202 202 o 7: 'G'
203 203 |\
204 204 | @ 6: 'H'
205 205 | |
206 206 | o 5: 'F'
207 207 | |
208 208 o | 4: 'E'
209 209 |/
210 210 | o 3: 'D'
211 211 | |
212 212 | o 2: 'C'
213 213 | |
214 214 | o 1: 'B'
215 215 |/
216 216 o 0: 'A'
217 217
218 218 $ cd ..
219 219
220 220
221 221 F onto B - G maintains E as parent:
222 222
223 223 $ hg clone -q -u . a a6
224 224 $ cd a6
225 225
226 226 $ hg rebase -s 5 -d 1
227 227 rebasing 5:24b6387c8c8c "F"
228 228 rebasing 6:eea13746799a "G"
229 229 rebasing 7:02de42196ebe "H" (tip)
230 230 saved backup bundle to $TESTTMP/a6/.hg/strip-backup/24b6387c8c8c-c3fe765d-backup.hg (glob)
231 231
232 232 $ hg tglog
233 233 @ 7: 'H'
234 234 |
235 235 | o 6: 'G'
236 236 |/|
237 237 o | 5: 'F'
238 238 | |
239 239 | o 4: 'E'
240 240 | |
241 241 | | o 3: 'D'
242 242 | | |
243 243 +---o 2: 'C'
244 244 | |
245 245 o | 1: 'B'
246 246 |/
247 247 o 0: 'A'
248 248
249 249 $ cd ..
250 250
251 251
252 252 These will fail (using --source):
253 253
254 254 G onto F - rebase onto an ancestor:
255 255
256 256 $ hg clone -q -u . a a7
257 257 $ cd a7
258 258
259 259 $ hg rebase -s 6 -d 5
260 260 nothing to rebase
261 261 [1]
262 262
263 263 F onto G - rebase onto a descendant:
264 264
265 265 $ hg rebase -s 5 -d 6
266 266 abort: source is ancestor of destination
267 267 [255]
268 268
269 269 G onto B - merge revision with both parents not in ancestors of target:
270 270
271 271 $ hg rebase -s 6 -d 1
272 272 rebasing 6:eea13746799a "G"
273 273 abort: cannot use revision 6 as base, result would have 3 parents
274 274 [255]
275 275
276 276
277 277 These will abort gracefully (using --base):
278 278
279 279 G onto G - rebase onto same changeset:
280 280
281 281 $ hg rebase -b 6 -d 6
282 282 nothing to rebase - eea13746799a is both "base" and destination
283 283 [1]
284 284
285 285 G onto F - rebase onto an ancestor:
286 286
287 287 $ hg rebase -b 6 -d 5
288 288 nothing to rebase
289 289 [1]
290 290
291 291 F onto G - rebase onto a descendant:
292 292
293 293 $ hg rebase -b 5 -d 6
294 294 nothing to rebase - "base" 24b6387c8c8c is already an ancestor of destination eea13746799a
295 295 [1]
296 296
297 297 C onto A - rebase onto an ancestor:
298 298
299 299 $ hg rebase -d 0 -s 2
300 300 rebasing 2:5fddd98957c8 "C"
301 301 rebasing 3:32af7686d403 "D"
302 302 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/5fddd98957c8-f9244fa1-backup.hg (glob)
303 303 $ hg tglog
304 304 o 7: 'D'
305 305 |
306 306 o 6: 'C'
307 307 |
308 308 | @ 5: 'H'
309 309 | |
310 310 | | o 4: 'G'
311 311 | |/|
312 312 | o | 3: 'F'
313 313 |/ /
314 314 | o 2: 'E'
315 315 |/
316 316 | o 1: 'B'
317 317 |/
318 318 o 0: 'A'
319 319
320 320
321 321 Check rebasing public changeset
322 322
323 323 $ hg pull --config phases.publish=True -q -r 6 . # update phase of 6
324 324 $ hg rebase -d 0 -b 6
325 325 nothing to rebase
326 326 [1]
327 327 $ hg rebase -d 5 -b 6
328 328 abort: can't rebase public changeset e1c4361dd923
329 329 (see "hg help phases" for details)
330 330 [255]
331 331
332 332 $ hg rebase -d 5 -b 6 --keep
333 333 rebasing 6:e1c4361dd923 "C"
334 334 rebasing 7:c9659aac0000 "D" (tip)
335 335
336 336 Check rebasing mutable changeset
337 337 Source phase greater or equal to destination phase: new changeset get the phase of source:
338 338 $ hg id -n
339 339 5
340 340 $ hg rebase -s9 -d0
341 341 rebasing 9:2b23e52411f4 "D" (tip)
342 342 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2b23e52411f4-f942decf-backup.hg (glob)
343 343 $ hg id -n # check we updated back to parent
344 344 5
345 345 $ hg log --template "{phase}\n" -r 9
346 346 draft
347 347 $ hg rebase -s9 -d1
348 348 rebasing 9:2cb10d0cfc6c "D" (tip)
349 349 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2cb10d0cfc6c-ddb0f256-backup.hg (glob)
350 350 $ hg log --template "{phase}\n" -r 9
351 351 draft
352 352 $ hg phase --force --secret 9
353 353 $ hg rebase -s9 -d0
354 354 rebasing 9:c5b12b67163a "D" (tip)
355 355 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/c5b12b67163a-4e372053-backup.hg (glob)
356 356 $ hg log --template "{phase}\n" -r 9
357 357 secret
358 358 $ hg rebase -s9 -d1
359 359 rebasing 9:2a0524f868ac "D" (tip)
360 360 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2a0524f868ac-cefd8574-backup.hg (glob)
361 361 $ hg log --template "{phase}\n" -r 9
362 362 secret
363 363 Source phase lower than destination phase: new changeset get the phase of destination:
364 364 $ hg rebase -s8 -d9
365 365 rebasing 8:6d4f22462821 "C"
366 366 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/6d4f22462821-3441f70b-backup.hg (glob)
367 367 $ hg log --template "{phase}\n" -r 'rev(9)'
368 368 secret
369 369
370 370 $ cd ..
371 371
372 372 Test for revset
373 373
374 374 We need a bit different graph
375 375 All destination are B
376 376
377 377 $ hg init ah
378 378 $ cd ah
379 379 $ hg unbundle "$TESTDIR/bundles/rebase-revset.hg"
380 380 adding changesets
381 381 adding manifests
382 382 adding file changes
383 383 added 9 changesets with 9 changes to 9 files (+2 heads)
384 384 (run 'hg heads' to see heads, 'hg merge' to merge)
385 385 $ hg tglog
386 386 o 8: 'I'
387 387 |
388 388 o 7: 'H'
389 389 |
390 390 o 6: 'G'
391 391 |
392 392 | o 5: 'F'
393 393 | |
394 394 | o 4: 'E'
395 395 |/
396 396 o 3: 'D'
397 397 |
398 398 o 2: 'C'
399 399 |
400 400 | o 1: 'B'
401 401 |/
402 402 o 0: 'A'
403 403
404 404 $ cd ..
405 405
406 406
407 407 Simple case with keep:
408 408
409 409 Source on have two descendant heads but ask for one
410 410
411 411 $ hg clone -q -u . ah ah1
412 412 $ cd ah1
413 413 $ hg rebase -r '2::8' -d 1
414 414 abort: can't remove original changesets with unrebased descendants
415 415 (use --keep to keep original changesets)
416 416 [255]
417 417 $ hg rebase -r '2::8' -d 1 -k
418 418 rebasing 2:c9e50f6cdc55 "C"
419 419 rebasing 3:ffd453c31098 "D"
420 420 rebasing 6:3d8a618087a7 "G"
421 421 rebasing 7:72434a4e60b0 "H"
422 422 rebasing 8:479ddb54a924 "I" (tip)
423 423 $ hg tglog
424 424 o 13: 'I'
425 425 |
426 426 o 12: 'H'
427 427 |
428 428 o 11: 'G'
429 429 |
430 430 o 10: 'D'
431 431 |
432 432 o 9: 'C'
433 433 |
434 434 | o 8: 'I'
435 435 | |
436 436 | o 7: 'H'
437 437 | |
438 438 | o 6: 'G'
439 439 | |
440 440 | | o 5: 'F'
441 441 | | |
442 442 | | o 4: 'E'
443 443 | |/
444 444 | o 3: 'D'
445 445 | |
446 446 | o 2: 'C'
447 447 | |
448 448 o | 1: 'B'
449 449 |/
450 450 o 0: 'A'
451 451
452 452
453 453 $ cd ..
454 454
455 455 Base on have one descendant heads we ask for but common ancestor have two
456 456
457 457 $ hg clone -q -u . ah ah2
458 458 $ cd ah2
459 459 $ hg rebase -r '3::8' -d 1
460 460 abort: can't remove original changesets with unrebased descendants
461 461 (use --keep to keep original changesets)
462 462 [255]
463 463 $ hg rebase -r '3::8' -d 1 --keep
464 464 rebasing 3:ffd453c31098 "D"
465 465 rebasing 6:3d8a618087a7 "G"
466 466 rebasing 7:72434a4e60b0 "H"
467 467 rebasing 8:479ddb54a924 "I" (tip)
468 468 $ hg tglog
469 469 o 12: 'I'
470 470 |
471 471 o 11: 'H'
472 472 |
473 473 o 10: 'G'
474 474 |
475 475 o 9: 'D'
476 476 |
477 477 | o 8: 'I'
478 478 | |
479 479 | o 7: 'H'
480 480 | |
481 481 | o 6: 'G'
482 482 | |
483 483 | | o 5: 'F'
484 484 | | |
485 485 | | o 4: 'E'
486 486 | |/
487 487 | o 3: 'D'
488 488 | |
489 489 | o 2: 'C'
490 490 | |
491 491 o | 1: 'B'
492 492 |/
493 493 o 0: 'A'
494 494
495 495
496 496 $ cd ..
497 497
498 498 rebase subset
499 499
500 500 $ hg clone -q -u . ah ah3
501 501 $ cd ah3
502 502 $ hg rebase -r '3::7' -d 1
503 503 abort: can't remove original changesets with unrebased descendants
504 504 (use --keep to keep original changesets)
505 505 [255]
506 506 $ hg rebase -r '3::7' -d 1 --keep
507 507 rebasing 3:ffd453c31098 "D"
508 508 rebasing 6:3d8a618087a7 "G"
509 509 rebasing 7:72434a4e60b0 "H"
510 510 $ hg tglog
511 511 o 11: 'H'
512 512 |
513 513 o 10: 'G'
514 514 |
515 515 o 9: 'D'
516 516 |
517 517 | o 8: 'I'
518 518 | |
519 519 | o 7: 'H'
520 520 | |
521 521 | o 6: 'G'
522 522 | |
523 523 | | o 5: 'F'
524 524 | | |
525 525 | | o 4: 'E'
526 526 | |/
527 527 | o 3: 'D'
528 528 | |
529 529 | o 2: 'C'
530 530 | |
531 531 o | 1: 'B'
532 532 |/
533 533 o 0: 'A'
534 534
535 535
536 536 $ cd ..
537 537
538 538 rebase subset with multiple head
539 539
540 540 $ hg clone -q -u . ah ah4
541 541 $ cd ah4
542 542 $ hg rebase -r '3::(7+5)' -d 1
543 543 abort: can't remove original changesets with unrebased descendants
544 544 (use --keep to keep original changesets)
545 545 [255]
546 546 $ hg rebase -r '3::(7+5)' -d 1 --keep
547 547 rebasing 3:ffd453c31098 "D"
548 548 rebasing 4:c01897464e7f "E"
549 549 rebasing 5:41bfcc75ed73 "F"
550 550 rebasing 6:3d8a618087a7 "G"
551 551 rebasing 7:72434a4e60b0 "H"
552 552 $ hg tglog
553 553 o 13: 'H'
554 554 |
555 555 o 12: 'G'
556 556 |
557 557 | o 11: 'F'
558 558 | |
559 559 | o 10: 'E'
560 560 |/
561 561 o 9: 'D'
562 562 |
563 563 | o 8: 'I'
564 564 | |
565 565 | o 7: 'H'
566 566 | |
567 567 | o 6: 'G'
568 568 | |
569 569 | | o 5: 'F'
570 570 | | |
571 571 | | o 4: 'E'
572 572 | |/
573 573 | o 3: 'D'
574 574 | |
575 575 | o 2: 'C'
576 576 | |
577 577 o | 1: 'B'
578 578 |/
579 579 o 0: 'A'
580 580
581 581
582 582 $ cd ..
583 583
584 584 More advanced tests
585 585
586 586 rebase on ancestor with revset
587 587
588 588 $ hg clone -q -u . ah ah5
589 589 $ cd ah5
590 590 $ hg rebase -r '6::' -d 2
591 591 rebasing 6:3d8a618087a7 "G"
592 592 rebasing 7:72434a4e60b0 "H"
593 593 rebasing 8:479ddb54a924 "I" (tip)
594 594 saved backup bundle to $TESTTMP/ah5/.hg/strip-backup/3d8a618087a7-b4f73f31-backup.hg (glob)
595 595 $ hg tglog
596 596 o 8: 'I'
597 597 |
598 598 o 7: 'H'
599 599 |
600 600 o 6: 'G'
601 601 |
602 602 | o 5: 'F'
603 603 | |
604 604 | o 4: 'E'
605 605 | |
606 606 | o 3: 'D'
607 607 |/
608 608 o 2: 'C'
609 609 |
610 610 | o 1: 'B'
611 611 |/
612 612 o 0: 'A'
613 613
614 614 $ cd ..
615 615
616 616
617 617 rebase with multiple root.
618 618 We rebase E and G on B
619 619 We would expect heads are I, F if it was supported
620 620
621 621 $ hg clone -q -u . ah ah6
622 622 $ cd ah6
623 623 $ hg rebase -r '(4+6)::' -d 1
624 624 rebasing 4:c01897464e7f "E"
625 625 rebasing 5:41bfcc75ed73 "F"
626 626 rebasing 6:3d8a618087a7 "G"
627 627 rebasing 7:72434a4e60b0 "H"
628 628 rebasing 8:479ddb54a924 "I" (tip)
629 629 saved backup bundle to $TESTTMP/ah6/.hg/strip-backup/3d8a618087a7-aae93a24-backup.hg (glob)
630 630 $ hg tglog
631 631 o 8: 'I'
632 632 |
633 633 o 7: 'H'
634 634 |
635 635 o 6: 'G'
636 636 |
637 637 | o 5: 'F'
638 638 | |
639 639 | o 4: 'E'
640 640 |/
641 641 | o 3: 'D'
642 642 | |
643 643 | o 2: 'C'
644 644 | |
645 645 o | 1: 'B'
646 646 |/
647 647 o 0: 'A'
648 648
649 649 $ cd ..
650 650
651 651 More complex rebase with multiple roots
652 652 each root have a different common ancestor with the destination and this is a detach
653 653
654 654 (setup)
655 655
656 656 $ hg clone -q -u . a a8
657 657 $ cd a8
658 658 $ echo I > I
659 659 $ hg add I
660 660 $ hg commit -m I
661 661 $ hg up 4
662 662 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
663 663 $ echo I > J
664 664 $ hg add J
665 665 $ hg commit -m J
666 666 created new head
667 667 $ echo I > K
668 668 $ hg add K
669 669 $ hg commit -m K
670 670 $ hg tglog
671 671 @ 10: 'K'
672 672 |
673 673 o 9: 'J'
674 674 |
675 675 | o 8: 'I'
676 676 | |
677 677 | o 7: 'H'
678 678 | |
679 679 +---o 6: 'G'
680 680 | |/
681 681 | o 5: 'F'
682 682 | |
683 683 o | 4: 'E'
684 684 |/
685 685 | o 3: 'D'
686 686 | |
687 687 | o 2: 'C'
688 688 | |
689 689 | o 1: 'B'
690 690 |/
691 691 o 0: 'A'
692 692
693 693 (actual test)
694 694
695 695 $ hg rebase --dest 'desc(G)' --rev 'desc(K) + desc(I)'
696 696 rebasing 8:e7ec4e813ba6 "I"
697 697 rebasing 10:23a4ace37988 "K" (tip)
698 698 saved backup bundle to $TESTTMP/a8/.hg/strip-backup/23a4ace37988-b06984b3-backup.hg (glob)
699 699 $ hg log --rev 'children(desc(G))'
700 700 changeset: 9:adb617877056
701 701 parent: 6:eea13746799a
702 702 user: test
703 703 date: Thu Jan 01 00:00:00 1970 +0000
704 704 summary: I
705 705
706 706 changeset: 10:882431a34a0e
707 707 tag: tip
708 708 parent: 6:eea13746799a
709 709 user: test
710 710 date: Thu Jan 01 00:00:00 1970 +0000
711 711 summary: K
712 712
713 713 $ hg tglog
714 714 @ 10: 'K'
715 715 |
716 716 | o 9: 'I'
717 717 |/
718 718 | o 8: 'J'
719 719 | |
720 720 | | o 7: 'H'
721 721 | | |
722 722 o---+ 6: 'G'
723 723 |/ /
724 724 | o 5: 'F'
725 725 | |
726 726 o | 4: 'E'
727 727 |/
728 728 | o 3: 'D'
729 729 | |
730 730 | o 2: 'C'
731 731 | |
732 732 | o 1: 'B'
733 733 |/
734 734 o 0: 'A'
735 735
736 736
737 737 Test that rebase is not confused by $CWD disappearing during rebase (issue4121)
738 738
739 739 $ cd ..
740 740 $ hg init cwd-vanish
741 741 $ cd cwd-vanish
742 742 $ touch initial-file
743 743 $ hg add initial-file
744 744 $ hg commit -m 'initial commit'
745 745 $ touch dest-file
746 746 $ hg add dest-file
747 747 $ hg commit -m 'dest commit'
748 748 $ hg up 0
749 749 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
750 750 $ touch other-file
751 751 $ hg add other-file
752 752 $ hg commit -m 'first source commit'
753 753 created new head
754 754 $ mkdir subdir
755 755 $ cd subdir
756 756 $ touch subfile
757 757 $ hg add subfile
758 758 $ hg commit -m 'second source with subdir'
759 759 $ hg rebase -b . -d 1 --traceback
760 760 rebasing 2:779a07b1b7a0 "first source commit"
761 761 rebasing 3:a7d6f3a00bf3 "second source with subdir" (tip)
762 762 saved backup bundle to $TESTTMP/cwd-vanish/.hg/strip-backup/779a07b1b7a0-853e0073-backup.hg (glob)
763 763
764 764 Test experimental revset
765 ========================
765 766
766 767 $ cd ..
768
769 Make the repo a bit more interresting
770
771 $ hg up 1
772 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
773 $ echo aaa > aaa
774 $ hg add aaa
775 $ hg commit -m aaa
776 created new head
777 $ hg log -G
778 @ changeset: 4:5f7bc9025ed2
779 | tag: tip
780 | parent: 1:58d79cc1cf43
781 | user: test
782 | date: Thu Jan 01 00:00:00 1970 +0000
783 | summary: aaa
784 |
785 | o changeset: 3:1910d5ff34ea
786 | | user: test
787 | | date: Thu Jan 01 00:00:00 1970 +0000
788 | | summary: second source with subdir
789 | |
790 | o changeset: 2:82901330b6ef
791 |/ user: test
792 | date: Thu Jan 01 00:00:00 1970 +0000
793 | summary: first source commit
794 |
795 o changeset: 1:58d79cc1cf43
796 | user: test
797 | date: Thu Jan 01 00:00:00 1970 +0000
798 | summary: dest commit
799 |
800 o changeset: 0:e94b687f7da3
801 user: test
802 date: Thu Jan 01 00:00:00 1970 +0000
803 summary: initial commit
804
805
806 Testing from lower head
807
808 $ hg up 3
809 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
767 810 $ hg log -r '_destrebase()'
768 changeset: 3:1910d5ff34ea
811 changeset: 4:5f7bc9025ed2
769 812 tag: tip
813 parent: 1:58d79cc1cf43
770 814 user: test
771 815 date: Thu Jan 01 00:00:00 1970 +0000
772 summary: second source with subdir
816 summary: aaa
773 817
818
819 Testing from upper head
820
821 $ hg up 4
822 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
823 $ hg log -r '_destrebase()'
824 changeset: 4:5f7bc9025ed2
825 tag: tip
826 parent: 1:58d79cc1cf43
827 user: test
828 date: Thu Jan 01 00:00:00 1970 +0000
829 summary: aaa
830
General Comments 0
You need to be logged in to leave comments. Login now