equal
deleted
inserted
replaced
5314 |
5314 |
5315 with repo.lock(): |
5315 with repo.lock(): |
5316 for fname in fnames: |
5316 for fname in fnames: |
5317 f = hg.openpath(ui, fname) |
5317 f = hg.openpath(ui, fname) |
5318 gen = exchange.readbundle(ui, f, fname) |
5318 gen = exchange.readbundle(ui, f, fname) |
|
5319 if isinstance(gen, streamclone.streamcloneapplier): |
|
5320 raise error.Abort( |
|
5321 _('packed bundles cannot be applied with ' |
|
5322 '"hg unbundle"'), |
|
5323 hint=_('use "hg debugapplystreamclonebundle"')) |
5319 if isinstance(gen, bundle2.unbundle20): |
5324 if isinstance(gen, bundle2.unbundle20): |
5320 with repo.transaction('unbundle') as tr: |
5325 with repo.transaction('unbundle') as tr: |
5321 try: |
5326 try: |
5322 op = bundle2.applybundle(repo, gen, tr, |
5327 op = bundle2.applybundle(repo, gen, tr, |
5323 source='unbundle', |
5328 source='unbundle', |
5329 "wiki/BundleFeature for more " |
5334 "wiki/BundleFeature for more " |
5330 "information")) |
5335 "information")) |
5331 changes = [r.get('return', 0) |
5336 changes = [r.get('return', 0) |
5332 for r in op.records['changegroup']] |
5337 for r in op.records['changegroup']] |
5333 modheads = changegroup.combineresults(changes) |
5338 modheads = changegroup.combineresults(changes) |
5334 elif isinstance(gen, streamclone.streamcloneapplier): |
|
5335 raise error.Abort( |
|
5336 _('packed bundles cannot be applied with ' |
|
5337 '"hg unbundle"'), |
|
5338 hint=_('use "hg debugapplystreamclonebundle"')) |
|
5339 else: |
5339 else: |
5340 modheads = gen.apply(repo, 'unbundle', 'bundle:' + fname) |
5340 modheads = gen.apply(repo, 'unbundle', 'bundle:' + fname) |
5341 |
5341 |
5342 return postincoming(ui, repo, modheads, opts.get(r'update'), None, None) |
5342 return postincoming(ui, repo, modheads, opts.get(r'update'), None, None) |
5343 |
5343 |