comparison mercurial/bundle2.py @ 48653:a3cf460a6b1b

stream-clone: also filter the requirement we put in the bundle 2 We were wrongly putting irrelevant requirements in the bundle and the receiving side was getting confused, treating them as being missing while still putting them in the `requires` file. Leading do corrupted repositories. This changes fix stream-clone behavior regarding format when bundle-2 is involved, so we now also test this cases. Behavior with older version of Mercurial will be fine as they filter the requirements they get from the bundle on their side anyway. Differential Revision: https://phab.mercurial-scm.org/D12084
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 18 Jan 2022 00:19:04 +0100
parents fff5942d445f
children 6000f5b25c9b d9ed7c5e915d
comparison
equal deleted inserted replaced
48652:6fd9a17c32ab 48653:a3cf460a6b1b
1884 includeobsmarkers = True 1884 includeobsmarkers = True
1885 1885
1886 filecount, bytecount, it = streamclone.generatev2( 1886 filecount, bytecount, it = streamclone.generatev2(
1887 repo, includepats, excludepats, includeobsmarkers 1887 repo, includepats, excludepats, includeobsmarkers
1888 ) 1888 )
1889 requirements = _formatrequirementsspec(repo.requirements) 1889 requirements = streamclone.streamed_requirements(repo)
1890 requirements = _formatrequirementsspec(requirements)
1890 part = bundler.newpart(b'stream2', data=it) 1891 part = bundler.newpart(b'stream2', data=it)
1891 part.addparam(b'bytecount', b'%d' % bytecount, mandatory=True) 1892 part.addparam(b'bytecount', b'%d' % bytecount, mandatory=True)
1892 part.addparam(b'filecount', b'%d' % filecount, mandatory=True) 1893 part.addparam(b'filecount', b'%d' % filecount, mandatory=True)
1893 part.addparam(b'requirements', requirements, mandatory=True) 1894 part.addparam(b'requirements', requirements, mandatory=True)
1894 1895