[RFC] can record.sha1 be None?

John Arbash Meinel john at arbash-meinel.com
Mon Mar 16 21:25:16 GMT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm working on making the GroupCompress factory stream support "Lazy"
like we have for LazyKnit when delta_closure=True.

However, in the versionedfile interface tests, it asserts that if you
pass include_delta_closure=False, then the records that are returned
always have a valid sha1 sum.

It seems that there aren't similar tests for the
'include_delta_closure=True' case, because LazyKnitContentFactory
objects always have 'None' for their sha1 sum.

This also comes into play when we want to get rid of the server from
extracting the headers of the texts that they send over the wire (what
Andrew is doing). Namely, knit records get the sha1 from the header, so
if we don't want to uncompress the gz header until we've gotten it to
the client, we have to allow the sha1 sum to be uncalculated, at least
until the text is extracted.

This goes back a bit to my earlier statement that we should be passing
down the sha1 from the inventory, into something like get_record_stream,
so that we validate the downward pointers. I don't think we want to
validate the values until "insert_record_stream()", though. So if we
pass them early, we could save that value in the record object, and have
it verified during insert_record_stream.

Or we could pass it into insert_record_stream, and make it more obvious
that we are validating it at that point. I should also mention that
there is a bit of a disconnect, since you may know the sha1 when you are
getting the record stream (from something like an improved
'iter_item_keys_introduced_by'), but that is generally at a separate
location than you are doing the insert portion...

For now, I'm just changing the VF checking code, to allow it to either
be None or the correct value. I just wanted to make sure that was ok.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkm+w7wACgkQJdeBCYSNAAPOFwCdHVKx5uiTCQ2UTaWQXPq1Cw1+
e+8AniNeD+cwoFBf4jO7x+3OVnuAYJOB
=DhKj
-----END PGP SIGNATURE-----



More information about the bazaar mailing list