Patchwork D9045: tests: update test-share-safe to work with pure-python versions

login
register
mail settings
Submitter phabricator
Date Sept. 18, 2020, 12:08 p.m.
Message ID <differential-rev-PHID-DREV-n5nwbksdg5l4kqzc3h6w-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47220/
State Superseded
Headers show

Comments

phabricator - Sept. 18, 2020, 12:08 p.m.
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  zstd is not available on pure-python versions. Hence we need to wrap that part
  around `#if no-pure`. To make sure the functionality is tested on pure version
  as well, I have added another requirement addition test.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9045

AFFECTED FILES
  tests/test-share-safe.t

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-share-safe.t b/tests/test-share-safe.t
--- a/tests/test-share-safe.t
+++ b/tests/test-share-safe.t
@@ -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 no-pure
   $ 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 (pure !)
+     preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (no-pure !)
+     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 .