Mercurial > hg-stable
changeset 21020:5041163ee382
bundle2: directly feed part to readbundle
Now that part payload can be read like a stream, we can directly use it to feed
the unbundle10 process.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Sat, 12 Apr 2014 00:38:15 -0400 |
parents | 3dc09f831a2e |
children | 422981492ace |
files | mercurial/bundle2.py |
diffstat | 1 files changed, 1 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/bundle2.py Fri Apr 11 16:05:22 2014 -0400 +++ b/mercurial/bundle2.py Sat Apr 12 00:38:15 2014 -0400 @@ -144,7 +144,6 @@ import struct import urllib import string -import StringIO import changegroup from i18n import _ @@ -640,9 +639,7 @@ # we need to make sure we trigger the creation of a transaction object used # for the whole processing scope. op.gettransaction() - data = StringIO.StringIO(inpart.read()) - data.seek(0) - cg = changegroup.readbundle(data, 'bundle2part') + cg = changegroup.readbundle(inpart, 'bundle2part') ret = changegroup.addchangegroup(op.repo, cg, 'bundle2', 'bundle2') op.records.add('changegroup', {'return': ret}) if op.reply is not None: