[MERGE] Move serialisation of inventories into CommitBuilder
Andrew Bennetts
andrew at canonical.com
Wed Oct 3 05:49:01 BST 2007
Robert Collins wrote:
> 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.
Oh right, that makes sense. I'm not surprised I mistranslated!
> # 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).
That sounds good to me!
-Andrew.
More information about the bazaar
mailing list