Show More
@@ -852,6 +852,22 b' class unbundlepart(unpackermixin):' | |||||
852 | self.params.update(dict(self.advisoryparams)) |
|
852 | self.params.update(dict(self.advisoryparams)) | |
853 | self.mandatorykeys = frozenset(p[0] for p in mandatoryparams) |
|
853 | self.mandatorykeys = frozenset(p[0] for p in mandatoryparams) | |
854 |
|
854 | |||
|
855 | def _payloadchunks(self): | |||
|
856 | payloadsize = self._unpack(_fpayloadsize)[0] | |||
|
857 | self.ui.debug('payload chunk size: %i\n' % payloadsize) | |||
|
858 | while payloadsize: | |||
|
859 | if payloadsize == flaginterrupt: | |||
|
860 | # interruption detection, the handler will now read a | |||
|
861 | # single part and process it. | |||
|
862 | interrupthandler(self.ui, self._fp)() | |||
|
863 | elif payloadsize < 0: | |||
|
864 | msg = 'negative payload chunk size: %i' % payloadsize | |||
|
865 | raise error.BundleValueError(msg) | |||
|
866 | else: | |||
|
867 | yield self._readexact(payloadsize) | |||
|
868 | payloadsize = self._unpack(_fpayloadsize)[0] | |||
|
869 | self.ui.debug('payload chunk size: %i\n' % payloadsize) | |||
|
870 | ||||
855 | def _readheader(self): |
|
871 | def _readheader(self): | |
856 | """read the header and setup the object""" |
|
872 | """read the header and setup the object""" | |
857 | typesize = self._unpackheader(_fparttypesize)[0] |
|
873 | typesize = self._unpackheader(_fparttypesize)[0] | |
@@ -883,22 +899,7 b' class unbundlepart(unpackermixin):' | |||||
883 | advparams.append((self._fromheader(key), self._fromheader(value))) |
|
899 | advparams.append((self._fromheader(key), self._fromheader(value))) | |
884 | self._initparams(manparams, advparams) |
|
900 | self._initparams(manparams, advparams) | |
885 | ## part payload |
|
901 | ## part payload | |
886 | def payloadchunks(): |
|
902 | self._payloadstream = util.chunkbuffer(self._payloadchunks()) | |
887 | payloadsize = self._unpack(_fpayloadsize)[0] |
|
|||
888 | self.ui.debug('payload chunk size: %i\n' % payloadsize) |
|
|||
889 | while payloadsize: |
|
|||
890 | if payloadsize == flaginterrupt: |
|
|||
891 | # interruption detection, the handler will now read a |
|
|||
892 | # single part and process it. |
|
|||
893 | interrupthandler(self.ui, self._fp)() |
|
|||
894 | elif payloadsize < 0: |
|
|||
895 | msg = 'negative payload chunk size: %i' % payloadsize |
|
|||
896 | raise error.BundleValueError(msg) |
|
|||
897 | else: |
|
|||
898 | yield self._readexact(payloadsize) |
|
|||
899 | payloadsize = self._unpack(_fpayloadsize)[0] |
|
|||
900 | self.ui.debug('payload chunk size: %i\n' % payloadsize) |
|
|||
901 | self._payloadstream = util.chunkbuffer(payloadchunks()) |
|
|||
902 | # we read the data, tell it |
|
903 | # we read the data, tell it | |
903 | self._initialized = True |
|
904 | self._initialized = True | |
904 |
|
905 |
General Comments 0
You need to be logged in to leave comments.
Login now