[MERGE] Move serialisation of inventories into CommitBuilder

Robert Collins robertc at robertcollins.net
Wed Oct 3 05:21:56 BST 2007


On Wed, 2007-10-03 at 12:00 +1000, Andrew Bennetts wrote:
> 
> “Because the user might be changing the file on disk while we are
> committing, a
> stat cache hit here is not enough for us to be sure of what content we
> actually
> will store.  So we pass the cached hash to the store so that it can
> determine if
> the content it would store is the same as we already had (and thus if
> it should
> not be stored).  This way only we only calculate the expensive SHA-1
> hash once,
> in the store, and we will do the right thing even if the file has
> changed since
> the stat lookup.”
> 
> It's a bit more verbose, and could probably be edited down a little,
> but at
> least it doesn't make my eyes glaze over 2/3rds of the way through the
> comment
> :) 

Its also incorrect - the condition here occurs when the hash cache
misses, and the text size and execute bit is unchanged.

# Provide the parents hash to the store layer, so that if the content is
# unchanged, no new version will be recorded.

(This skips all the gory detail that is actually duplicated with other
comments and general design, to get to the point of it).

-Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20071003/efbf3001/attachment.pgp 


More information about the bazaar mailing list