Mercurial > hg
comparison mercurial/commands.py @ 31831:1da9b2a4cbb8
bundle: allow bundle command to use changegroup3 in tests
Since bundle2 writes changegroup version, we can just reuse the bundle2
format for changegroup3.
This won't enable the bundle command to write changegroup3 in the wild,
since exchange.parsebundlespec only returns changegroup2. It unlocks tests
to override exchange.parsebundlespec and get "hg bundle" write changegroup3.
author | Jun Wu <quark@fb.com> |
---|---|
date | Thu, 06 Apr 2017 17:01:58 -0700 |
parents | 9fce17c4a7b3 |
children | 86246530b8d2 |
comparison
equal
deleted
inserted
replaced
31830:d34316ae5c58 | 31831:1da9b2a4cbb8 |
---|---|
1375 if cgversion == '01': #bundle1 | 1375 if cgversion == '01': #bundle1 |
1376 if bcompression is None: | 1376 if bcompression is None: |
1377 bcompression = 'UN' | 1377 bcompression = 'UN' |
1378 bversion = 'HG10' + bcompression | 1378 bversion = 'HG10' + bcompression |
1379 bcompression = None | 1379 bcompression = None |
1380 elif cgversion in ('02', '03'): | |
1381 bversion = 'HG20' | |
1380 else: | 1382 else: |
1381 assert cgversion == '02' | 1383 raise error.ProgrammingError( |
1382 bversion = 'HG20' | 1384 'bundle: unexpected changegroup version %s' % cgversion) |
1383 | 1385 |
1384 # TODO compression options should be derived from bundlespec parsing. | 1386 # TODO compression options should be derived from bundlespec parsing. |
1385 # This is a temporary hack to allow adjusting bundle compression | 1387 # This is a temporary hack to allow adjusting bundle compression |
1386 # level without a) formalizing the bundlespec changes to declare it | 1388 # level without a) formalizing the bundlespec changes to declare it |
1387 # b) introducing a command flag. | 1389 # b) introducing a command flag. |