Mercurial > hg > mercurial-source
diff mercurial/bundle2.py @ 21129:07bcbf326c8d
bundle2: use an official iterparts method to unbundle parts
Explicit is better than implicit.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Wed, 16 Apr 2014 18:41:48 -0400 (2014-04-16) |
parents | 5ecfe76d0d96 |
children | 1ff06386217f |
line wrap: on
line diff
--- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -286,7 +286,7 @@ # - replace this is a init function soon. # - exception catching unbundler.params - iterparts = iter(unbundler) + iterparts = unbundler.iterparts() part = None try: for part in iterparts: @@ -397,7 +397,8 @@ class unbundle20(unpackermixin): """interpret a bundle2 stream - (this will eventually yield parts)""" + This class is fed with a binary stream and yields parts through its + `iterparts` methods.""" def __init__(self, ui, fp, header=None): """If header is specified, we do not read it out of the stream.""" @@ -450,7 +451,7 @@ raise KeyError(name) - def __iter__(self): + def iterparts(self): """yield all parts contained in the stream""" # make sure param have been loaded self.params