Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/bundle2.py @ 24048:13d88b7eb3a0
bundle2: seek in part iterator
When iterating over bundle2 parts, add a seek to the iterator so that
processing will continue normally even if the entire part isn't
consumed.
author | Eric Sumner <ericsumner@fb.com> |
---|---|
date | Thu, 05 Feb 2015 10:57:45 -0800 |
parents | 731fa8e3e580 |
children | de32e9881698 |
comparison
equal
deleted
inserted
replaced
24047:731fa8e3e580 | 24048:13d88b7eb3a0 |
---|---|
588 self.ui.debug('start extraction of bundle2 parts\n') | 588 self.ui.debug('start extraction of bundle2 parts\n') |
589 headerblock = self._readpartheader() | 589 headerblock = self._readpartheader() |
590 while headerblock is not None: | 590 while headerblock is not None: |
591 part = unbundlepart(self.ui, headerblock, self._fp) | 591 part = unbundlepart(self.ui, headerblock, self._fp) |
592 yield part | 592 yield part |
593 part.seek(0, 2) | |
593 headerblock = self._readpartheader() | 594 headerblock = self._readpartheader() |
594 self.ui.debug('end of bundle2 stream\n') | 595 self.ui.debug('end of bundle2 stream\n') |
595 | 596 |
596 def _readpartheader(self): | 597 def _readpartheader(self): |
597 """reads a part header size and return the bytes blob | 598 """reads a part header size and return the bytes blob |