[MERGE] Use a list not a tuple for chunks returned from FullTextContentFactory objects, because otherwise code tries to assign to tuples.
John Arbash Meinel
john at arbash-meinel.com
Tue Feb 3 15:55:40 GMT 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Robert Collins wrote:
> Trivial issue in the new chunked support, which is that some content
> adapters write to the chunks they get back. As they are tested and used
> with knit content records, I am assuming this aliasing is deliberate,
> and just altering the FullText type to match.
>
> I'm happy to write a test to support this, but I'd like input from John
> or someone that reviewed the chunked code as to whether this is right,
> or the callers using the result are wrong (they are also in bzrlib - the
> knit content adapters).
>
> Alternatively, if its sufficiently under-the-view, I could just land
> this as-is :)
>
> -Rob
>
I'm pretty sure that you should not be mutating the return of
get_bytes_as('chunks') directly. Instead you should do:
lines = osutils.chunks_to_lines(get_bytes_as('chunks'))
And then you can mutate 'lines'. Otherwise 'chunks' can be:
[fulltext]
or
[line1, line2, line3]
Which are both valid representation of the same text in 'chunked' form.
Anyway, I don't have a strict problem with the change, but I think it
points out a bug elsewhere, not a bug in the FulltextContentFactory code.
BB:comment
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkmIaPwACgkQJdeBCYSNAAN4kQCeI7I/Vsu3aR2orUeZG7Vmt7aX
iX4AoKfuJGKbtUc3JjA3viLBhVL41R/P
=+fXM
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list