comparison tests/test-rebase-conflicts.t @ 44342:7f7c8521e9bd

tests: add test of rebase with conflict in merge commit It doesn't seem like we had any tests of this. I think it's pretty weird that the two parents we're merging are not the working copy parents during the conflict resolution. Differential Revision: https://phab.mercurial-scm.org/D7824
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 10 Jan 2020 17:46:10 -0800
parents 181ee2118a96
children 9c9cfecd4600
comparison
equal deleted inserted replaced
44341:77bb38be00ea 44342:7f7c8521e9bd
427 | | 427 | |
428 | o 1:draft 'B' 428 | o 1:draft 'B'
429 |/ 429 |/
430 o 0:draft 'A' 430 o 0:draft 'A'
431 431
432
433 Test where the conflict happens when rebasing a merge commit
434
435 $ cd $TESTTMP
436 $ hg init conflict-in-merge
437 $ cd conflict-in-merge
438 $ hg debugdrawdag <<'EOS'
439 > F # F/conflict = foo\n
440 > |\
441 > D E
442 > |/
443 > C B # B/conflict = bar\n
444 > |/
445 > A
446 > EOS
447
448 $ hg co F
449 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
450 $ hg rebase -d B
451 rebasing 2:dc0947a82db8 "C" (C)
452 rebasing 3:e7b3f00ed42e "D" (D)
453 rebasing 4:03ca77807e91 "E" (E)
454 rebasing 5:9a6b91dc2044 "F" (F tip)
455 merging conflict
456 warning: conflicts while merging conflict! (edit, then use 'hg resolve --mark')
457 unresolved conflicts (see hg resolve, then hg rebase --continue)
458 [1]
459 The current parents are not 7 and 8 even though that's what we're merging
460 $ hg tglog
461 @ 8:draft 'E'
462 |
463 | o 7:draft 'D'
464 |/
465 o 6:draft 'C'
466 |
467 | @ 5:draft 'F'
468 | |\
469 | | o 4:draft 'E'
470 | | |
471 | o | 3:draft 'D'
472 | |/
473 | o 2:draft 'C'
474 | |
475 o | 1:draft 'B'
476 |/
477 o 0:draft 'A'
478
479 $ echo baz > conflict
480 $ hg resolve -m
481 (no more unresolved files)
482 continue: hg rebase --continue
483 $ hg rebase -c
484 already rebased 2:dc0947a82db8 "C" (C) as 0199610c343e
485 already rebased 3:e7b3f00ed42e "D" (D) as f0dd538aaa63
486 already rebased 4:03ca77807e91 "E" (E) as cbf25af8347d
487 rebasing 5:9a6b91dc2044 "F" (F)
488 saved backup bundle to $TESTTMP/conflict-in-merge/.hg/strip-backup/dc0947a82db8-ca7e7d5b-rebase.hg
489 $ hg tglog
490 @ 5:draft 'F'
491 |\
492 | o 4:draft 'E'
493 | |
494 o | 3:draft 'D'
495 |/
496 o 2:draft 'C'
497 |
498 o 1:draft 'B'
499 |
500 o 0:draft 'A'
501