RFC: packs and long blobs
John Arbash Meinel
john at arbash-meinel.com
Tue Aug 26 15:02:30 BST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Robert Collins wrote:
> On Tue, 2008-08-26 at 08:13 -0500, John Arbash Meinel wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>> Robert Collins wrote:
>>> So currently pack containers are length-prefixed.
>>> I'd like to add a method to put very large blobs into packs, so that I
>>> can put indices onto the end of pack containers - and indices may be
>>> hundreds of MB in size.
>>> I'm thinking of requiring a file object that supports seek(0, 2); len =
>>> tell() in this method. Any objections/better ideas?
>> Is this for reading, for writing, or both?
This all came down to a misunderstanding that it seems both Vila and I had.
You want to propose an interface like:
where the passed in object supports .seek(0, 2), .tell() and seek(0, 0), .read().
Both Vila and I thought you wanted ContainerWriter to *use* a file-like object
that supported seek() to write to the final pack file. And didn't understand
why you needed that.
The proposal looks good. It might be good to define the full list of things
you need. For example, you do need seek(0, 0) again to get back to the bytes
you want to put into the container, etc.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the bazaar