Mercurial > hg
comparison mercurial/revlog.py @ 51018:720e5a5f2b95
stream-clone: use `revlog.reading` in `revlog.get_streams`
We can get the same result while using more standard method, so we do.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 25 Sep 2023 17:18:40 +0200 |
parents | aed91a4421b8 |
children | 509f0f7fc89e |
comparison
equal
deleted
inserted
replaced
51017:edc44ab7437a | 51018:720e5a5f2b95 |
---|---|
574 (self._indexfile, inline_stream, index_size + data_size), | 574 (self._indexfile, inline_stream, index_size + data_size), |
575 ] | 575 ] |
576 elif force_inline: | 576 elif force_inline: |
577 | 577 |
578 def get_stream(): | 578 def get_stream(): |
579 with self._datafp() as fp_d: | 579 with self.reading(): |
580 yield None | 580 yield None |
581 | 581 |
582 for rev in range(n): | 582 for rev in range(n): |
583 idx = self.index.entry_binary(rev) | 583 idx = self.index.entry_binary(rev) |
584 if rev == 0 and self._docket is None: | 584 if rev == 0 and self._docket is None: |
587 header |= self._format_version | 587 header |= self._format_version |
588 header |= FLAG_INLINE_DATA | 588 header |= FLAG_INLINE_DATA |
589 header = self.index.pack_header(header) | 589 header = self.index.pack_header(header) |
590 idx = header + idx | 590 idx = header + idx |
591 yield idx | 591 yield idx |
592 yield self._getsegmentforrevs(rev, rev, df=fp_d)[1] | 592 yield self._getsegmentforrevs(rev, rev)[1] |
593 | 593 |
594 inline_stream = get_stream() | 594 inline_stream = get_stream() |
595 next(inline_stream) | 595 next(inline_stream) |
596 return [ | 596 return [ |
597 (self._indexfile, inline_stream, index_size + data_size), | 597 (self._indexfile, inline_stream, index_size + data_size), |