equal
deleted
inserted
replaced
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', |