Mercurial > public > mercurial-scm > hg-stable
diff mercurial/streamclone.py @ 50670:9caa860dcbec
stream-clone: implement decidated `get_streams` method for revlog
For revlog, we can do better using the maximum linkrev expected. This approach
open the way to dealing with a much larger set of non-trivial changes, like
splitting of inline revlogs.
We will actually tackle this issue in the next changesets (thanks to this one).
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 29 May 2023 14:07:58 +0200 |
parents | 5e60abf811f3 |
children | 60f9602b413e |
line wrap: on
line diff
--- a/mercurial/streamclone.py Sun May 28 05:52:58 2023 +0200 +++ b/mercurial/streamclone.py Mon May 29 14:07:58 2023 +0200 @@ -635,6 +635,7 @@ # translate the vfs one entries = [(vfs_key, vfsmap[vfs_key], e) for (vfs_key, e) in entries] + max_linkrev = len(repo) file_count = totalfilesize = 0 # record the expected size of every file for k, vfs, e in entries: @@ -657,7 +658,10 @@ totalbytecount = 0 for src, vfs, e in entries: - for name, stream, size in e.get_streams(vfs, copies=copy): + entry_streams = e.get_streams( + repo=repo, vfs=vfs, copies=copy, max_changeset=max_linkrev + ) + for name, stream, size in entry_streams: yield src yield util.uvarintencode(len(name)) yield util.uvarintencode(size)