[MERGE] More explicit use of Tree.get_root_id()

John Arbash Meinel john at arbash-meinel.com
Fri Oct 26 20:23:24 BST 2007


The attached patch adds tree implementation tests that all Trees implement
Tree.get_root_id(). Which it turned out all trees already implemented.
Including fast path implementations for WT4 trees.

And then it goes through and finds all the places where we were doing:
Tree.inventory.root.file_id, and uses Tree.get_root_id() in its place.

Tree.get_root_id() is strictly redundant, because we already had
Tree.path2id(''), but it did seem a bit clearer to make it obvious that
you were asking for the root id of the tree. And I certainly wanted to get
away from Tree.inventory.root.file_id. Since we are trying to make
inventory a bit more of an implementation detail than a strict API.

I'm pretty sure this is safe, because it is mostly just a mechanical
cleanup. But as it doesn't actually implement any new API's it is also
reasonable to wait to merge it. (People can start using Tree.get_root_id()
in their code without this patch.)

So, nothing urgent, just a bit of simple cleanup.

John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-patch
Size: 28068 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20071026/6b6becf3/attachment-0001.bin 


More information about the bazaar mailing list