##// END OF EJS Templates
bundle2: record changegroup data in 'op.records' (API)...
Martin von Zweigbergk -
r33030:3e102a8d default
parent child Browse files
Show More
@@ -1492,9 +1492,12 b' def handlechangegroup(op, inpart):'
1492 op.repo.requirements.add('treemanifest')
1492 op.repo.requirements.add('treemanifest')
1493 op.repo._applyopenerreqs()
1493 op.repo._applyopenerreqs()
1494 op.repo._writerequirements()
1494 op.repo._writerequirements()
1495 ret = cg.apply(op.repo, tr, 'bundle2', 'bundle2',
1495 ret, addednodes = cg.apply(op.repo, tr, 'bundle2', 'bundle2',
1496 expectedtotal=nbchangesets)
1496 expectedtotal=nbchangesets)
1497 op.records.add('changegroup', {'return': ret})
1497 op.records.add('changegroup', {
1498 'return': ret,
1499 'addednodes': addednodes,
1500 })
1498 if op.reply is not None:
1501 if op.reply is not None:
1499 # This is definitely not the final form of this
1502 # This is definitely not the final form of this
1500 # return. But one need to start somewhere.
1503 # return. But one need to start somewhere.
@@ -1557,8 +1560,11 b' def handleremotechangegroup(op, inpart):'
1557 if not isinstance(cg, changegroup.cg1unpacker):
1560 if not isinstance(cg, changegroup.cg1unpacker):
1558 raise error.Abort(_('%s: not a bundle version 1.0') %
1561 raise error.Abort(_('%s: not a bundle version 1.0') %
1559 util.hidepassword(raw_url))
1562 util.hidepassword(raw_url))
1560 ret = cg.apply(op.repo, tr, 'bundle2', 'bundle2')
1563 ret, addednodes = cg.apply(op.repo, tr, 'bundle2', 'bundle2')
1561 op.records.add('changegroup', {'return': ret})
1564 op.records.add('changegroup', {
1565 'return': ret,
1566 'addednodes': addednodes,
1567 })
1562 if op.reply is not None:
1568 if op.reply is not None:
1563 # This is definitely not the final form of this
1569 # This is definitely not the final form of this
1564 # return. But one need to start somewhere.
1570 # return. But one need to start somewhere.
@@ -426,9 +426,10 b' class cg1unpacker(object):'
426 repo.ui.flush()
426 repo.ui.flush()
427 # never return 0 here:
427 # never return 0 here:
428 if deltaheads < 0:
428 if deltaheads < 0:
429 return deltaheads - 1
429 ret = deltaheads - 1
430 else:
430 else:
431 return deltaheads + 1
431 ret = deltaheads + 1
432 return ret, added
432
433
433 class cg2unpacker(cg1unpacker):
434 class cg2unpacker(cg1unpacker):
434 """Unpacker for cg2 streams.
435 """Unpacker for cg2 streams.
@@ -5218,7 +5218,7 b' def unbundle(ui, repo, fname1, *fnames, '
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 = gen.apply(repo, tr, 'unbundle', url)
5221 modheads, addednodes = gen.apply(repo, tr, 'unbundle', url)
5222
5222
5223 return postincoming(ui, repo, modheads, opts.get(r'update'), None, None)
5223 return postincoming(ui, repo, modheads, opts.get(r'update'), None, None)
5224
5224
@@ -1449,7 +1449,8 b' def _pullchangeset(pullop):'
1449 "changegroupsubset."))
1449 "changegroupsubset."))
1450 else:
1450 else:
1451 cg = pullop.remote.changegroupsubset(pullop.fetch, pullop.heads, 'pull')
1451 cg = pullop.remote.changegroupsubset(pullop.fetch, pullop.heads, 'pull')
1452 pullop.cgresult = cg.apply(pullop.repo, tr, 'pull', pullop.remote.url())
1452 pullop.cgresult, addednodes = cg.apply(pullop.repo, tr, 'pull',
1453 pullop.remote.url())
1453
1454
1454 def _pullphase(pullop):
1455 def _pullphase(pullop):
1455 # Get remote phases data from remote
1456 # Get remote phases data from remote
@@ -1737,7 +1738,7 b' def unbundle(repo, cg, heads, source, ur'
1737 # legacy case: bundle1 (changegroup 01)
1738 # legacy case: bundle1 (changegroup 01)
1738 txnname = "\n".join([source, util.hidepassword(url)])
1739 txnname = "\n".join([source, util.hidepassword(url)])
1739 with repo.lock(), repo.transaction(txnname) as tr:
1740 with repo.lock(), repo.transaction(txnname) as tr:
1740 r = cg.apply(repo, tr, source, url)
1741 r, addednodes = cg.apply(repo, tr, source, url)
1741 else:
1742 else:
1742 r = None
1743 r = None
1743 try:
1744 try:
General Comments 0
You need to be logged in to leave comments. Login now