[MERGE REVIEW] Use InventoryDirectory to represent tree root

Aaron Bentley aaron.bentley at utoronto.ca
Tue Aug 8 00:20:56 BST 2006


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

Robert Collins wrote:
>> Doesn't iter_entries now yield the root entry?
> 
> Yes, but its always first, so it can be skipped trivially.

And it won't work properly in nested-trees.  is_root isn't a YAGNI.  I
already need it.  It's just a question of when it should enter the
mainline.  It seems rather pointless to reimplement this stuff to get
rid of is_root, which is a nice, clear method.

>> These all assume that a tree has one root directory, which is not true
>> in nested-trees, where this came from.
> 
> I dont quite follow. In nested trees AIUI there is still only one root
> for a given tree.

No, in my nested-trees branch, sometimes there is no root for a given tree.

>>> self.root is a property - its never None, so theres no need to check for
>>> that.
>> It is sometimes None in nested-trees, where this came from.
> 
> I can understand that - but at this point we haven't gotten that part of
> the code reviewed and agreed to. I think we're [you and I] still in
> discussion about that. I'm not going -1 this bit of code here because
> its basically harmless, but I would prefer the check for None not come
> in until the root is allowed to be None.

I don't understand why you'd object to making the code more robust than
it needs to be.  I also have tests to ensure that the merge code can
handle file-type changes suitably.  Should I also remove them?

>>> We dont use textinv.py at all - perhaps we should delete it?

I would be happy to delete it.

> Then I'd prefer that we implement the change to use InventoryDirectory
> to represent the tree root without having is_root at this point - if we
> needed it when the origin revision's changes come in, we can add it
> then.

The attached patch does as you request.  I've made suitable arrangements
so that is_root isn't lost in nested-trees.

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

iD8DBQFE18rY0F+nu1YWqI0RAth+AKCFLSnJpL2bNOnjFKoAYAXg8593QgCfRDWJ
EeE7+PrK6rub2Y/oKWKYOv8=
=Uyi0
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: no-special-root.patch
Type: text/x-patch
Size: 11774 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060807/ed930997/attachment.bin 


More information about the bazaar mailing list