Merge lp:~abentley/bzr/fix-shelf into lp:~bzr/bzr/trunk-old
Proposed by
Aaron Bentley
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | not available | ||||
Proposed branch: | lp:~abentley/bzr/fix-shelf | ||||
Merge into: | lp:~bzr/bzr/trunk-old | ||||
Diff against target: | None lines | ||||
To merge this branch: | bzr merge lp:~abentley/bzr/fix-shelf | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andrew Bennetts | Approve | ||
Review via email: mp+7699@code.launchpad.net |
To post a comment you must log in.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi all,
This fixes a bug in the ContainerPushPa rser, which indrectly causes
unshelve to crash when unshelving zero-length files.
The problem is that ContainerPushParser uses self._buffer as an expecting_ body will move on to the next state
indicator of progress. It assumes that if self._buffer did not change,
no progress could be made in parsing records. But in the case of a
zero-length record, _state_
handler, without changing the length of self._buffer. This is clearly
progress.
The result of this bug is that the parser stops at the first zero-length deserialize to produce an incomplete stored_ kind to raise an exception.
record, which causes TreeTransform.
TreeTransform, which causes PreviewTree.
This patch simply augments test for progress by requiring that
self._buffer have a different length, OR that the state_handler be changed.
I am inclined to think that it would be more robust to have a flag
indicating whether progress occurred, or even to raise an exception when
progress ceases.
Aaron enigmail. mozdev. org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAko 8O6sACgkQ0F+ nu1YWqI1LkQCgh6 KV6lZd0ps9wBS2e Ba+R743 SE9z1JcxgkZYK3r htUyot9Dz
BH0An25+
=WEdZ
-----END PGP SIGNATURE-----