comparison mercurial/commands.py @ 26639:92d67e5729b9

exchange: move bundle specification parsing from cmdutil Clone bundles require a well-defined string to specify the type of bundle that is listed so clients can filter compatible file types. The `hg bundle` command and cmdutil.parsebundletype() already establish the beginnings of a bundle specification format. As part of formalizing this format specification so it can be used by clone bundles, we move the specification parsing bits verbatim to exchange.py, which is a more suitable place than cmdutil.py. A subsequent patch will refactor this code to make it more appropriate as a general API.
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 13 Oct 2015 11:43:21 -0700
parents ae5f7be2b4ab
children b13fdcc4e700
comparison
equal deleted inserted replaced
26638:7afaf2566e25 26639:92d67e5729b9
1240 revs = None 1240 revs = None
1241 if 'rev' in opts: 1241 if 'rev' in opts:
1242 revs = scmutil.revrange(repo, opts['rev']) 1242 revs = scmutil.revrange(repo, opts['rev'])
1243 1243
1244 bundletype = opts.get('type', 'bzip2').lower() 1244 bundletype = opts.get('type', 'bzip2').lower()
1245 cgversion, bcompression = cmdutil.parsebundletype(repo, bundletype) 1245 cgversion, bcompression = exchange.parsebundlespec(repo, bundletype)
1246 1246
1247 if opts.get('all'): 1247 if opts.get('all'):
1248 base = ['null'] 1248 base = ['null']
1249 else: 1249 else:
1250 base = scmutil.revrange(repo, opts.get('base')) 1250 base = scmutil.revrange(repo, opts.get('base'))