[MERGE] Enable merging PreviewTrees
Aaron Bentley
aaron at aaronbentley.com
Thu Oct 9 05:02:11 BST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Robert Collins wrote:
> On Wed, 2008-10-08 at 23:11 -0400, Aaron Bentley wrote:
>>
>> This patch adds support for merging PreviewTrees into other trees.
>> This
>> means changing some methods to avoid using Tree.inventory, which
>> PreviewTree does not supply.
>>
>> In the process, it introduces Tree.get_inventory_entry, which provides
>> a
>> convenient way of getting single inventory entries, without actually
>> using Tree.inventory or Tree.iter_entries_by_dir. This is a new
>> requirement for Tree implementors, but Tree provides a default for
>> subclasses.
>
> I don't understand why this is preferred to accessing the inventory :-
> this new method is asking for and returning an inventory entry object;
> the natural home for that appears to be on the inventory object itself.
Inventory objects are meant to be an implementation detail of certain
Tree types. Hitting the inventory is expensive on DirState-based trees,
and we've worked hard to eliminate .inventory access from our key
codepaths. PreviewTree is the next step, because it eliminates the
.inventory attribute entirely.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFI7YJD0F+nu1YWqI0RAiDYAJ9D7UIYR5ZlYa3ORdg5iFRB3hxj8gCfZ9ns
KNuZ/nN02eTT0G2oDqFJheI=
=9S+M
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list