nested trees design-approach : composite trees vs iter_changes

Robert Collins robert.collins at
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 ='.')
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

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

-------------- 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 : 

More information about the bazaar mailing list