[PATCH] revision-store tracks inventory and precursor hashes

John A Meinel john at arbash-meinel.com
Fri Jun 10 20:40:18 BST 2005

On #bzr we were discussing how to implement signing of revisions. And it
was determined that the best place to sign was actually the revision
entry, since it contained the most meta-information.

The only problem was that it didn't contain a sha has of the associated
inventory (or precursor) so that you weren't signing the complete chain
of information.

The attached patch fixes this by adding a "inventory_sha1" entry to the
revision, as well as adding a "precursor_sha1".

I also updated the "bzr check" function, so that you could pass the
argument "bzr check --update" which while checking integrity will make
sure that the sha1 checksums also match.

I'm supplying this as 2 patches, since you may not want the "check"
functionality, but you probably want the inventory_sha1 additions.

In the process I found a small bug in Revision.to_element. Old revisions
(like revno=1) do not include a timezone value. Which means that
Revision.timezone = None.
If you re-create the Element, it calls str(self.timezone) which yields
'None'. You really want to leave this as not-defined, or future checks
will fail, when they try to do:
self.timezone = v and int(v)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: revision-store-includes-hashes.patch
Type: text/x-patch
Size: 4493 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050610/757aa2ac/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bzr-check-updates-hashes.patch
Type: text/x-patch
Size: 6074 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050610/757aa2ac/attachment-0001.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 251 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050610/757aa2ac/attachment.pgp 

More information about the bazaar mailing list