##// 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 972 if 'rev' in opts:
973 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 981 if opts.get('all'):
976 982 base = ['null']
977 983 else:
@@ -998,12 +1004,6 b' def bundle(ui, repo, fname, dest=None, *'
998 1004 scmutil.nochangesfound(ui, outgoing and outgoing.excluded)
999 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 1007 changegroup.writebundle(cg, fname, bundletype)
1008 1008
1009 1009 @command('cat',
@@ -95,7 +95,6 b' test invalid bundle type'
95 95
96 96 $ cd t1
97 97 $ hg bundle -a -t garbage ../bgarbage
98 1 changesets found
99 98 abort: unknown bundle type specified with --type
100 99 [255]
101 100 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now