[MERGE] Shelf 1 / 5: TreeTransform serialization

Aaron Bentley aaron at aaronbentley.com
Tue Oct 21 23:25:37 BST 2008


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

John Arbash Meinel wrote:
> Aaron Bentley wrote:

>> I think that if TT's implementation changed enough that the contents of
>> these dicts changed, we would want to know about it.  Otherwise, we
>> might unwittingly create shelves that could not be restored.
> 
> So, I feel like you are either testing the details to closely, or not
> extensively enough. You are testing *some* of the dict members, but not
> all of them. So while changing the content of these will break the test,
> a change to a different dict won't.

This is true.  I am testing everything I serialize, and everything
derived from the things I serialize.

_tree: I hope the reasons for not serializing this are obvious.

_limbodir, _deletiondir should not be restored, and their exact values
are essentially irrelevant.

_needs_rename, _limbo_children and _limbo_children_names are not
preserved-- they are produced when restoring the content of the
Transform.  Like _limbodir and _deletiondir, their precise values aren't
especially relevant, as long as they're sane.

_new_reference_revision probably should be preserved, but it's only
relevant if nested trees are in play.

_realpaths and _relpaths are caches, so we don't need to populate them.

_new_root arguably should be preserved.  (But it rarely changes.)

_done should always be False when serializing or deserializing.  I can
fix that.

_pb is basically impossible to serialize.

_case_sensitive target can legitimately vary.  (And this is part of the
reason why _limbo_children and _limbo_children_names are not preserved.)

_rename_count always refers to the current instance, so preserving it
would be lying.

> Maybe I'm full of it, but if you are testing the exact state of the TT,
> shouldn't it be testing more than just a couple of members?

I test every member that is serialized:
_id_number, _new_name, _new_parent, _new_executability, _new_id,
_tree_path_ids, _new_contents, _removed_id, _removed_contents,
_non_present_ids.

Additionally, I test _tree_id_paths and _r_new_id, which are the inverse
of _tree_path_ids and _new_id, respectively.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkj+VuAACgkQ0F+nu1YWqI2kFwCfQN1n1ilU8nskBt1VEmRu41c0
hFgAnAp4qFTcIGzyqll3G4i9AI863htB
=aBEt
-----END PGP SIGNATURE-----



More information about the bazaar mailing list