comparison tests/test-status.t @ 47351:3b9914b28133

dirstate-v2: Add --dirs to debugdirstate command `hg debugdirstate --dirs` also shows information stored in the dirstate (for `read_dir` caching) about directories. Differential Revision: https://phab.mercurial-scm.org/D10828
author Simon Sapin <simon.sapin@octobus.net>
date Mon, 31 May 2021 19:54:41 +0200
parents 5e12b6bfdd3e
children 9d58e54b5966
comparison
equal deleted inserted replaced
47350:04d1f17f49e7 47351:3b9914b28133
913 > EOF 913 > EOF
914 $ hg st -i -I 're:.*\.hs$' 914 $ hg st -i -I 're:.*\.hs$'
915 I A.hs 915 I A.hs
916 I B.hs 916 I B.hs
917 I ignored-folder/ctest.hs 917 I ignored-folder/ctest.hs
918
919 #if dirstate-v2
920
921 Check read_dir caching
922
923 $ cd ..
924 $ hg init repo8
925 $ cd repo8
926 $ mkdir subdir
927 $ touch subdir/a subdir/b
928 $ hg ci -Aqm '#0'
929
930 The cached mtime is initially unset
931
932 $ hg debugdirstate --dirs --no-dates | grep '^d'
933 d 0 0 unset subdir
934
935 It is still not set when there are unknown files
936
937 $ touch subdir/unknown
938 $ hg status
939 ? subdir/unknown
940 $ hg debugdirstate --dirs --no-dates | grep '^d'
941 d 0 0 unset subdir
942
943 Now the directory is eligible for caching, so its mtime is save in the dirstate
944
945 $ rm subdir/unknown
946 $ hg status
947 $ hg debugdirstate --dirs --no-dates | grep '^d'
948 d 0 0 set subdir
949
950 This time the command should be ever so slightly faster since it does not need `read_dir("subdir")`
951
952 $ hg status
953
954 Creating a new file changes the directory’s mtime, invalidating the cache
955
956 $ touch subdir/unknown
957 $ hg status
958 ? subdir/unknown
959
960 #endif