changeset 45549:68906595016c

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
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 18 Sep 2020 17:19:49 +0530
parents 33ded2d3f4fc
children 2b339c6c6e99
files tests/test-share-safe.t
diffstat 1 files changed, 26 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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 .