tests: update test-share-safe to work with non-zstd versions
zstd is not available always like pure py versions. Hence we wrap that part
around `#if zstd`. To make sure the functionality is tested on pure version
as well, I have added another requirement addition test.
Differential Revision: https://phab.mercurial-scm.org/D9045
--- a/tests/test-share-safe.t Tue Sep 15 16:51:11 2020 +0200
+++ b/tests/test-share-safe.t Fri Sep 18 17:19:49 2020 +0530
@@ -170,13 +170,12 @@
Update the source repository format and check that shared repo works
$ cd ../source
+
+Disable zstd related tests because its not present on pure version
+#if zstd
$ echo "[format]" >> .hg/hgrc
$ echo "revlog-compression=zstd" >> .hg/hgrc
- $ hg debugupgraderepo --run -q -R ../shared1
- abort: cannot upgrade repository; unsupported source requirement: shared
- [255]
-
$ hg debugupgraderepo --run -q
upgrade will perform the following actions:
@@ -190,6 +189,29 @@
date: Thu Jan 01 00:00:00 1970 +0000
summary: added b
+#endif
+ $ echo "[format]" >> .hg/hgrc
+ $ echo "use-persistent-nodemap=True" >> .hg/hgrc
+
+ $ hg debugupgraderepo --run -q -R ../shared1
+ abort: cannot upgrade repository; unsupported source requirement: shared
+ [255]
+
+ $ hg debugupgraderepo --run -q
+ upgrade will perform the following actions:
+
+ requirements
+ preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !)
+ preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
+ added: persistent-nodemap
+
+ $ hg log -r .
+ changeset: 1:5f6d8a4bf34a
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: added b
+
+
Shared one should work
$ cd ../shared1
$ hg log -r .