[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 16:03:10 GMT 2009
-----BEGIN PGP SIGNED MESSAGE-----
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 :)
You know what... the problem could be if 'fulltext' is empty, or a
single line long. In that case the 'chunks_to_lines()' code will loop,
and see that all of the entries are valid lines, and just return the
original object, rather than returning a list.
So probably a better fix is to change the chunks_to_lines code to always
create a new list, rather than returning the original object. There
would be some overhead in creating a new list, and then getting rid of
the original, but it shouldn't be a lot.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the bazaar