comparison mercurial/commands.py @ 27911:645e78845383 stable

bundle: exit early when there are no commits to bundle Previously, if you passed a revset that resolved to no nodes, it would get interpreted by the changegroup discovery logic as 'bundle all my heads', which is not what the user asked. Let's exit early when we notice this case. It could be argued that the changeset discovery logic should be smarter and only assume 'all heads' if the incoming heads parameter is None, but that's a much riskier change.
author Durham Goode <durham@fb.com>
date Tue, 19 Jan 2016 13:43:50 -0800
parents 78b9fdb844c1
children ae4e6b80f084
comparison
equal deleted inserted replaced
27910:d2c5ad3deccb 27911:645e78845383
1326 1326
1327 Returns 0 on success, 1 if no changes found. 1327 Returns 0 on success, 1 if no changes found.
1328 """ 1328 """
1329 revs = None 1329 revs = None
1330 if 'rev' in opts: 1330 if 'rev' in opts:
1331 revs = scmutil.revrange(repo, opts['rev']) 1331 revstrings = opts['rev']
1332 revs = scmutil.revrange(repo, revstrings)
1333 if revstrings and not revs:
1334 raise error.Abort(_('no commits to bundle'))
1332 1335
1333 bundletype = opts.get('type', 'bzip2').lower() 1336 bundletype = opts.get('type', 'bzip2').lower()
1334 try: 1337 try:
1335 bcompression, cgversion, params = exchange.parsebundlespec( 1338 bcompression, cgversion, params = exchange.parsebundlespec(
1336 repo, bundletype, strict=False) 1339 repo, bundletype, strict=False)