##// END OF EJS Templates
bundle: make combinechangegroupresults() take a bundleoperation...
Martin von Zweigbergk -
r33037:d765ad56 default
parent child Browse files
Show More
@@ -1478,8 +1478,10 b' def writebundle(ui, cg, filename, bundle'
1478 # in case of sshrepo because we don't know the end of the stream
1478 # in case of sshrepo because we don't know the end of the stream
1479 return changegroup.writechunks(ui, chunkiter, filename, vfs=vfs)
1479 return changegroup.writechunks(ui, chunkiter, filename, vfs=vfs)
1480
1480
1481 def combinechangegroupresults(results):
1481 def combinechangegroupresults(op):
1482 """logic to combine 0 or more addchangegroup results into one"""
1482 """logic to combine 0 or more addchangegroup results into one"""
1483 results = [r.get('return', 0)
1484 for r in op.records['changegroup']]
1483 changedheads = 0
1485 changedheads = 0
1484 result = 1
1486 result = 1
1485 for ret in results:
1487 for ret in results:
@@ -5214,9 +5214,7 b' def unbundle(ui, repo, fname1, *fnames, '
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:
@@ -1397,8 +1397,7 b' def _pullbundle2(pullop):'
1397 raise error.Abort(_('missing support for %s') % exc)
1397 raise error.Abort(_('missing support for %s') % exc)
1398
1398
1399 if pullop.fetch:
1399 if pullop.fetch:
1400 results = [cg['return'] for cg in op.records['changegroup']]
1400 pullop.cgresult = bundle2.combinechangegroupresults(op)
1401 pullop.cgresult = bundle2.combinechangegroupresults(results)
1402
1401
1403 # processing phases change
1402 # processing phases change
1404 for namespace, value in op.records['listkeys']:
1403 for namespace, value in op.records['listkeys']:
General Comments 0
You need to be logged in to leave comments. Login now