comparison tests/test-graft.t @ 39111:46da52f4b820

commit: try hard to reuse p1 manifest if nothing changed This is all for commit reproducibility on "hg convert". With this change, p1 manifest is reused if ctx.files() *to be committed* is empty, and if new manifest entry is identical to p1. This is important property for "hg convert" since memctx.files() built from a convert source may be either a) more narrowed thanks to a committed ctx.files() which provides more accurate status, or b) containing redundant files because of sloppy filtering on e.g. octopus merge.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 07 Jul 2018 22:40:39 +0900
parents 5b04b6204931
children 2f89a7defe62
comparison
equal deleted inserted replaced
39110:f0c2653ca706 39111:46da52f4b820
697 user: foo 697 user: foo
698 date: Thu Jan 01 00:00:00 1970 +0000 698 date: Thu Jan 01 00:00:00 1970 +0000
699 summary: 2 699 summary: 2
700 700
701 ... grafts of grafts unfortunately can't 701 ... grafts of grafts unfortunately can't
702 $ hg graft -q 13 702 $ hg graft -q 13 --debug
703 scanning for duplicate grafts
704 grafting 13:7a4785234d87 "2"
705 searching for copies back to rev 12
706 unmatched files in other (from topological common ancestor):
707 g
708 unmatched files new in both:
709 b
710 resolving manifests
711 branchmerge: True, force: True, partial: False
712 ancestor: b592ea63bb0c, local: 7e61b508e709+, remote: 7a4785234d87
713 committing files:
714 b
703 warning: can't find ancestor for 'b' copied from 'a'! 715 warning: can't find ancestor for 'b' copied from 'a'!
716 reusing manifest form p1 (listed files actually unchanged)
717 committing changelog
718 updating the branch cache
704 $ hg log -r 'destination(13)' 719 $ hg log -r 'destination(13)'
705 All copies of a cset 720 All copies of a cset
706 $ hg log -r 'origin(13) or destination(origin(13))' 721 $ hg log -r 'origin(13) or destination(origin(13))'
707 changeset: 2:5c095ad7e90f 722 changeset: 2:5c095ad7e90f
708 user: test 723 user: test
729 branch: dev 744 branch: dev
730 user: foo 745 user: foo
731 date: Thu Jan 01 00:00:00 1970 +0000 746 date: Thu Jan 01 00:00:00 1970 +0000
732 summary: 2 747 summary: 2
733 748
734 changeset: 22:d1cb6591fa4b 749 changeset: 22:3a4e92d81b97
735 branch: dev 750 branch: dev
736 tag: tip 751 tag: tip
737 user: foo 752 user: foo
738 date: Thu Jan 01 00:00:00 1970 +0000 753 date: Thu Jan 01 00:00:00 1970 +0000
739 summary: 2 754 summary: 2
741 756
742 graft works on complex revset 757 graft works on complex revset
743 758
744 $ hg graft 'origin(13) or destination(origin(13))' 759 $ hg graft 'origin(13) or destination(origin(13))'
745 skipping ancestor revision 21:7e61b508e709 760 skipping ancestor revision 21:7e61b508e709
746 skipping ancestor revision 22:d1cb6591fa4b 761 skipping ancestor revision 22:3a4e92d81b97
747 skipping revision 2:5c095ad7e90f (already grafted to 22:d1cb6591fa4b) 762 skipping revision 2:5c095ad7e90f (already grafted to 22:3a4e92d81b97)
748 grafting 7:ef0ef43d49e7 "2" 763 grafting 7:ef0ef43d49e7 "2"
749 warning: can't find ancestor for 'b' copied from 'a'! 764 warning: can't find ancestor for 'b' copied from 'a'!
750 grafting 13:7a4785234d87 "2" 765 grafting 13:7a4785234d87 "2"
751 warning: can't find ancestor for 'b' copied from 'a'! 766 warning: can't find ancestor for 'b' copied from 'a'!
752 grafting 19:9627f653b421 "2" 767 grafting 19:9627f653b421 "2"
756 graft with --force (still doesn't graft merges) 771 graft with --force (still doesn't graft merges)
757 772
758 $ hg graft 19 0 6 773 $ hg graft 19 0 6
759 skipping ungraftable merge revision 6 774 skipping ungraftable merge revision 6
760 skipping ancestor revision 0:68795b066622 775 skipping ancestor revision 0:68795b066622
761 skipping already grafted revision 19:9627f653b421 (22:d1cb6591fa4b also has origin 2:5c095ad7e90f) 776 skipping already grafted revision 19:9627f653b421 (22:3a4e92d81b97 also has origin 2:5c095ad7e90f)
762 [255] 777 [255]
763 $ hg graft 19 0 6 --force 778 $ hg graft 19 0 6 --force
764 skipping ungraftable merge revision 6 779 skipping ungraftable merge revision 6
765 grafting 19:9627f653b421 "2" 780 grafting 19:9627f653b421 "2"
766 merging b 781 merging b
771 786
772 $ echo abc > a 787 $ echo abc > a
773 $ hg ci -m 28 788 $ hg ci -m 28
774 $ hg backout 28 789 $ hg backout 28
775 reverting a 790 reverting a
776 changeset 29:53177ba928f6 backs out changeset 28:50a516bb8b57 791 changeset 29:9d95e865b00c backs out changeset 28:cc20d29aec8d
777 $ hg graft 28 792 $ hg graft 28
778 skipping ancestor revision 28:50a516bb8b57 793 skipping ancestor revision 28:cc20d29aec8d
779 [255] 794 [255]
780 $ hg graft 28 --force 795 $ hg graft 28 --force
781 grafting 28:50a516bb8b57 "28" 796 grafting 28:cc20d29aec8d "28"
782 merging a 797 merging a
783 $ cat a 798 $ cat a
784 abc 799 abc
785 800
786 graft --continue after --force 801 graft --continue after --force
787 802
788 $ echo def > a 803 $ echo def > a
789 $ hg ci -m 31 804 $ hg ci -m 31
790 $ hg graft 28 --force --tool internal:fail 805 $ hg graft 28 --force --tool internal:fail
791 grafting 28:50a516bb8b57 "28" 806 grafting 28:cc20d29aec8d "28"
792 abort: unresolved conflicts, can't continue 807 abort: unresolved conflicts, can't continue
793 (use 'hg resolve' and 'hg graft --continue') 808 (use 'hg resolve' and 'hg graft --continue')
794 [255] 809 [255]
795 $ hg resolve --all 810 $ hg resolve --all
796 merging a 811 merging a
799 $ echo abc > a 814 $ echo abc > a
800 $ hg resolve -m a 815 $ hg resolve -m a
801 (no more unresolved files) 816 (no more unresolved files)
802 continue: hg graft --continue 817 continue: hg graft --continue
803 $ hg graft -c 818 $ hg graft -c
804 grafting 28:50a516bb8b57 "28" 819 grafting 28:cc20d29aec8d "28"
805 $ cat a 820 $ cat a
806 abc 821 abc
807 822
808 Continue testing same origin policy, using revision numbers from test above 823 Continue testing same origin policy, using revision numbers from test above
809 but do some destructive editing of the repo: 824 but do some destructive editing of the repo:
820 835
821 $ hg up -qr 26 836 $ hg up -qr 26
822 $ hg tag -f something 837 $ hg tag -f something
823 $ hg graft -qr 27 838 $ hg graft -qr 27
824 $ hg graft -f 27 839 $ hg graft -f 27
825 grafting 27:ed6c7e54e319 "28" 840 grafting 27:17d42b8f5d50 "28"
826 note: graft of 27:ed6c7e54e319 created no changes to commit 841 note: graft of 27:17d42b8f5d50 created no changes to commit
827 842
828 $ cd .. 843 $ cd ..
829 844
830 Graft to duplicate a commit 845 Graft to duplicate a commit
831 846