Mercurial > hg
changeset 21003:0f7e01e0c06f
bundle2: use chunkbuffer for exchange.getbundle
We can use `util.chunkbuffer` instead.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Sat, 12 Apr 2014 00:53:15 -0400 |
parents | dda41da069a4 |
children | 27ab4b8d2503 |
files | mercurial/exchange.py |
diffstat | 1 files changed, 1 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/exchange.py Sat Apr 12 14:56:55 2014 -0400 +++ b/mercurial/exchange.py Sat Apr 12 00:53:15 2014 -0400 @@ -7,7 +7,6 @@ from i18n import _ from node import hex, nullid -import cStringIO import errno import util, scmutil, changegroup, base85 import discovery, phases, obsolete, bookmarks, bundle2 @@ -607,11 +606,7 @@ yield c part = bundle2.part('changegroup', data=cgchunks()) bundler.addpart(part) - temp = cStringIO.StringIO() - for c in bundler.getchunks(): - temp.write(c) - temp.seek(0) - return bundle2.unbundle20(repo.ui, temp) + return bundle2.unbundle20(repo.ui, util.chunkbuffer(bundler.getchunks())) class PushRaced(RuntimeError): """An exception raised during unbunding that indicate a push race"""