Patchwork [2,of,3] bundle2: seek in part iterator

login
register
mail settings
Submitter Eric Sumner
Date Feb. 5, 2015, 7:10 p.m.
Message ID <cacd3119be7dd5681f6b.1423163430@waste.org>
Download mbox | patch
Permalink /patch/7687/
State Accepted
Commit 13d88b7eb3a092d434dc925c24c9cc9caa552d58
Headers show

Comments

Eric Sumner - Feb. 5, 2015, 7:10 p.m.
# HG changeset patch
# User Eric Sumner <ericsumner@fb.com>
# Date 1423162665 28800
#      Thu Feb 05 10:57:45 2015 -0800
# Node ID cacd3119be7dd5681f6bf05a167115d0cba01236
# Parent  8eeb3f4489fbe9c66d2ac0a8fd90abc973619bbc
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.

Patch

diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -590,6 +590,7 @@ 
         while headerblock is not None:
             part = unbundlepart(self.ui, headerblock, self._fp)
             yield part
+            part.seek(0, 2)
             headerblock = self._readpartheader()
         self.ui.debug('end of bundle2 stream\n')