comparison mercurial/commands.py @ 33040:2baef42a2881

bundle: make applybundle1() return a bundleoperation See previous commit for motivation. It already lets us share a little bit more code in commands.py.
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 21 Jun 2017 21:08:48 -0700
parents b82615afde65
children e425f5aabe70
comparison
equal deleted inserted replaced
33039:b82615afde65 33040:2baef42a2881
5212 raise error.Abort( 5212 raise error.Abort(
5213 _('%s: unknown bundle feature, %s') % (fname, exc), 5213 _('%s: unknown bundle feature, %s') % (fname, exc),
5214 hint=_("see https://mercurial-scm.org/" 5214 hint=_("see https://mercurial-scm.org/"
5215 "wiki/BundleFeature for more " 5215 "wiki/BundleFeature for more "
5216 "information")) 5216 "information"))
5217 modheads = bundle2.combinechangegroupresults(op)
5218 else: 5217 else:
5219 txnname = 'unbundle\n%s' % util.hidepassword(url) 5218 txnname = 'unbundle\n%s' % util.hidepassword(url)
5220 with repo.transaction(txnname) as tr: 5219 with repo.transaction(txnname) as tr:
5221 modheads = bundle2.applybundle1(repo, gen, tr, 5220 op = bundle2.applybundle1(repo, gen, tr, source='unbundle',
5222 source='unbundle', 5221 url=url)
5223 url=url) 5222 modheads = bundle2.combinechangegroupresults(op)
5224 5223
5225 return postincoming(ui, repo, modheads, opts.get(r'update'), None, None) 5224 return postincoming(ui, repo, modheads, opts.get(r'update'), None, None)
5226 5225
5227 @command('^update|up|checkout|co', 5226 @command('^update|up|checkout|co',
5228 [('C', 'clean', None, _('discard uncommitted changes (no backup)')), 5227 [('C', 'clean', None, _('discard uncommitted changes (no backup)')),