Skip to content
Snippets Groups Projects
Commit dda41da0 authored by Pierre-Yves David's avatar Pierre-Yves David
Browse files

bundle2: lazily generate the changegroup part in exchange.getbundle

Now that we have lazy generation of parts, let's use it.
parent c93bb6a0
No related merge requests found
......@@ -601,9 +601,11 @@
# very crude first implementation,
# the bundle API will change and the generation will be done lazily.
bundler = bundle2.bundle20(repo.ui)
tempname = changegroup.writebundle(cg, None, 'HG10UN')
data = open(tempname).read()
part = bundle2.part('changegroup', data=data)
def cgchunks(cg=cg):
yield 'HG10UN'
for c in cg.getchunks():
yield c
part = bundle2.part('changegroup', data=cgchunks())
bundler.addpart(part)
temp = cStringIO.StringIO()
for c in bundler.getchunks():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment