comparison tests/test-status.t @ 48223:b4f83c9e7905

dirstate-v2: Add support when Rust is not enabled This wires into `dirstatemap` the parser and serializer added in previous changesets. The memory representation is still the same, with a flat `dict` for `DirstateItem`s and another one for copy sources. Serialization always creates a new dirstate-v2 data file and does not support (when Rust is not enabled) appending to an existing one, since we don’t keep track of which tree nodes are new or modified. Instead the tree is reconstructed during serialization. Differential Revision: https://phab.mercurial-scm.org/D11520
author Simon Sapin <simon.sapin@octobus.net>
date Fri, 16 Jul 2021 18:42:20 +0200
parents bf8837e3d7ce
children 5c567aca080d
comparison
equal deleted inserted replaced
48222:7e78c72ee3ea 48223:b4f83c9e7905
1 #testcases dirstate-v1 dirstate-v2 1 #testcases dirstate-v1 dirstate-v2
2 2
3 #if no-rust
4 $ hg init repo0 --config format.exp-dirstate-v2=1
5 abort: dirstate v2 format requested by config but not supported (requires Rust extensions)
6 [255]
7 #endif
8
9 #if dirstate-v2 3 #if dirstate-v2
10 #require rust
11 $ echo '[format]' >> $HGRCPATH 4 $ echo '[format]' >> $HGRCPATH
12 $ echo 'exp-dirstate-v2=1' >> $HGRCPATH 5 $ echo 'exp-dirstate-v2=1' >> $HGRCPATH
13 #endif 6 #endif
14 7
15 $ hg init repo1 8 $ hg init repo1
741 When a directory containing a tracked file gets symlinked, as of 5.8 734 When a directory containing a tracked file gets symlinked, as of 5.8
742 `hg st` only gives the correct answer about clean (or deleted) files 735 `hg st` only gives the correct answer about clean (or deleted) files
743 if also listing unknowns. 736 if also listing unknowns.
744 The tree-based dirstate and status algorithm fix this: 737 The tree-based dirstate and status algorithm fix this:
745 738
746 #if symlink no-dirstate-v1 739 #if symlink no-dirstate-v1 rust
747 740
748 $ cd .. 741 $ cd ..
749 $ hg init issue6335 742 $ hg init issue6335
750 $ cd issue6335 743 $ cd issue6335
751 $ mkdir foo 744 $ mkdir foo
757 $ hg status 750 $ hg status
758 ! foo/a 751 ! foo/a
759 ? bar/a 752 ? bar/a
760 ? foo 753 ? foo
761 754
762 $ hg status -c # incorrect output with `dirstate-v1` 755 $ hg status -c # incorrect output without the Rust implementation
763 $ hg status -cu 756 $ hg status -cu
764 ? bar/a 757 ? bar/a
765 ? foo 758 ? foo
766 $ hg status -d # incorrect output with `dirstate-v1` 759 $ hg status -d # incorrect output without the Rust implementation
767 ! foo/a 760 ! foo/a
768 $ hg status -du 761 $ hg status -du
769 ! foo/a 762 ! foo/a
770 ? bar/a 763 ? bar/a
771 ? foo 764 ? foo
908 $ hg st -i -I 're:.*\.hs$' 901 $ hg st -i -I 're:.*\.hs$'
909 I A.hs 902 I A.hs
910 I B.hs 903 I B.hs
911 I ignored-folder/ctest.hs 904 I ignored-folder/ctest.hs
912 905
913 #if dirstate-v2 906 #if rust dirstate-v2
914 907
915 Check read_dir caching 908 Check read_dir caching
916 909
917 $ cd .. 910 $ cd ..
918 $ hg init repo8 911 $ hg init repo8