Mercurial > hg
comparison tests/test-copies-chain-merge.t @ 45798:ff7e0ca666e8
copies: make sure deleted copy info do not overwriting unrelated ones
See test documentation for details. This is yet another corner case for copy
tracing.
Differential Revision: https://phab.mercurial-scm.org/D9200
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 13 Oct 2020 05:15:44 +0200 |
parents | 6620caf427ec |
children | 705c37f22859 |
comparison
equal
deleted
inserted
replaced
45797:5b6c0af021da | 45798:ff7e0ca666e8 |
---|---|
582 o 0 i-0 initial commit: a b h | 582 o 0 i-0 initial commit: a b h |
583 | 583 |
584 | 584 |
585 | 585 |
586 $ hg up null --quiet | 586 $ hg up null --quiet |
587 | |
588 Merging a branch where a rename was deleted with a branch where the same file was renamed | |
589 ------------------------------------------------------------------------------------------ | |
590 | |
591 Create a "conflicting" merge where `d` get removed on one branch before its | |
592 rename information actually conflict with the other branch. | |
593 | |
594 (the copy information from the branch that was not deleted should win). | |
595 | |
596 $ hg up 'desc("i-0")' | |
597 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
598 $ hg mv b d | |
599 $ hg ci -m "h-1: b -(move)-> d" | |
600 created new head | |
601 | |
602 $ hg up 'desc("c-1")' | |
603 1 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
604 $ hg merge 'desc("h-1")' | |
605 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
606 (branch merge, don't forget to commit) | |
607 $ hg ci -m "mCH-delete-before-conflict-m-0" | |
608 | |
609 $ hg up 'desc("h-1")' | |
610 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
611 $ hg merge 'desc("c-1")' | |
612 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
613 (branch merge, don't forget to commit) | |
614 $ hg ci -m "mHC-delete-before-conflict-m-0" | |
615 created new head | |
616 $ hg log -G --rev '::(desc("mCH-delete-before-conflict-m")+desc("mHC-delete-before-conflict-m"))' | |
617 @ 36 mHC-delete-before-conflict-m-0 | |
618 |\ | |
619 +---o 35 mCH-delete-before-conflict-m-0 | |
620 | |/ | |
621 | o 34 h-1: b -(move)-> d | |
622 | | | |
623 o | 6 c-1 delete d | |
624 | | | |
625 o | 2 i-2: c -move-> d | |
626 | | | |
627 o | 1 i-1: a -move-> c | |
628 |/ | |
629 o 0 i-0 initial commit: a b h | |
630 | |
587 | 631 |
588 | 632 |
589 Test that sidedata computations during upgrades are correct | 633 Test that sidedata computations during upgrades are correct |
590 =========================================================== | 634 =========================================================== |
591 | 635 |
799 ##### revision 33 ##### | 843 ##### revision 33 ##### |
800 1 sidedata entries | 844 1 sidedata entries |
801 entry-0014 size 14 | 845 entry-0014 size 14 |
802 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d' | 846 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d' |
803 salvaged : d, ; | 847 salvaged : d, ; |
848 ##### revision 34 ##### | |
849 1 sidedata entries | |
850 entry-0014 size 24 | |
851 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00bd' | |
852 removed : b, ; | |
853 added p1: d, b; | |
854 ##### revision 35 ##### | |
855 1 sidedata entries | |
856 entry-0014 size 4 | |
857 '\x00\x00\x00\x00' | |
858 ##### revision 36 ##### | |
859 1 sidedata entries | |
860 entry-0014 size 4 | |
861 '\x00\x00\x00\x00' | |
804 | 862 |
805 #endif | 863 #endif |
806 | 864 |
807 | 865 |
808 Test copy information chaining | 866 Test copy information chaining |
1556 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBC-revert-m-0")' | 1614 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBC-revert-m-0")' |
1557 M b | 1615 M b |
1558 A d | 1616 A d |
1559 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCB-revert-m-0")' | 1617 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCB-revert-m-0")' |
1560 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBC-revert-m-0")' | 1618 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBC-revert-m-0")' |
1619 | |
1620 | |
1621 Merging a branch where a rename was deleted with a branch where the same file was renamed | |
1622 ------------------------------------------------------------------------------------------ | |
1623 | |
1624 Create a "conflicting" merge where `d` get removed on one branch before its | |
1625 rename information actually conflict with the other branch. | |
1626 | |
1627 (the copy information from the branch that was not deleted should win). | |
1628 | |
1629 $ hg log -G --rev '::(desc("mCH-delete-before-conflict-m")+desc("mHC-delete-before-conflict-m"))' | |
1630 @ 36 mHC-delete-before-conflict-m-0 | |
1631 |\ | |
1632 +---o 35 mCH-delete-before-conflict-m-0 | |
1633 | |/ | |
1634 | o 34 h-1: b -(move)-> d | |
1635 | | | |
1636 o | 6 c-1 delete d | |
1637 | | | |
1638 o | 2 i-2: c -move-> d | |
1639 | | | |
1640 o | 1 i-1: a -move-> c | |
1641 |/ | |
1642 o 0 i-0 initial commit: a b h | |
1643 | |
1644 | |
1645 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCH-delete-before-conflict-m")' | |
1646 A d | |
1647 b (no-compatibility no-changeset !) | |
1648 R a | |
1649 R b | |
1650 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mHC-delete-before-conflict-m")' | |
1651 A d | |
1652 b | |
1653 R a | |
1654 R b | |
1655 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCH-delete-before-conflict-m")' | |
1656 A d | |
1657 b | |
1658 R b | |
1659 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mHC-delete-before-conflict-m")' | |
1660 A d | |
1661 b | |
1662 R b | |
1663 $ hg status --copies --rev 'desc("h-1")' --rev 'desc("mCH-delete-before-conflict-m")' | |
1664 R a | |
1665 $ hg status --copies --rev 'desc("h-1")' --rev 'desc("mHC-delete-before-conflict-m")' | |
1666 R a |