Show More
@@ -161,6 +161,8 b' from i18n import _' | |||
|
161 | 161 | _fpayloadsize = '>I' |
|
162 | 162 | _fpartparamcount = '>BB' |
|
163 | 163 | |
|
164 | preferedchunksize = 4096 | |
|
165 | ||
|
164 | 166 | def _makefpartparamsizes(nbparams): |
|
165 | 167 | """return a struct format to read part parameter sizes |
|
166 | 168 | |
@@ -561,7 +563,13 b' class part(object):' | |||
|
561 | 563 | Exists to handle the different methods to provide data to a part.""" |
|
562 | 564 | # we only support fixed size data now. |
|
563 | 565 | # This will be improved in the future. |
|
564 |
if |
|
|
566 | if util.safehasattr(self.data, 'next'): | |
|
567 | buff = util.chunkbuffer(self.data) | |
|
568 | chunk = buff.read(preferedchunksize) | |
|
569 | while chunk: | |
|
570 | yield chunk | |
|
571 | chunk = buff.read(preferedchunksize) | |
|
572 | elif len(self.data): | |
|
565 | 573 | yield self.data |
|
566 | 574 | |
|
567 | 575 | @parthandler('changegroup') |
@@ -66,11 +66,11 b' Create an extension to test bundle2 API' | |||
|
66 | 66 | > headcommon = [c.node() for c in repo.set('parents(%ld) - %ld', revs, revs)] |
|
67 | 67 | > outgoing = discovery.outgoing(repo.changelog, headcommon, headmissing) |
|
68 | 68 | > cg = changegroup.getlocalbundle(repo, 'test:bundle2', outgoing, None) |
|
69 | > assert cg is not None | |
|
70 | > # make me lazy later | |
|
71 | > tempname = changegroup.writebundle(cg, None, 'HG10UN') | |
|
72 | > data = open(tempname).read() | |
|
73 |
> part = bundle2.part('changegroup', data= |
|
|
69 | > def cgchunks(cg=cg): | |
|
70 | > yield 'HG10UN' | |
|
71 | > for c in cg.getchunks(): | |
|
72 | > yield c | |
|
73 | > part = bundle2.part('changegroup', data=cgchunks()) | |
|
74 | 74 | > bundler.addpart(part) |
|
75 | 75 | > |
|
76 | 76 | > if opts['parts']: |
@@ -585,6 +585,10 b' Support for changegroup' | |||
|
585 | 585 | 9520eea781bcca16c1e15acc0ba14335a0e8e5ba |
|
586 | 586 | eea13746799a9e0bfd88f29d3c2e9dc9389f524f |
|
587 | 587 | 02de42196ebee42ef284b6780a87cdc96e8eaab6 |
|
588 | start emission of HG20 stream | |
|
589 | bundle parameter: | |
|
590 | start of parts | |
|
591 | bundle part: "changegroup" | |
|
588 | 592 | bundling: 1/4 changesets (25.00%) |
|
589 | 593 | bundling: 2/4 changesets (50.00%) |
|
590 | 594 | bundling: 3/4 changesets (75.00%) |
@@ -596,10 +600,6 b' Support for changegroup' | |||
|
596 | 600 | bundling: D 1/3 files (33.33%) |
|
597 | 601 | bundling: E 2/3 files (66.67%) |
|
598 | 602 | bundling: H 3/3 files (100.00%) |
|
599 | start emission of HG20 stream | |
|
600 | bundle parameter: | |
|
601 | start of parts | |
|
602 | bundle part: "changegroup" | |
|
603 | 603 | end of bundle |
|
604 | 604 | |
|
605 | 605 | $ cat ../rev.hg2 |
General Comments 0
You need to be logged in to leave comments.
Login now