Show More
@@ -762,3 +762,107 b' The tree-based dirstate and status algor' | |||||
762 | ? foo |
|
762 | ? foo | |
763 |
|
763 | |||
764 | #endif |
|
764 | #endif | |
|
765 | ||||
|
766 | ||||
|
767 | Create a repo with files in each possible status | |||
|
768 | ||||
|
769 | $ cd .. | |||
|
770 | $ hg init repo7 | |||
|
771 | $ cd repo7 | |||
|
772 | $ mkdir subdir | |||
|
773 | $ touch clean modified deleted removed | |||
|
774 | $ touch subdir/clean subdir/modified subdir/deleted subdir/removed | |||
|
775 | $ echo ignored > .hgignore | |||
|
776 | $ hg ci -Aqm '#0' | |||
|
777 | $ echo 1 > modified | |||
|
778 | $ echo 1 > subdir/modified | |||
|
779 | $ rm deleted | |||
|
780 | $ rm subdir/deleted | |||
|
781 | $ hg rm removed | |||
|
782 | $ hg rm subdir/removed | |||
|
783 | $ touch unknown ignored | |||
|
784 | $ touch subdir/unknown subdir/ignored | |||
|
785 | ||||
|
786 | Check the output | |||
|
787 | ||||
|
788 | $ hg status | |||
|
789 | M modified | |||
|
790 | M subdir/modified | |||
|
791 | R removed | |||
|
792 | R subdir/removed | |||
|
793 | ! deleted | |||
|
794 | ! subdir/deleted | |||
|
795 | ? subdir/unknown | |||
|
796 | ? unknown | |||
|
797 | ||||
|
798 | $ hg status -mard | |||
|
799 | M modified | |||
|
800 | M subdir/modified | |||
|
801 | R removed | |||
|
802 | R subdir/removed | |||
|
803 | ! deleted | |||
|
804 | ! subdir/deleted | |||
|
805 | ||||
|
806 | $ hg status -A | |||
|
807 | M modified | |||
|
808 | M subdir/modified | |||
|
809 | R removed | |||
|
810 | R subdir/removed | |||
|
811 | ! deleted | |||
|
812 | ! subdir/deleted | |||
|
813 | ? subdir/unknown | |||
|
814 | ? unknown | |||
|
815 | I ignored | |||
|
816 | I subdir/ignored | |||
|
817 | C .hgignore | |||
|
818 | C clean | |||
|
819 | C subdir/clean | |||
|
820 | ||||
|
821 | Note: `hg status some-name` creates a patternmatcher which is not supported | |||
|
822 | yet by the Rust implementation of status, but includematcher is supported. | |||
|
823 | --include is used below for that reason | |||
|
824 | ||||
|
825 | Remove a directory that contains tracked files | |||
|
826 | ||||
|
827 | $ rm -r subdir | |||
|
828 | $ hg status --include subdir | |||
|
829 | R subdir/removed | |||
|
830 | ! subdir/clean | |||
|
831 | ! subdir/deleted | |||
|
832 | ! subdir/modified | |||
|
833 | ||||
|
834 | … and replace it by a file | |||
|
835 | ||||
|
836 | $ touch subdir | |||
|
837 | $ hg status --include subdir | |||
|
838 | R subdir/removed | |||
|
839 | ! subdir/clean | |||
|
840 | ! subdir/deleted | |||
|
841 | ! subdir/modified | |||
|
842 | ? subdir | |||
|
843 | ||||
|
844 | Replaced a deleted or removed file with a directory | |||
|
845 | ||||
|
846 | $ mkdir deleted removed | |||
|
847 | $ touch deleted/1 removed/1 | |||
|
848 | $ hg status --include deleted --include removed | |||
|
849 | R removed | |||
|
850 | ! deleted | |||
|
851 | ? deleted/1 | |||
|
852 | ? removed/1 | |||
|
853 | $ hg add removed/1 | |||
|
854 | $ hg status --include deleted --include removed | |||
|
855 | A removed/1 | |||
|
856 | R removed | |||
|
857 | ! deleted | |||
|
858 | ? deleted/1 | |||
|
859 | ||||
|
860 | Deeply nested files in an ignored directory are still listed on request | |||
|
861 | ||||
|
862 | $ echo ignored-dir >> .hgignore | |||
|
863 | $ mkdir ignored-dir | |||
|
864 | $ mkdir ignored-dir/subdir | |||
|
865 | $ touch ignored-dir/subdir/1 | |||
|
866 | $ hg status --ignored | |||
|
867 | I ignored | |||
|
868 | I ignored-dir/subdir/1 |
General Comments 0
You need to be logged in to leave comments.
Login now