comparison mercurial/exchange.py @ 21071:19b9f23a8c6f

bundle2: return a bundle20 object from exchanges.unbundle When a bundle2 is pushed we return a bundle instead of an integer. We use to return a binary stream. We now return a `bundle20` bundler to make the life of wireprotocol implementation simpler.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 15 Apr 2014 16:49:30 -0400
parents 408877d491fb
children 1ff06386217f
comparison
equal deleted inserted replaced
21070:408877d491fb 21071:19b9f23a8c6f
692 try: 692 try:
693 check_heads(repo, heads, 'uploading changes') 693 check_heads(repo, heads, 'uploading changes')
694 # push can proceed 694 # push can proceed
695 if util.safehasattr(cg, 'params'): 695 if util.safehasattr(cg, 'params'):
696 tr = repo.transaction('unbundle') 696 tr = repo.transaction('unbundle')
697 ret = bundle2.processbundle(repo, cg, lambda: tr) 697 r = bundle2.processbundle(repo, cg, lambda: tr).reply
698 tr.close() 698 tr.close()
699 stream = util.chunkbuffer(ret.reply.getchunks())
700 r = bundle2.unbundle20(repo.ui, stream)
701 else: 699 else:
702 r = changegroup.addchangegroup(repo, cg, source, url) 700 r = changegroup.addchangegroup(repo, cg, source, url)
703 finally: 701 finally:
704 if tr is not None: 702 if tr is not None:
705 tr.release() 703 tr.release()