changeset 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 d34316ae5c58
children 77f746e5383a
files mercurial/commands.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Wed Apr 05 23:44:22 2017 -0400
+++ b/mercurial/commands.py	Thu Apr 06 17:01:58 2017 -0700
@@ -1377,9 +1377,11 @@
             bcompression = 'UN'
         bversion = 'HG10' + bcompression
         bcompression = None
+    elif cgversion in ('02', '03'):
+        bversion = 'HG20'
     else:
-        assert cgversion == '02'
-        bversion = 'HG20'
+        raise error.ProgrammingError(
+            'bundle: unexpected changegroup version %s' % cgversion)
 
     # TODO compression options should be derived from bundlespec parsing.
     # This is a temporary hack to allow adjusting bundle compression