comparison tests/test-evolve-content-divergence.t @ 3807:03ccdc753582

evolve: commit the transaction if conflicts occur while merging content-div Yes, let's commit the transaction in case conflicts occur. Yes, this is what unshelve does and this is one of the reasons we don't like unshelve. Previous patches added support for resolving content-divergence when they are on different parents with parent of one being the gca. In such cases, we relocate one of the divergent commit to the parent of another one. All the relocation stuff and merging divergent changeset stuff happens in a single transaction, so if there are conflicts while merging, we abort and the transaction rollsback and our relocated commit is not applied after abort. We don't want to process the relocation because that can lead to conflicts and we will have dirty wdir because of resolving conflicts. So, we commit the transaction when merging results in conflicts to make sure if relocation happened, we commit that. This fixes the absence of relocation commit found in previous patch and uncover a new bug about handling of relocated commit. Upcoming patch will fix it.
author Pulkit Goyal <7895pulkit@gmail.com>
date Thu, 07 Jun 2018 20:27:03 +0530
parents 99469bb3854e
children f06ff8fee2f6
comparison
equal deleted inserted replaced
3806:99469bb3854e 3807:03ccdc753582
530 updating to "local" side of the conflict: 4065e1d314c3 530 updating to "local" side of the conflict: 4065e1d314c3
531 merging "other" content-divergent changeset '6d515d1ffc69' 531 merging "other" content-divergent changeset '6d515d1ffc69'
532 merging y 532 merging y
533 warning: conflicts while merging y! (edit, then use 'hg resolve --mark') 533 warning: conflicts while merging y! (edit, then use 'hg resolve --mark')
534 0 files updated, 0 files merged, 0 files removed, 1 files unresolved 534 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
535 transaction abort!
536 rollback completed
537 abort: fix conflicts and run 'hg evolve --continue' or use 'hg update -C .' to abort 535 abort: fix conflicts and run 'hg evolve --continue' or use 'hg update -C .' to abort
538 [255] 536 [255]
539 537
540 $ echo watbar > y 538 $ echo watbar > y
541 $ hg resolve -m 539 $ hg resolve -m
543 continue: hg evolve --continue 541 continue: hg evolve --continue
544 $ hg evolve --continue 542 $ hg evolve --continue
545 working directory is now at bbaca013758a 543 working directory is now at bbaca013758a
546 544
547 $ hg glog 545 $ hg glog
548 @ 19:bbaca013758a added y 546 @ 20:bbaca013758a added y
549 | () [bar] draft 547 | () [bar] draft
548 | * 19:6d515d1ffc69 added y
549 |/ () [default] draft
550 o 14:be41fdcd0ee1 added foo to x 550 o 14:be41fdcd0ee1 added foo to x
551 | () [bar] draft 551 | () [bar] draft
552 o 9:b6b20b8eefdc added d 552 o 9:b6b20b8eefdc added d
553 | () [default] draft 553 | () [default] draft
554 o 8:7c46f743e62f added c 554 o 8:7c46f743e62f added c
558 o 1:c7586e2a9264 added a 558 o 1:c7586e2a9264 added a
559 | () [default] draft 559 | () [default] draft
560 o 0:8fa14d15e168 added hgignore 560 o 0:8fa14d15e168 added hgignore
561 () [default] draft 561 () [default] draft
562 562
563 $ hg obslog -r . --all
564 * 6d515d1ffc69 (19) added y
565 |
566 | @ bbaca013758a (20) added y
567 |/|
568 x | 29e08829c51f (16) added y
569 | | rewritten(parent) as 6d515d1ffc69 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
570 | | rewritten(branch, parent, content) as bbaca013758a using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
571 | |
572 | x 4065e1d314c3 (18) added y
573 | | rewritten(content) as bbaca013758a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
574 | |
575 | x f1d75198aac4 (17) added y
576 |/ rewritten(content) as 4065e1d314c3 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
577 |
578 x 9c30046901ab (15) added y
579 rewritten(content) as 29e08829c51f using amend by test (Thu Jan 01 00:00:00 1970 +0000)
580 rewritten(branch, parent) as f1d75198aac4 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
581
582
563 checking that relocated commit is there 583 checking that relocated commit is there
564 $ hg exp 6d515d1ffc69 --hidden 584 $ hg exp 6d515d1ffc69 --hidden
565 abort: unknown revision '6d515d1ffc69'! 585 # HG changeset patch
566 [255] 586 # User test
587 # Date 0 0
588 # Thu Jan 01 00:00:00 1970 +0000
589 # Node ID 6d515d1ffc6925b036c933078ccb804c26da80b2
590 # Parent be41fdcd0ee181081c4e42c6ee333d3dc3b3ab45
591 added y
592
593 diff -r be41fdcd0ee1 -r 6d515d1ffc69 y
594 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
595 +++ b/y Thu Jan 01 00:00:00 1970 +0000
596 @@ -0,0 +1,1 @@
597 +bar