Mercurial > public > mercurial-scm > hg-stable
diff mercurial/streamclone.py @ 52929:9abf173a958b
stream-clone-v2: use the pass through for threaded stream clone
The reader thread just want to iterate over chunk, so let it do just that. This avoid some silly layer of filechunkiter and chunk buffer.
Before this change, we had the following layers:
bundle2part (iterator of chunks)
? chunkbuffer (iterator of chunks to file-like)
? filechunkiter (file-like to chunkgs)
? _DataQueue (thread safe iterator of chunks)
? chunkbuffer (iterator of chunks to file-like).
We now have removed the first layer of chunkbuffer + filechunkiter:
bundle2part (iterator of chunks)
? _DataQueue (thread safe iterator of chunks)
? chunkbuffer (iterator of chunks to file-like).
This fix the output order change that was previously introduced.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 21 Jan 2025 04:28:11 +0100 |
parents | d5ae681834e8 |
children | aee193b1c784 |
line wrap: on
line diff
--- a/mercurial/streamclone.py Mon Jan 27 18:08:34 2025 +0100 +++ b/mercurial/streamclone.py Tue Jan 21 04:28:11 2025 +0100 @@ -1138,11 +1138,9 @@ data_queue = _DataQueue() raw_data = util.chunkbuffer(data_queue) - # XXX we will drop this extra filechunkiter layer soon - part_content = util.filechunkiter(fp) w = threading.Thread( target=data_queue.fill_from, - args=(part_content,), + args=(fp,), ) workers.append(w) w.start()