Show More
@@ -179,7 +179,7 b' def outdebug(ui, message):' | |||
|
179 | 179 | |
|
180 | 180 | def indebug(ui, message): |
|
181 | 181 | """debug on input stream (unbundling)""" |
|
182 | ui.debug('bundle2-input: %s' % message) | |
|
182 | ui.debug('bundle2-input: %s\n' % message) | |
|
183 | 183 | |
|
184 | 184 | def validateparttype(parttype): |
|
185 | 185 | """raise ValueError if a parttype contains invalid character""" |
@@ -350,7 +350,7 b' def _processpart(op, part):' | |||
|
350 | 350 | handler = parthandlermapping.get(part.type) |
|
351 | 351 | if handler is None: |
|
352 | 352 | raise error.UnsupportedPartError(parttype=part.type) |
|
353 |
indebug(op.ui, 'found a handler for part %r |
|
|
353 | indebug(op.ui, 'found a handler for part %r' % part.type) | |
|
354 | 354 | unknownparams = part.mandatorykeys - handler.params |
|
355 | 355 | if unknownparams: |
|
356 | 356 | unknownparams = list(unknownparams) |
@@ -360,7 +360,7 b' def _processpart(op, part):' | |||
|
360 | 360 | except error.UnsupportedPartError, exc: |
|
361 | 361 | if part.mandatory: # mandatory parts |
|
362 | 362 | raise |
|
363 |
indebug(op.ui, 'ignoring unsupported advisory part %s |
|
|
363 | indebug(op.ui, 'ignoring unsupported advisory part %s' % exc) | |
|
364 | 364 | return # skip to part processing |
|
365 | 365 | |
|
366 | 366 | # handler is called outside the above try block so that we don't |
@@ -563,7 +563,7 b' def getunbundler(ui, fp, header=None):' | |||
|
563 | 563 | if unbundlerclass is None: |
|
564 | 564 | raise util.Abort(_('unknown bundle version %s') % version) |
|
565 | 565 | unbundler = unbundlerclass(ui, fp) |
|
566 |
indebug(ui, 'start processing of %s stream |
|
|
566 | indebug(ui, 'start processing of %s stream' % header) | |
|
567 | 567 | return unbundler |
|
568 | 568 | |
|
569 | 569 | class unbundle20(unpackermixin): |
@@ -580,7 +580,7 b' class unbundle20(unpackermixin):' | |||
|
580 | 580 | @util.propertycache |
|
581 | 581 | def params(self): |
|
582 | 582 | """dictionary of stream level parameters""" |
|
583 |
indebug(self.ui, 'reading bundle2 stream parameters |
|
|
583 | indebug(self.ui, 'reading bundle2 stream parameters') | |
|
584 | 584 | params = {} |
|
585 | 585 | paramssize = self._unpack(_fstreamparamsize)[0] |
|
586 | 586 | if paramssize < 0: |
@@ -613,7 +613,7 b' class unbundle20(unpackermixin):' | |||
|
613 | 613 | # Some logic will be later added here to try to process the option for |
|
614 | 614 | # a dict of known parameter. |
|
615 | 615 | if name[0].islower(): |
|
616 |
indebug(self.ui, "ignoring unknown parameter %r |
|
|
616 | indebug(self.ui, "ignoring unknown parameter %r" % name) | |
|
617 | 617 | else: |
|
618 | 618 | raise error.UnsupportedPartError(params=(name,)) |
|
619 | 619 | |
@@ -622,14 +622,14 b' class unbundle20(unpackermixin):' | |||
|
622 | 622 | """yield all parts contained in the stream""" |
|
623 | 623 | # make sure param have been loaded |
|
624 | 624 | self.params |
|
625 |
indebug(self.ui, 'start extraction of bundle2 parts |
|
|
625 | indebug(self.ui, 'start extraction of bundle2 parts') | |
|
626 | 626 | headerblock = self._readpartheader() |
|
627 | 627 | while headerblock is not None: |
|
628 | 628 | part = unbundlepart(self.ui, headerblock, self._fp) |
|
629 | 629 | yield part |
|
630 | 630 | part.seek(0, 2) |
|
631 | 631 | headerblock = self._readpartheader() |
|
632 |
indebug(self.ui, 'end of bundle2 stream |
|
|
632 | indebug(self.ui, 'end of bundle2 stream') | |
|
633 | 633 | |
|
634 | 634 | def _readpartheader(self): |
|
635 | 635 | """reads a part header size and return the bytes blob |
@@ -639,7 +639,7 b' class unbundle20(unpackermixin):' | |||
|
639 | 639 | if headersize < 0: |
|
640 | 640 | raise error.BundleValueError('negative part header size: %i' |
|
641 | 641 | % headersize) |
|
642 |
indebug(self.ui, 'part header size: %i |
|
|
642 | indebug(self.ui, 'part header size: %i' % headersize) | |
|
643 | 643 | if headersize: |
|
644 | 644 | return self._readexact(headersize) |
|
645 | 645 | return None |
@@ -831,10 +831,10 b' class interrupthandler(unpackermixin):' | |||
|
831 | 831 | return None |
|
832 | 832 | |
|
833 | 833 | def __call__(self): |
|
834 |
indebug(self.ui, 'bundle2 stream interruption, looking for a part. |
|
|
834 | indebug(self.ui, 'bundle2 stream interruption, looking for a part.') | |
|
835 | 835 | headerblock = self._readpartheader() |
|
836 | 836 | if headerblock is None: |
|
837 |
indebug(self.ui, 'no part found during interruption. |
|
|
837 | indebug(self.ui, 'no part found during interruption.') | |
|
838 | 838 | return |
|
839 | 839 | part = unbundlepart(self.ui, headerblock, self._fp) |
|
840 | 840 | op = interruptoperation(self.ui) |
@@ -918,7 +918,7 b' class unbundlepart(unpackermixin):' | |||
|
918 | 918 | |
|
919 | 919 | pos = self._chunkindex[chunknum][0] |
|
920 | 920 | payloadsize = self._unpack(_fpayloadsize)[0] |
|
921 |
indebug(self.ui, 'payload chunk size: %i |
|
|
921 | indebug(self.ui, 'payload chunk size: %i' % payloadsize) | |
|
922 | 922 | while payloadsize: |
|
923 | 923 | if payloadsize == flaginterrupt: |
|
924 | 924 | # interruption detection, the handler will now read a |
@@ -936,7 +936,7 b' class unbundlepart(unpackermixin):' | |||
|
936 | 936 | super(unbundlepart, self).tell())) |
|
937 | 937 | yield result |
|
938 | 938 | payloadsize = self._unpack(_fpayloadsize)[0] |
|
939 |
indebug(self.ui, 'payload chunk size: %i |
|
|
939 | indebug(self.ui, 'payload chunk size: %i' % payloadsize) | |
|
940 | 940 | |
|
941 | 941 | def _findchunk(self, pos): |
|
942 | 942 | '''for a given payload position, return a chunk number and offset''' |
@@ -951,16 +951,16 b' class unbundlepart(unpackermixin):' | |||
|
951 | 951 | """read the header and setup the object""" |
|
952 | 952 | typesize = self._unpackheader(_fparttypesize)[0] |
|
953 | 953 | self.type = self._fromheader(typesize) |
|
954 |
indebug(self.ui, 'part type: "%s" |
|
|
954 | indebug(self.ui, 'part type: "%s"' % self.type) | |
|
955 | 955 | self.id = self._unpackheader(_fpartid)[0] |
|
956 |
indebug(self.ui, 'part id: "%s" |
|
|
956 | indebug(self.ui, 'part id: "%s"' % self.id) | |
|
957 | 957 | # extract mandatory bit from type |
|
958 | 958 | self.mandatory = (self.type != self.type.lower()) |
|
959 | 959 | self.type = self.type.lower() |
|
960 | 960 | ## reading parameters |
|
961 | 961 | # param count |
|
962 | 962 | mancount, advcount = self._unpackheader(_fpartparamcount) |
|
963 |
indebug(self.ui, 'part parameters: %i |
|
|
963 | indebug(self.ui, 'part parameters: %i' % (mancount + advcount)) | |
|
964 | 964 | # param size |
|
965 | 965 | fparamsizes = _makefpartparamsizes(mancount + advcount) |
|
966 | 966 | paramsizes = self._unpackheader(fparamsizes) |
General Comments 0
You need to be logged in to leave comments.
Login now