nested trees design-approach : composite trees vs iter_changes

Robert Collins robert.collins at canonical.com
Tue May 5 03:05:44 BST 2009


On Tue, 2009-05-05 at 11:58 +1000, Ian Clatworthy wrote:
> Robert Collins wrote:
> > I think users (which includes us) that write to the API will see most of
> > the things I enumerated bite them repeatedly. Its worth noting that such
> > users include sysadmins doing precommit hooks, integration into
> > buildbots and other such tasks.
> I'd still like to see a concrete, practical example. You mentioned
> Tree.add() in your original email but I can't think of when I'd ever
> want to call that in a precommit hook.

Just using it in a python script will do the wrong thing:
tree = WorkingTree.open('.')
tree.smart_add('fpp', 'bar')

if there is a nested tree containing the id 'bar' this will violate a
constraint that nested trees depend upon (ids are unique in a
CompositeTree).

But as tree won't be a CompositeTree, the error will turn up as merges
going odd, or other similar things.

-Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090505/32701beb/attachment-0001.pgp 


More information about the bazaar mailing list