comparison mercurial/streamclone.py @ 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 e845537f6adb
children 6000f5b25c9b
comparison
equal deleted inserted replaced
48692:4933086bebf5 48693:de3ac3d2c60b
24 pycompat, 24 pycompat,
25 requirements as requirementsmod, 25 requirements as requirementsmod,
26 scmutil, 26 scmutil,
27 store, 27 store,
28 util, 28 util,
29 )
30 from .revlogutils import (
31 nodemap,
29 ) 32 )
30 from .utils import ( 33 from .utils import (
31 stringutil, 34 stringutil,
32 ) 35 )
33 36
214 ) 217 )
215 repo.svfs.options = localrepo.resolvestorevfsoptions( 218 repo.svfs.options = localrepo.resolvestorevfsoptions(
216 repo.ui, repo.requirements, repo.features 219 repo.ui, repo.requirements, repo.features
217 ) 220 )
218 scmutil.writereporequirements(repo) 221 scmutil.writereporequirements(repo)
222 nodemap.post_stream_cleanup(repo)
219 223
220 if rbranchmap: 224 if rbranchmap:
221 repo._branchcaches.replace(repo, rbranchmap) 225 repo._branchcaches.replace(repo, rbranchmap)
222 226
223 repo.invalidate() 227 repo.invalidate()
508 _(b'unable to apply stream clone: unsupported format: %s') 512 _(b'unable to apply stream clone: unsupported format: %s')
509 % b', '.join(sorted(missingreqs)) 513 % b', '.join(sorted(missingreqs))
510 ) 514 )
511 515
512 consumev1(repo, fp, filecount, bytecount) 516 consumev1(repo, fp, filecount, bytecount)
517 nodemap.post_stream_cleanup(repo)
513 518
514 519
515 class streamcloneapplier(object): 520 class streamcloneapplier(object):
516 """Class to manage applying streaming clone bundles. 521 """Class to manage applying streaming clone bundles.
517 522
824 ) 829 )
825 repo.svfs.options = localrepo.resolvestorevfsoptions( 830 repo.svfs.options = localrepo.resolvestorevfsoptions(
826 repo.ui, repo.requirements, repo.features 831 repo.ui, repo.requirements, repo.features
827 ) 832 )
828 scmutil.writereporequirements(repo) 833 scmutil.writereporequirements(repo)
834 nodemap.post_stream_cleanup(repo)
829 835
830 836
831 def _copy_files(src_vfs_map, dst_vfs_map, entries, progress): 837 def _copy_files(src_vfs_map, dst_vfs_map, entries, progress):
832 hardlink = [True] 838 hardlink = [True]
833 839