exchange: support for streaming clone bundles
Now that we have a mechanism to produce and consume streaming clone
bundles, we need to teach the human-facing bundle specification parser
and the internal bundle file header reading code to be aware of this new
format. This patch does so.
For the human-facing bundle specification, we choose the name "packed"
to describe "streaming clone bundles" because the bundle is essentially
a "pack" of raw revlog files that are "packed" together. There should
probably be a bikeshed over the name, especially since it is human
facing.
--- a/mercurial/exchange.py Sat Oct 17 11:14:52 2015 -0700
+++ b/mercurial/exchange.py Thu Oct 15 13:00:45 2015 -0700
@@ -25,6 +25,7 @@
# Maps bundle version human names to changegroup versions.
_bundlespeccgversions = {'v1': '01',
'v2': '02',
+ 'packed1': 's1',
'bundle2': '02', #legacy
}
@@ -87,7 +88,10 @@
if 'generaldelta' in repo.requirements:
version = 'v2'
elif spec in _bundlespeccgversions:
- compression = 'bzip2'
+ if spec == 'packed1':
+ compression = 'none'
+ else:
+ compression = 'bzip2'
version = spec
else:
raise error.UnsupportedBundleSpecification(
@@ -121,6 +125,8 @@
return changegroup.cg1unpacker(fh, alg)
elif version.startswith('2'):
return bundle2.getunbundler(ui, fh, magicstring=magic + version)
+ elif version == 'S1':
+ return streamclone.streamcloneapplier(fh)
else:
raise error.Abort(_('%s: unknown bundle version %s') % (fname, version))