revlogv2: also test transactionality of revlog v2
Without surprise, this is broken :-)
Now that it is tested, we can fix it.
Differential Revision: https://phab.mercurial-scm.org/D10627
--- a/tests/test-transaction-safety.t Mon May 03 12:34:31 2021 +0200
+++ b/tests/test-transaction-safety.t Mon May 03 12:34:41 2021 +0200
@@ -1,6 +1,26 @@
Test transaction safety
=======================
+#testcases revlogv1 revlogv2
+
+#if revlogv1
+
+ $ cat << EOF >> $HGRCPATH
+ > [experimental]
+ > revlogv2=no
+ > EOF
+
+#endif
+
+#if revlogv2
+
+ $ cat << EOF >> $HGRCPATH
+ > [experimental]
+ > revlogv2=enable-unstable-format-and-corrupt-my-data
+ > EOF
+
+#endif
+
This test basic case to make sure external process do not see transaction
content until it is committed.
@@ -103,84 +123,146 @@
$ make_one_commit first
pre-commit: -1
- external: -1
+ external: -1 (revlogv1 !)
+ external: 0 first (revlogv2 known-bad-output !)
internal: 0 first
post-tr: 0 first
+
+#if revlogv1
+
$ hg debugrevlog -c | grep inline
flags : inline
+#endif
+
check this is true for extra commit (inline → inline)
-----------------------------------------------------
the repository should still be inline (for relevant format)
+#if revlogv1
+
$ hg debugrevlog -c | grep inline
flags : inline
+
+#endif
+
$ make_one_commit second
pre-commit: 0 first
- external: 0 first
+ external: 0 first (revlogv1 !)
+ external: 1 second (revlogv2 known-bad-output !)
internal: 1 second
post-tr: 1 second
+
+#if revlogv1
+
$ hg debugrevlog -c | grep inline
flags : inline
+#endif
+
check this is true for a small pull (inline → inline)
-----------------------------------------------------
the repository should still be inline (for relevant format)
+#if revlogv1
+
$ hg debugrevlog -c | grep inline
flags : inline
+
+#endif
+
$ make_one_pull 3
pre-commit: 1 second
warning: repository is unrelated
- external: 1 second
+ external: 1 second (revlogv1 !)
+ external: 5 r3 (revlogv2 known-bad-output !)
internal: 5 r3
post-tr: 5 r3
+
+#if revlogv1
+
$ hg debugrevlog -c | grep inline
flags : inline
+#endif
+
Make a large pull (inline → no-inline)
---------------------------------------
the repository should no longer be inline (for relevant format)
+#if revlogv1
+
$ hg debugrevlog -c | grep inline
flags : inline
+
+#endif
+
$ make_one_pull 400
pre-commit: 5 r3
- external: 5 r3
+ external: 5 r3 (revlogv1 !)
+ external: 402 r400 (revlogv2 known-bad-output !)
internal: 402 r400
post-tr: 402 r400
+
+#if revlogv1
+
$ hg debugrevlog -c | grep inline
[1]
+#endif
+
check this is true for extra commit (no-inline → no-inline)
-----------------------------------------------------------
the repository should no longer be inline (for relevant format)
+
+#if revlogv1
+
$ hg debugrevlog -c | grep inline
[1]
+
+#endif
+
$ make_one_commit third
pre-commit: 402 r400
- external: 402 r400
+ external: 402 r400 (revlogv1 !)
+ external: 403 third (revlogv2 known-bad-output !)
internal: 403 third
post-tr: 403 third
+
+#if revlogv1
+
$ hg debugrevlog -c | grep inline
[1]
+#endif
+
Make a pull (not-inline → no-inline)
-------------------------------------
the repository should no longer be inline (for relevant format)
+#if revlogv1
+
$ hg debugrevlog -c | grep inline
[1]
+
+#endif
+
$ make_one_pull tip
pre-commit: 403 third
- external: 403 third
+ external: 403 third (revlogv1 !)
+ external: 503 r500 (revlogv2 known-bad-output !)
internal: 503 r500
post-tr: 503 r500
+
+#if revlogv1
+
$ hg debugrevlog -c | grep inline
[1]
+
+#endif