##// END OF EJS Templates
commands: move bundle type validation earlier...
Bryan O'Sullivan -
r16427:d54d4de5 default
parent child Browse files
Show More
@@ -972,6 +972,12 b' def bundle(ui, repo, fname, dest=None, *'
972 if 'rev' in opts:
972 if 'rev' in opts:
973 revs = scmutil.revrange(repo, opts['rev'])
973 revs = scmutil.revrange(repo, opts['rev'])
974
974
975 bundletype = opts.get('type', 'bzip2').lower()
976 btypes = {'none': 'HG10UN', 'bzip2': 'HG10BZ', 'gzip': 'HG10GZ'}
977 bundletype = btypes.get(bundletype)
978 if bundletype not in changegroup.bundletypes:
979 raise util.Abort(_('unknown bundle type specified with --type'))
980
975 if opts.get('all'):
981 if opts.get('all'):
976 base = ['null']
982 base = ['null']
977 else:
983 else:
@@ -998,12 +1004,6 b' def bundle(ui, repo, fname, dest=None, *'
998 scmutil.nochangesfound(ui, outgoing and outgoing.excluded)
1004 scmutil.nochangesfound(ui, outgoing and outgoing.excluded)
999 return 1
1005 return 1
1000
1006
1001 bundletype = opts.get('type', 'bzip2').lower()
1002 btypes = {'none': 'HG10UN', 'bzip2': 'HG10BZ', 'gzip': 'HG10GZ'}
1003 bundletype = btypes.get(bundletype)
1004 if bundletype not in changegroup.bundletypes:
1005 raise util.Abort(_('unknown bundle type specified with --type'))
1006
1007 changegroup.writebundle(cg, fname, bundletype)
1007 changegroup.writebundle(cg, fname, bundletype)
1008
1008
1009 @command('cat',
1009 @command('cat',
@@ -95,7 +95,6 b' test invalid bundle type'
95
95
96 $ cd t1
96 $ cd t1
97 $ hg bundle -a -t garbage ../bgarbage
97 $ hg bundle -a -t garbage ../bgarbage
98 1 changesets found
99 abort: unknown bundle type specified with --type
98 abort: unknown bundle type specified with --type
100 [255]
99 [255]
101 $ cd ..
100 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now