Show More
@@ -37,12 +37,6 b' from . import (' | |||
|
37 | 37 | urlerr = util.urlerr |
|
38 | 38 | urlreq = util.urlreq |
|
39 | 39 | |
|
40 | # Maps bundle compression human names to internal representation. | |
|
41 | _bundlespeccompressions = {'none': None, | |
|
42 | 'bzip2': 'BZ', | |
|
43 | 'gzip': 'GZ', | |
|
44 | } | |
|
45 | ||
|
46 | 40 | # Maps bundle version human names to changegroup versions. |
|
47 | 41 | _bundlespeccgversions = {'v1': '01', |
|
48 | 42 | 'v2': '02', |
@@ -114,7 +108,7 b' def parsebundlespec(repo, spec, strict=T' | |||
|
114 | 108 | if '-' in spec: |
|
115 | 109 | compression, version = spec.split('-', 1) |
|
116 | 110 | |
|
117 |
if compression not in |
|
|
111 | if compression not in util.compengines.supportedbundlenames: | |
|
118 | 112 | raise error.UnsupportedBundleSpecification( |
|
119 | 113 | _('%s compression is not supported') % compression) |
|
120 | 114 | |
@@ -130,7 +124,7 b' def parsebundlespec(repo, spec, strict=T' | |||
|
130 | 124 | |
|
131 | 125 | spec, params = parseparams(spec) |
|
132 | 126 | |
|
133 | if spec in _bundlespeccompressions: | |
|
127 | if spec in util.compengines.supportedbundlenames: | |
|
134 | 128 | compression = spec |
|
135 | 129 | version = 'v1' |
|
136 | 130 | if 'generaldelta' in repo.requirements: |
@@ -157,7 +151,8 b' def parsebundlespec(repo, spec, strict=T' | |||
|
157 | 151 | ', '.join(sorted(missingreqs))) |
|
158 | 152 | |
|
159 | 153 | if not externalnames: |
|
160 | compression = _bundlespeccompressions[compression] | |
|
154 | engine = util.compengines.forbundlename(compression) | |
|
155 | compression = engine.bundletype()[1] | |
|
161 | 156 | version = _bundlespeccgversions[version] |
|
162 | 157 | return compression, version, params |
|
163 | 158 | |
@@ -196,10 +191,10 b' def getbundlespec(ui, fh):' | |||
|
196 | 191 | restored. |
|
197 | 192 | """ |
|
198 | 193 | def speccompression(alg): |
|
199 | for k, v in _bundlespeccompressions.items(): | |
|
200 | if v == alg: | |
|
201 | return k | |
|
202 | return None | |
|
194 | try: | |
|
195 | return util.compengines.forbundletype(alg).bundletype()[0] | |
|
196 | except KeyError: | |
|
197 | return None | |
|
203 | 198 | |
|
204 | 199 | b = readbundle(ui, fh, None) |
|
205 | 200 | if isinstance(b, changegroup.cg1unpacker): |
General Comments 0
You need to be logged in to leave comments.
Login now