Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 33037:d765ad56081f
bundle: make combinechangegroupresults() take a bundleoperation
Both callers have a bundleoperation. Passing it in lets us share a bit
more code.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 22 Jun 2017 14:04:13 -0700 |
parents | 52c7060b707a |
children | b82615afde65 |
comparison
equal
deleted
inserted
replaced
33036:52c7060b707a | 33037:d765ad56081f |
---|---|
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 changes = [r.get('return', 0) | 5217 modheads = bundle2.combinechangegroupresults(op) |
5218 for r in op.records['changegroup']] | |
5219 modheads = bundle2.combinechangegroupresults(changes) | |
5220 else: | 5218 else: |
5221 txnname = 'unbundle\n%s' % util.hidepassword(url) | 5219 txnname = 'unbundle\n%s' % util.hidepassword(url) |
5222 with repo.transaction(txnname) as tr: | 5220 with repo.transaction(txnname) as tr: |
5223 modheads, addednodes = gen.apply(repo, tr, 'unbundle', url) | 5221 modheads, addednodes = gen.apply(repo, tr, 'unbundle', url) |
5224 | 5222 |