Mercurial > hg
comparison mercurial/exchange.py @ 35784:08cc94dd3d3c
exchange: make stream bundle part deterministic
repo.requirements is a set. We need to sort it so the part
content is deterministic.
Differential Revision: https://phab.mercurial-scm.org/D1924
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 20 Jan 2018 15:26:31 -0800 |
parents | c97639ad6874 |
children | ba15580e53d5 |
comparison
equal
deleted
inserted
replaced
35783:c97639ad6874 | 35784:08cc94dd3d3c |
---|---|
1765 def _getbundlestream(bundler, repo, source, bundlecaps=None, | 1765 def _getbundlestream(bundler, repo, source, bundlecaps=None, |
1766 b2caps=None, heads=None, common=None, **kwargs): | 1766 b2caps=None, heads=None, common=None, **kwargs): |
1767 if not kwargs.get('stream', False): | 1767 if not kwargs.get('stream', False): |
1768 return | 1768 return |
1769 filecount, bytecount, it = streamclone.generatev2(repo) | 1769 filecount, bytecount, it = streamclone.generatev2(repo) |
1770 requirements = ' '.join(repo.requirements) | 1770 requirements = ' '.join(sorted(repo.requirements)) |
1771 part = bundler.newpart('stream', data=it) | 1771 part = bundler.newpart('stream', data=it) |
1772 part.addparam('bytecount', '%d' % bytecount, mandatory=True) | 1772 part.addparam('bytecount', '%d' % bytecount, mandatory=True) |
1773 part.addparam('filecount', '%d' % filecount, mandatory=True) | 1773 part.addparam('filecount', '%d' % filecount, mandatory=True) |
1774 part.addparam('requirements', requirements, mandatory=True) | 1774 part.addparam('requirements', requirements, mandatory=True) |
1775 part.addparam('version', 'v2', mandatory=True) | 1775 part.addparam('version', 'v2', mandatory=True) |