comparison mercurial/debugcommands.py @ 50964:7825175d5ad5

debuggetbundle: migrate `opts` to native kwargs
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 21 Aug 2023 17:15:30 -0400
parents 45381a1dd367
children 1cfc49e342c3
comparison
equal deleted inserted replaced
50963:45381a1dd367 50964:7825175d5ad5
1818 """retrieves a bundle from a repo 1818 """retrieves a bundle from a repo
1819 1819
1820 Every ID must be a full-length hex node id string. Saves the bundle to the 1820 Every ID must be a full-length hex node id string. Saves the bundle to the
1821 given file. 1821 given file.
1822 """ 1822 """
1823 opts = pycompat.byteskwargs(opts) 1823 repo = hg.peer(ui, pycompat.byteskwargs(opts), repopath)
1824 repo = hg.peer(ui, opts, repopath)
1825 if not repo.capable(b'getbundle'): 1824 if not repo.capable(b'getbundle'):
1826 raise error.Abort(b"getbundle() not supported by target repository") 1825 raise error.Abort(b"getbundle() not supported by target repository")
1827 args = {} 1826 args = {}
1828 if common: 1827 if common:
1829 args['common'] = [bin(s) for s in common] 1828 args['common'] = [bin(s) for s in common]
1831 args['heads'] = [bin(s) for s in head] 1830 args['heads'] = [bin(s) for s in head]
1832 # TODO: get desired bundlecaps from command line. 1831 # TODO: get desired bundlecaps from command line.
1833 args['bundlecaps'] = None 1832 args['bundlecaps'] = None
1834 bundle = repo.getbundle(b'debug', **args) 1833 bundle = repo.getbundle(b'debug', **args)
1835 1834
1836 bundletype = opts.get(b'type', b'bzip2').lower() 1835 bundletype = opts.get('type', b'bzip2').lower()
1837 btypes = { 1836 btypes = {
1838 b'none': b'HG10UN', 1837 b'none': b'HG10UN',
1839 b'bzip2': b'HG10BZ', 1838 b'bzip2': b'HG10BZ',
1840 b'gzip': b'HG10GZ', 1839 b'gzip': b'HG10GZ',
1841 b'bundle2': b'HG20', 1840 b'bundle2': b'HG20',