comparison mercurial/bundle2.py @ 49336:290c29df1915

bundlespec: check the `obsolescence` value before adding the caps This does not really matters as the logic to decide wether or not adding the part is correct and elsewhere. However this seems like a good idea to align this logic witht he semantic of the option.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 18 May 2022 10:39:45 +0100
parents bde2e4ef968a
children 9be765b82a90
comparison
equal deleted inserted replaced
49335:04cdb442a892 49336:290c29df1915
1690 ) 1690 )
1691 elif not bundletype.startswith(b'HG20'): 1691 elif not bundletype.startswith(b'HG20'):
1692 raise error.ProgrammingError(b'unknown bundle type: %s' % bundletype) 1692 raise error.ProgrammingError(b'unknown bundle type: %s' % bundletype)
1693 1693
1694 caps = {} 1694 caps = {}
1695 if b'obsolescence' in opts: 1695 if opts.get(b'obsolescence', False):
1696 caps[b'obsmarkers'] = (b'V1',) 1696 caps[b'obsmarkers'] = (b'V1',)
1697 bundle = bundle20(ui, caps) 1697 bundle = bundle20(ui, caps)
1698 bundle.setcompression(compression, compopts) 1698 bundle.setcompression(compression, compopts)
1699 _addpartsfromopts(ui, repo, bundle, source, outgoing, opts) 1699 _addpartsfromopts(ui, repo, bundle, source, outgoing, opts)
1700 chunkiter = bundle.getchunks() 1700 chunkiter = bundle.getchunks()