Show More
@@ -546,8 +546,12 b' def perfbundleread(ui, repo, bundlepath,' | |||
|
546 | 546 | for part in bundle.iterparts(): |
|
547 | 547 | pass |
|
548 | 548 | |
|
549 | def iterpartsseekable(bundle): | |
|
550 | for part in bundle.iterparts(seekable=True): | |
|
551 | pass | |
|
552 | ||
|
549 | 553 | def seek(bundle): |
|
550 | for part in bundle.iterparts(): | |
|
554 | for part in bundle.iterparts(seekable=True): | |
|
551 | 555 | part.seek(0, os.SEEK_END) |
|
552 | 556 | |
|
553 | 557 | def makepartreadnbytes(size): |
@@ -583,6 +587,7 b' def perfbundleread(ui, repo, bundlepath,' | |||
|
583 | 587 | benches.extend([ |
|
584 | 588 | (makebench(forwardchunks), 'bundle2 forwardchunks()'), |
|
585 | 589 | (makebench(iterparts), 'bundle2 iterparts()'), |
|
590 | (makebench(iterpartsseekable), 'bundle2 iterparts() seekable'), | |
|
586 | 591 | (makebench(seek), 'bundle2 part seek()'), |
|
587 | 592 | (makepartreadnbytes(8192), 'bundle2 part read(8k)'), |
|
588 | 593 | (makepartreadnbytes(16384), 'bundle2 part read(16k)'), |
@@ -845,8 +845,9 b' class unbundle20(unpackermixin):' | |||
|
845 | 845 | yield self._readexact(size) |
|
846 | 846 | |
|
847 | 847 | |
|
848 | def iterparts(self): | |
|
848 | def iterparts(self, seekable=False): | |
|
849 | 849 | """yield all parts contained in the stream""" |
|
850 | cls = seekableunbundlepart if seekable else unbundlepart | |
|
850 | 851 | # make sure param have been loaded |
|
851 | 852 | self.params |
|
852 | 853 | # From there, payload need to be decompressed |
@@ -854,7 +855,7 b' class unbundle20(unpackermixin):' | |||
|
854 | 855 | indebug(self.ui, 'start extraction of bundle2 parts') |
|
855 | 856 | headerblock = self._readpartheader() |
|
856 | 857 | while headerblock is not None: |
|
857 |
part = s |
|
|
858 | part = cls(self.ui, headerblock, self._fp) | |
|
858 | 859 | yield part |
|
859 | 860 | # Ensure part is fully consumed so we can start reading the next |
|
860 | 861 | # part. |
@@ -1154,7 +1155,7 b' class interrupthandler(unpackermixin):' | |||
|
1154 | 1155 | if headerblock is None: |
|
1155 | 1156 | indebug(self.ui, 'no part found during interruption.') |
|
1156 | 1157 | return |
|
1157 |
part = |
|
|
1158 | part = unbundlepart(self.ui, headerblock, self._fp) | |
|
1158 | 1159 | op = interruptoperation(self.ui) |
|
1159 | 1160 | hardabort = False |
|
1160 | 1161 | try: |
@@ -289,7 +289,7 b' class bundlerepository(localrepo.localre' | |||
|
289 | 289 | self._cgunpacker = None |
|
290 | 290 | |
|
291 | 291 | cgpart = None |
|
292 | for part in bundle.iterparts(): | |
|
292 | for part in bundle.iterparts(seekable=True): | |
|
293 | 293 | if part.type == 'changegroup': |
|
294 | 294 | if cgpart: |
|
295 | 295 | raise NotImplementedError("can't process " |
General Comments 0
You need to be logged in to leave comments.
Login now