##// END OF EJS Templates
bundlespec: make the `stream` case less special...
marmoute -
r50217:d587f09c default
parent child Browse files
Show More
@@ -56,6 +56,15 b' class bundlespec:'
56 b'tagsfnodescache': True,
56 b'tagsfnodescache': True,
57 b'revbranchcache': True,
57 b'revbranchcache': True,
58 },
58 },
59 b'streamv2': {
60 b'changegroup': False,
61 b'cg.version': b'02',
62 b'obsolescence': False,
63 b'phases': False,
64 b"streamv2": True,
65 b'tagsfnodescache': False,
66 b'revbranchcache': False,
67 },
59 b'packed1': {
68 b'packed1': {
60 b'cg.version': b's1',
69 b'cg.version': b's1',
61 },
70 },
@@ -65,14 +74,7 b' class bundlespec:'
65 }
74 }
66 _bundlespeccontentopts[b'bundle2'] = _bundlespeccontentopts[b'v2']
75 _bundlespeccontentopts[b'bundle2'] = _bundlespeccontentopts[b'v2']
67
76
68 _bundlespecvariants = {
77 _bundlespecvariants = {b"streamv2": {}}
69 b"streamv2": {
70 b"changegroup": False,
71 b"streamv2": True,
72 b"tagsfnodescache": False,
73 b"revbranchcache": False,
74 }
75 }
76
78
77 # Compression engines allowed in version 1. THIS SHOULD NEVER CHANGE.
79 # Compression engines allowed in version 1. THIS SHOULD NEVER CHANGE.
78 _bundlespecv1compengines = {b'gzip', b'bzip2', b'none'}
80 _bundlespecv1compengines = {b'gzip', b'bzip2', b'none'}
@@ -208,12 +210,21 b' def parsebundlespec(repo, spec, strict=T'
208 )
210 )
209
211
210 # Compute contentopts based on the version
212 # Compute contentopts based on the version
213 if b"stream" in params and params[b"stream"] == b"v2":
214 # That case is fishy as this mostly derails the version selection
215 # mechanism. `stream` bundles are quite specific and used differently
216 # as "normal" bundles.
217 #
218 # So we are pinning this to "v2", as this will likely be
219 # compatible forever. (see the next conditional).
220 #
221 # (we should probably define a cleaner way to do this and raise a
222 # warning when the old way is encounter)
223 version = b"streamv2"
211 contentopts = _bundlespeccontentopts.get(version, {}).copy()
224 contentopts = _bundlespeccontentopts.get(version, {}).copy()
212
225 if version == b"streamv2":
213 # Process the variants
226 # streamv2 have been reported as "v2" for a while.
214 if b"stream" in params and params[b"stream"] == b"v2":
227 version = b"v2"
215 variant = _bundlespecvariants[b"streamv2"]
216 contentopts.update(variant)
217
228
218 engine = util.compengines.forbundlename(compression)
229 engine = util.compengines.forbundlename(compression)
219 compression, wirecompression = engine.bundletype()
230 compression, wirecompression = engine.bundletype()
General Comments 0
You need to be logged in to leave comments. Login now