Mercurial > public > mercurial-scm > hg-stable
diff mercurial/revlogutils/nodemap.py @ 48707: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 | d55c4472bbb6 |
children | 6000f5b25c9b |
line wrap: on
line diff
--- a/mercurial/revlogutils/nodemap.py Thu Jan 27 15:22:09 2022 +0100 +++ b/mercurial/revlogutils/nodemap.py Thu Jan 27 22:24:11 2022 +0100 @@ -16,6 +16,7 @@ from .. import ( error, + requirements, util, ) from . import docket as docket_mod @@ -34,6 +35,19 @@ pass +def post_stream_cleanup(repo): + """The stream clone might needs to remove some file if persisten nodemap + was dropped while stream cloning + """ + if requirements.REVLOGV1_REQUIREMENT not in repo.requirements: + return + if requirements.NODEMAP_REQUIREMENT in repo.requirements: + return + unfi = repo.unfiltered() + delete_nodemap(None, unfi, unfi.changelog) + delete_nodemap(None, repo, unfi.manifestlog._rootstore._revlog) + + def persisted_data(revlog): """read the nodemap for a revlog from disk""" if revlog._nodemap_file is None: