comparison tests/test-split.t @ 4299:4af0235e7b0b

split: take file patterns to limit selection on matching file patterns When splitting a big changeset, the user often wants to extract specific files from the changeset while leaving the others files intact. The split command can now be called with multiple file patterns. Only files that match one of the patterns will be shown in the interactive selection. The user will be able to create one or more commits with those files. When the user finishes splitting the matching files, a last commit will be made with the remaining of the files.
author Boris Feld <boris.feld@octobus.net>
date Wed, 21 Feb 2018 14:39:48 +0100
parents a98fa6c0d4f3
children 702f7e1d0b01
comparison
equal deleted inserted replaced
4298:a98fa6c0d4f3 4299:4af0235e7b0b
640 user: test 640 user: test
641 date: Thu Jan 01 00:00:00 1970 +0000 641 date: Thu Jan 01 00:00:00 1970 +0000
642 summary: split10 642 summary: split10
643 643
644 644
645
646 Check prompt options 645 Check prompt options
647 -------------------- 646 --------------------
648 647
649 Look at the help (both record and split helps) 648 Look at the help (both record and split helps)
650 649
763 $ hg status 762 $ hg status
764 ? SPLIT3 763 ? SPLIT3
765 ? SPLIT4 764 ? SPLIT4
766 ? editor.sh 765 ? editor.sh
767 ? num 766 ? num
767
768 Test restricting the split to a subset of files
769 -----------------------------------------------
770
771 $ hg add SPLIT3 SPLIT4
772 $ hg amend
773
774 Only run on 2 files
775
776 (remaining changes gathered with unmatched one)
777
778 $ hg split SPLIT2 SPLIT3 << EOF
779 > y
780 > n
781 > c
782 > EOF
783 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
784 adding SPLIT2
785 adding SPLIT3
786 adding SPLIT4
787 diff --git a/SPLIT2 b/SPLIT2
788 new file mode 100644
789 examine changes to 'SPLIT2'? [Ynesfdaq?] y
790
791 diff --git a/SPLIT3 b/SPLIT3
792 new file mode 100644
793 examine changes to 'SPLIT3'? [Ynesfdaq?] n
794
795 continue splitting? [Ycdq?] c
796 $ hg status --change '.~1'
797 A SPLIT2
798 $ hg status --change '.'
799 A SPLIT3
800 A SPLIT4
801 $ hg fold --from '.~1'
802 2 changesets folded
803 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
804
805 (no remaining changes)
806
807 $ hg split SPLIT2 SPLIT3 << EOF
808 > y
809 > n
810 > y
811 > y
812 > EOF
813 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
814 adding SPLIT2
815 adding SPLIT3
816 adding SPLIT4
817 diff --git a/SPLIT2 b/SPLIT2
818 new file mode 100644
819 examine changes to 'SPLIT2'? [Ynesfdaq?] y
820
821 diff --git a/SPLIT3 b/SPLIT3
822 new file mode 100644
823 examine changes to 'SPLIT3'? [Ynesfdaq?] n
824
825 continue splitting? [Ycdq?] y
826 diff --git a/SPLIT3 b/SPLIT3
827 new file mode 100644
828 examine changes to 'SPLIT3'? [Ynesfdaq?] y
829
830 no more change to split
831 $ hg status --change '.~2'
832 A SPLIT2
833 $ hg status --change '.~1'
834 A SPLIT3
835 $ hg status --change '.'
836 A SPLIT4
837 $ hg fold --from '.~2'
838 3 changesets folded
839 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
840
841 (only all matched selected)
842
843 $ hg split SPLIT2 SPLIT3 << EOF
844 > y
845 > y
846 > EOF
847 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
848 adding SPLIT2
849 adding SPLIT3
850 adding SPLIT4
851 diff --git a/SPLIT2 b/SPLIT2
852 new file mode 100644
853 examine changes to 'SPLIT2'? [Ynesfdaq?] y
854
855 diff --git a/SPLIT3 b/SPLIT3
856 new file mode 100644
857 examine changes to 'SPLIT3'? [Ynesfdaq?] y
858
859 no more change to split
860 $ hg status --change '.~1'
861 A SPLIT2
862 A SPLIT3
863 $ hg status --change '.'
864 A SPLIT4
865 $ hg fold --from '.~1'
866 2 changesets folded
867 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
868
869 Check that discard does not alter unmatched files
870
871 $ hg split SPLIT2 SPLIT3 << EOF
872 > y
873 > n
874 > d
875 > EOF
876 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
877 adding SPLIT2
878 adding SPLIT3
879 adding SPLIT4
880 diff --git a/SPLIT2 b/SPLIT2
881 new file mode 100644
882 examine changes to 'SPLIT2'? [Ynesfdaq?] y
883
884 diff --git a/SPLIT3 b/SPLIT3
885 new file mode 100644
886 examine changes to 'SPLIT3'? [Ynesfdaq?] n
887
888 continue splitting? [Ycdq?] d
889 discarding remaining changes
890 no more change to split
891 $ hg status --change '.~1'
892 A SPLIT2
893 $ hg status --change '.'
894 A SPLIT4
895 $ hg fold --from '.~1'
896 2 changesets folded
897 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
898 $ hg add SPLIT3
899 $ hg amend