[MERGE] Shelf 1 / 5: TreeTransform serialization

Aaron Bentley aaron at aaronbentley.com
Tue Oct 21 01:14:27 BST 2008


John Arbash Meinel wrote:
>> So deserialize can be exercised by passing in a manually-constructed
>> list of records.  serialize can be exercised with an implementation of
>> Pack that simply creates a list of records.
> 
>> Does that seem right to you?

> That seems ok. I think Robert's idea is fine as well, though I'm
> thinking we should probably still be asserting the pack format you want
> to be using.

I don't really understand this critique.  I'm not asserting anything
about a specific on-disk format.  If a pack2 format should be invented,
I would hope that this code would work, unchanged, with it.

> It just depends how strong you want to guarantee that
> different versions of bzr can re-use the shelf contents.

In this patch, I don't think I'm saying anything about what shelves are
like.  I'm describing a way of serializing TreeTransforms that is
independent of any particular serialization format.

In fact, I can guarantee that what TT.serialize creates is not a valid
shelf.  If you skip ahead to patch 3, you can see that Unshelver
requires an initial 'metadata' record, defining the message and base
revision-id.  But these are not intrinsic properties of a TreeTransform,
just of shelves.  So neither TT.serialize nor TT.deserialize supplies
this record.

I think that it would make a great deal of sense for ShelfCreator's
tests to ensure that a particular on-disk format used.  In that scope,
we're actually talking about shelves, and we do actually care about the
on-disk format.  I don't think this is the right place for this kind of
test.

Aaron



More information about the bazaar mailing list