comparison mercurial/commands.py @ 33039:b82615afde65

bundle: add a applybundle1() method This is one step towards removing a bunch of "if isinstance(gen, unbundle20)" by treating bundle1 and bundle2 more similarly. The name may sounds ironic for a method in the bundle2 module, but I didn't think it was worth it yet to create a new 'bundle' module that depends on the 'bundle2' module. Besides, we'll inline the method again later.
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 16 Jun 2017 10:25:11 -0700
parents d765ad56081f
children 2baef42a2881
comparison
equal deleted inserted replaced
33038:f0efd2bffe1e 33039:b82615afde65
5216 "information")) 5216 "information"))
5217 modheads = bundle2.combinechangegroupresults(op) 5217 modheads = bundle2.combinechangegroupresults(op)
5218 else: 5218 else:
5219 txnname = 'unbundle\n%s' % util.hidepassword(url) 5219 txnname = 'unbundle\n%s' % util.hidepassword(url)
5220 with repo.transaction(txnname) as tr: 5220 with repo.transaction(txnname) as tr:
5221 modheads, addednodes = gen.apply(repo, tr, 'unbundle', url) 5221 modheads = bundle2.applybundle1(repo, gen, tr,
5222 source='unbundle',
5223 url=url)
5222 5224
5223 return postincoming(ui, repo, modheads, opts.get(r'update'), None, None) 5225 return postincoming(ui, repo, modheads, opts.get(r'update'), None, None)
5224 5226
5225 @command('^update|up|checkout|co', 5227 @command('^update|up|checkout|co',
5226 [('C', 'clean', None, _('discard uncommitted changes (no backup)')), 5228 [('C', 'clean', None, _('discard uncommitted changes (no backup)')),