dirstate-v2: Add a variant of some tests, that uses the new format
authorSimon Sapin <simon.sapin@octobus.net>
Wed, 19 May 2021 13:15:00 +0200
changeset 47281 6763913fa175
parent 47280 1766130fe9ba
child 47282 ce41ee53263f
dirstate-v2: Add a variant of some tests, that uses the new format With this, the new format receives some testing every time someone runs tests with Rust extensions enabled, including on CI. Differential Revision: https://phab.mercurial-scm.org/D10720
tests/test-dirstate-race.t
tests/test-dirstate-race2.t
tests/test-dirstate.t
tests/test-hgignore.t
tests/test-permissions.t
tests/test-purge.t
tests/test-status.t
tests/test-symlinks.t
--- a/tests/test-dirstate-race.t	Wed May 19 13:15:00 2021 +0200
+++ b/tests/test-dirstate-race.t	Wed May 19 13:15:00 2021 +0200
@@ -1,4 +1,4 @@
-#testcases dirstate-v1 dirstate-v1-tree
+#testcases dirstate-v1 dirstate-v1-tree dirstate-v2
 
 #if dirstate-v1-tree
 #require rust
@@ -6,6 +6,12 @@
   $ echo 'dirstate-tree.in-memory=1' >> $HGRCPATH
 #endif
 
+#if dirstate-v2
+#require rust
+  $ echo '[format]' >> $HGRCPATH
+  $ echo 'exp-dirstate-v2=1' >> $HGRCPATH
+#endif
+
   $ hg init repo
   $ cd repo
   $ echo a > a
--- a/tests/test-dirstate-race2.t	Wed May 19 13:15:00 2021 +0200
+++ b/tests/test-dirstate-race2.t	Wed May 19 13:15:00 2021 +0200
@@ -1,4 +1,4 @@
-#testcases dirstate-v1 dirstate-v1-tree
+#testcases dirstate-v1 dirstate-v1-tree dirstate-v2
 
 #if dirstate-v1-tree
 #require rust
@@ -6,6 +6,12 @@
   $ echo 'dirstate-tree.in-memory=1' >> $HGRCPATH
 #endif
 
+#if dirstate-v2
+#require rust
+  $ echo '[format]' >> $HGRCPATH
+  $ echo 'exp-dirstate-v2=1' >> $HGRCPATH
+#endif
+
 Checking the size/permissions/file-type of files stored in the
 dirstate after an update where the files are changed concurrently
 outside of hg's control.
--- a/tests/test-dirstate.t	Wed May 19 13:15:00 2021 +0200
+++ b/tests/test-dirstate.t	Wed May 19 13:15:00 2021 +0200
@@ -1,4 +1,4 @@
-#testcases dirstate-v1 dirstate-v1-tree
+#testcases dirstate-v1 dirstate-v1-tree dirstate-v2
 
 #if dirstate-v1-tree
 #require rust
@@ -6,6 +6,12 @@
   $ echo 'dirstate-tree.in-memory=1' >> $HGRCPATH
 #endif
 
+#if dirstate-v2
+#require rust
+  $ echo '[format]' >> $HGRCPATH
+  $ echo 'exp-dirstate-v2=1' >> $HGRCPATH
+#endif
+
 ------ Test dirstate._dirs refcounting
 
   $ hg init t
--- a/tests/test-hgignore.t	Wed May 19 13:15:00 2021 +0200
+++ b/tests/test-hgignore.t	Wed May 19 13:15:00 2021 +0200
@@ -1,4 +1,4 @@
-#testcases dirstate-v1 dirstate-v1-tree
+#testcases dirstate-v1 dirstate-v1-tree dirstate-v2
 
 #if dirstate-v1-tree
 #require rust
@@ -6,6 +6,12 @@
   $ echo 'dirstate-tree.in-memory=1' >> $HGRCPATH
 #endif
 
+#if dirstate-v2
+#require rust
+  $ echo '[format]' >> $HGRCPATH
+  $ echo 'exp-dirstate-v2=1' >> $HGRCPATH
+#endif
+
   $ hg init ignorerepo
   $ cd ignorerepo
 
--- a/tests/test-permissions.t	Wed May 19 13:15:00 2021 +0200
+++ b/tests/test-permissions.t	Wed May 19 13:15:00 2021 +0200
@@ -1,6 +1,6 @@
 #require unix-permissions no-root reporevlogstore
 
-#testcases dirstate-v1 dirstate-v1-tree
+#testcases dirstate-v1 dirstate-v1-tree dirstate-v2
 
 #if dirstate-v1-tree
 #require rust
@@ -8,6 +8,12 @@
   $ echo 'dirstate-tree.in-memory=1' >> $HGRCPATH
 #endif
 
+#if dirstate-v2
+#require rust
+  $ echo '[format]' >> $HGRCPATH
+  $ echo 'exp-dirstate-v2=1' >> $HGRCPATH
+#endif
+
   $ hg init t
   $ cd t
 
--- a/tests/test-purge.t	Wed May 19 13:15:00 2021 +0200
+++ b/tests/test-purge.t	Wed May 19 13:15:00 2021 +0200
@@ -1,4 +1,4 @@
-#testcases dirstate-v1 dirstate-v1-tree
+#testcases dirstate-v1 dirstate-v1-tree dirstate-v2
 
 #if dirstate-v1-tree
 #require rust
@@ -6,6 +6,12 @@
   $ echo 'dirstate-tree.in-memory=1' >> $HGRCPATH
 #endif
 
+#if dirstate-v2
+#require rust
+  $ echo '[format]' >> $HGRCPATH
+  $ echo 'exp-dirstate-v2=1' >> $HGRCPATH
+#endif
+
 init
 
   $ hg init t
--- a/tests/test-status.t	Wed May 19 13:15:00 2021 +0200
+++ b/tests/test-status.t	Wed May 19 13:15:00 2021 +0200
@@ -1,4 +1,10 @@
-#testcases dirstate-v1 dirstate-v1-tree
+#testcases dirstate-v1 dirstate-v1-tree dirstate-v2
+
+#if no-rust
+  $ hg init repo0 --config format.exp-dirstate-v2=1
+  abort: dirstate v2 format requested by config but not supported (requires Rust extensions)
+  [255]
+#endif
 
 #if dirstate-v1-tree
 #require rust
@@ -6,6 +12,12 @@
   $ echo 'dirstate-tree.in-memory=1' >> $HGRCPATH
 #endif
 
+#if dirstate-v2
+#require rust
+  $ echo '[format]' >> $HGRCPATH
+  $ echo 'exp-dirstate-v2=1' >> $HGRCPATH
+#endif
+
   $ hg init repo1
   $ cd repo1
   $ mkdir a b a/1 b/1 b/2
--- a/tests/test-symlinks.t	Wed May 19 13:15:00 2021 +0200
+++ b/tests/test-symlinks.t	Wed May 19 13:15:00 2021 +0200
@@ -1,6 +1,6 @@
 #require symlink
 
-#testcases dirstate-v1 dirstate-v1-tree
+#testcases dirstate-v1 dirstate-v1-tree dirstate-v2
 
 #if dirstate-v1-tree
 #require rust
@@ -8,6 +8,12 @@
   $ echo 'dirstate-tree.in-memory=1' >> $HGRCPATH
 #endif
 
+#if dirstate-v2
+#require rust
+  $ echo '[format]' >> $HGRCPATH
+  $ echo 'exp-dirstate-v2=1' >> $HGRCPATH
+#endif
+
 == tests added in 0.7 ==
 
   $ hg init test-symlinks-0.7; cd test-symlinks-0.7;