Mercurial > hg
diff tests/test-clone-stream-format.t @ 48693:de3ac3d2c60b
stream-clone: allow to change persistent-nodemap format during stream clone
Persistent nodemap affect the store format. However it is fairly isolated and
fast to generate locally. So not making it a fixed part of the stream clone is
useful.
This allow clients without persistent-nodemap support (default for client
without Rust enabled, or simply older client). So it make it possible to enable
persistent nodemap on client, where it can provide a massive boost. without too
much consequence.
To do so, we stop using it in the advertisement requirements for streaming and
let the client add/remove the necessary file depending of its configuration.
We still send the files as it seems like a small save to not regenerate them.
In addition, the way we match them will overlap with the changelog-v2/revlog-v2
so we can't simply skip the associated patterns.
Differential Revision: https://phab.mercurial-scm.org/D12096
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 27 Jan 2022 22:24:11 +0100 |
parents | 4933086bebf5 |
children | cffc914cc01b |
line wrap: on
line diff
--- a/tests/test-clone-stream-format.t Thu Jan 27 15:22:09 2022 +0100 +++ b/tests/test-clone-stream-format.t Thu Jan 27 22:24:11 2022 +0100 @@ -4,6 +4,11 @@ #testcases stream-legacy stream-bundle2 + $ cat << EOF >> $HGRCPATH + > [storage] + > revlog.persistent-nodemap.slow-path=allow + > EOF + #if stream-legacy $ cat << EOF >> $HGRCPATH > [server] @@ -13,7 +18,7 @@ Initialize repository - $ hg init server --config format.use-share-safe=yes + $ hg init server --config format.use-share-safe=yes --config format.use-persistent-nodemap=yes $ cd server $ sh $TESTDIR/testlib/stream_clone_setup.sh adding 00changelog-ab349180a0405010.nd @@ -345,3 +350,86 @@ $ killdaemons.py + + +Test streaming from/to repository without a persistent-nodemap +============================================================== + +persistent nodemap affects revlog, but they are easy to generate locally, so we allow it to be changed over a stream clone + + $ rm hg-*.pid errors-*.txt + $ hg clone --pull --config format.use-persistent-nodemap=no server server-no-persistent-nodemap + requesting all changes + adding changesets + adding manifests + adding file changes + added 5004 changesets with 1088 changes to 1088 files (+1 heads) + new changesets 96ee1d7354c4:06ddac466af5 + updating to branch default + 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg verify -R server-no-persistent-nodemap + checking changesets + checking manifests + crosschecking files in changesets and manifests + checking files + checked 5004 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-persistent-nodemap serve -p $HGPORT2 -d --pid-file=hg-2.pid --error errors-2.txt + $ cat hg-2.pid >> $DAEMON_PIDS + $ hg debugrequires -R server | grep persistent-nodemap + persistent-nodemap + $ hg debugrequires -R server-no-persistent-nodemap | grep persistent-nodemap + [1] + $ ls -1 server/.hg/store/00changelog* + server/.hg/store/00changelog-*.nd (glob) + server/.hg/store/00changelog.d + server/.hg/store/00changelog.i + server/.hg/store/00changelog.n + $ ls -1 server-no-persistent-nodemap/.hg/store/00changelog* + server-no-persistent-nodemap/.hg/store/00changelog.d + server-no-persistent-nodemap/.hg/store/00changelog.i + +persistent-nodemap → no-persistent-nodemap cloning + + $ hg clone --quiet --stream -U http://localhost:$HGPORT clone-remove-persistent-nodemap --config format.use-persistent-nodemap=no + $ cat errors-1.txt + $ hg -R clone-remove-persistent-nodemap verify + checking changesets + checking manifests + crosschecking files in changesets and manifests + checking files + checked 5004 changesets with 1088 changes to 1088 files + $ hg debugrequires -R clone-remove-persistent-nodemap | grep persistent-nodemap + [1] + +The persistent-nodemap files should no longer exists + + $ ls -1 clone-remove-persistent-nodemap/.hg/store/00changelog* + clone-remove-persistent-nodemap/.hg/store/00changelog.d + clone-remove-persistent-nodemap/.hg/store/00changelog.i + + +no-persistent-nodemap → persistent-nodemap cloning + + $ hg clone --quiet --stream -U http://localhost:$HGPORT2 clone-add-persistent-nodemap --config format.use-persistent-nodemap=yes + $ cat errors-2.txt + $ hg -R clone-add-persistent-nodemap verify + checking changesets + checking manifests + crosschecking files in changesets and manifests + checking files + checked 5004 changesets with 1088 changes to 1088 files + $ hg debugrequires -R clone-add-persistent-nodemap | grep persistent-nodemap + persistent-nodemap + +The persistent-nodemap files should exists + + $ ls -1 clone-add-persistent-nodemap/.hg/store/00changelog* + clone-add-persistent-nodemap/.hg/store/00changelog-*.nd (glob) + clone-add-persistent-nodemap/.hg/store/00changelog.d + clone-add-persistent-nodemap/.hg/store/00changelog.i + clone-add-persistent-nodemap/.hg/store/00changelog.n + + + $ killdaemons.py