stream-clone: stop considering working copy only requirements
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 14 Jan 2022 18:17:55 +0100
changeset 48654 eb5c33f1d08f
parent 48653 a3cf460a6b1b
child 48655 c95ace94f3ad
stream-clone: stop considering working copy only requirements Now that the ducks are properly aligned on there shelve, it becomes easy to fix the list of requirements to consider for stream. We remove the working copy specific ones and add some missing revlog specific ones. Differential Revision: https://phab.mercurial-scm.org/D11982
mercurial/requirements.py
tests/test-clone-stream-format.t
--- a/mercurial/requirements.py	Tue Jan 18 00:19:04 2022 +0100
+++ b/mercurial/requirements.py	Fri Jan 14 18:17:55 2022 +0100
@@ -109,13 +109,12 @@
     BOOKMARKS_IN_STORE_REQUIREMENT,
     CHANGELOGV2_REQUIREMENT,
     COPIESSDC_REQUIREMENT,
-    DIRSTATE_V2_REQUIREMENT,
     GENERALDELTA_REQUIREMENT,
+    INTERNAL_PHASE_REQUIREMENT,
     NODEMAP_REQUIREMENT,
     REVLOG_COMPRESSION_ZSTD,
     REVLOGV1_REQUIREMENT,
     REVLOGV2_REQUIREMENT,
-    SHARESAFE_REQUIREMENT,
     SPARSEREVLOG_REQUIREMENT,
     TREEMANIFEST_REQUIREMENT,
 }
--- a/tests/test-clone-stream-format.t	Tue Jan 18 00:19:04 2022 +0100
+++ b/tests/test-clone-stream-format.t	Fri Jan 14 18:17:55 2022 +0100
@@ -13,7 +13,7 @@
 
 Initialize repository
 
-  $ hg init server
+  $ hg init server --config format.use-share-safe=yes
   $ cd server
   $ sh $TESTDIR/testlib/stream_clone_setup.sh
   adding 00changelog-ab349180a0405010.nd
@@ -277,7 +277,65 @@
   crosschecking files in changesets and manifests
   checking files
   checked 3 changesets with 1088 changes to 1088 files
-  $ hg debugrequires -R clone-from-share | grep share
+  $ hg debugrequires -R clone-from-share | egrep 'share$'
   [1]
 
   $ killdaemons.py
+
+Test streaming from/to repository without a share-safe
+======================================================
+
+  $ rm hg-*.pid errors-*.txt
+  $ hg clone --pull --config format.use-share-safe=no server server-no-share-safe
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 1088 changes to 1088 files
+  new changesets 96ee1d7354c4:5223b5e3265f
+  updating to branch default
+  1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg verify -R server-no-share-safe
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  checked 3 changesets with 1088 changes to 1088 files
+  $ hg -R server serve -p $HGPORT -d --pid-file=hg-1.pid --error errors-1.txt
+  $ cat hg-1.pid > $DAEMON_PIDS
+  $ hg -R server-no-share-safe serve -p $HGPORT2 -d --pid-file=hg-2.pid --error errors-2.txt
+  $ cat hg-2.pid >> $DAEMON_PIDS
+  $ hg debugrequires -R server | grep share-safe
+  share-safe
+  $ hg debugrequires -R server-no-share-safe | grep share-safe
+  [1]
+
+share-safe → no-share-safe cloning
+
+  $ hg clone --quiet --stream -U http://localhost:$HGPORT clone-remove-share-safe --config format.use-share-safe=no
+  $ cat errors-1.txt
+  $ hg -R clone-remove-share-safe verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  checked 3 changesets with 1088 changes to 1088 files
+  $ hg debugrequires -R clone-remove-share-safe | grep share-safe
+  [1]
+
+
+no-share-safe → share-safe cloning
+
+  $ hg clone --quiet --stream -U http://localhost:$HGPORT2 clone-add-share-safe --config format.use-share-safe=yes
+  $ cat errors-2.txt
+  $ hg -R clone-add-share-safe verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  checked 3 changesets with 1088 changes to 1088 files
+  $ hg debugrequires -R clone-add-share-safe | grep share-safe
+  share-safe
+
+
+  $ killdaemons.py