Mercurial > hg
comparison mercurial/commands.py @ 24686:e0e28e910fa3
bundle2: rename format, parts and config to final names
It is finally time to freeze the bundle2 format! To do so we:
- rename HG2Y to HG20,
- drop "b2x:" prefix from all part names,
- rename capability to "bundle2-exp" to "bundle2"
- rename the hook flag from 'bundle2-exp' to 'bundle2'
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 09 Apr 2015 16:25:48 -0400 |
parents | 7d01371e6358 |
children | a85c4ed1132f |
comparison
equal
deleted
inserted
replaced
24685:b3d78d82d84c | 24686:e0e28e910fa3 |
---|---|
1219 | 1219 |
1220 bundletype = opts.get('type', 'bzip2').lower() | 1220 bundletype = opts.get('type', 'bzip2').lower() |
1221 btypes = {'none': 'HG10UN', | 1221 btypes = {'none': 'HG10UN', |
1222 'bzip2': 'HG10BZ', | 1222 'bzip2': 'HG10BZ', |
1223 'gzip': 'HG10GZ', | 1223 'gzip': 'HG10GZ', |
1224 'bundle2': 'HG2Y'} | 1224 'bundle2': 'HG20'} |
1225 bundletype = btypes.get(bundletype) | 1225 bundletype = btypes.get(bundletype) |
1226 if bundletype not in changegroup.bundletypes: | 1226 if bundletype not in changegroup.bundletypes: |
1227 raise util.Abort(_('unknown bundle type specified with --type')) | 1227 raise util.Abort(_('unknown bundle type specified with --type')) |
1228 | 1228 |
1229 if opts.get('all'): | 1229 if opts.get('all'): |
1916 if not isinstance(gen, bundle2.unbundle20): | 1916 if not isinstance(gen, bundle2.unbundle20): |
1917 raise util.Abort(_('not a bundle2 file')) | 1917 raise util.Abort(_('not a bundle2 file')) |
1918 ui.write(('Stream params: %s\n' % repr(gen.params))) | 1918 ui.write(('Stream params: %s\n' % repr(gen.params))) |
1919 for part in gen.iterparts(): | 1919 for part in gen.iterparts(): |
1920 ui.write('%s -- %r\n' % (part.type, repr(part.params))) | 1920 ui.write('%s -- %r\n' % (part.type, repr(part.params))) |
1921 if part.type == 'b2x:changegroup': | 1921 if part.type == 'changegroup': |
1922 version = part.params.get('version', '01') | 1922 version = part.params.get('version', '01') |
1923 cg = changegroup.packermap[version][1](part, 'UN') | 1923 cg = changegroup.packermap[version][1](part, 'UN') |
1924 chunkdata = cg.changelogheader() | 1924 chunkdata = cg.changelogheader() |
1925 chain = None | 1925 chain = None |
1926 while True: | 1926 while True: |
2209 | 2209 |
2210 bundletype = opts.get('type', 'bzip2').lower() | 2210 bundletype = opts.get('type', 'bzip2').lower() |
2211 btypes = {'none': 'HG10UN', | 2211 btypes = {'none': 'HG10UN', |
2212 'bzip2': 'HG10BZ', | 2212 'bzip2': 'HG10BZ', |
2213 'gzip': 'HG10GZ', | 2213 'gzip': 'HG10GZ', |
2214 'bundle2': 'HG2Y'} | 2214 'bundle2': 'HG20'} |
2215 bundletype = btypes.get(bundletype) | 2215 bundletype = btypes.get(bundletype) |
2216 if bundletype not in changegroup.bundletypes: | 2216 if bundletype not in changegroup.bundletypes: |
2217 raise util.Abort(_('unknown bundle type specified with --type')) | 2217 raise util.Abort(_('unknown bundle type specified with --type')) |
2218 changegroup.writebundle(ui, bundle, bundlepath, bundletype) | 2218 changegroup.writebundle(ui, bundle, bundlepath, bundletype) |
2219 | 2219 |