[MERGE] set parent trees api.

Martin Pool mbp at canonical.com
Fri Aug 18 10:18:55 BST 2006


On 18 Aug 2006, Robert Collins <robertc at robertcollins.net> wrote:

> > Why not just take the tree and call get_revision_id() on it?  I see
> > that's not declared in the Tree base class, but it is on RevisionTree.
> > Interfaces that take an n-tuple of heterogenous objects seem a bit error
> > prone.  Having seen the way this looks in the tests I'd fairly strongly prefer
> > it just took a tree. 
> 
> Because the tree may be a ghost. We either need a marker for a tree that
> cannot be retrieved, or we need a fake tree which claims to be revision
> X but has the content of an EmptyTree. I think that the way I've done it
> is less likely to introduce bugs than having a fake tree.
> 
> The reason I use a tuple is for compatability with the set_parent_trees
> api rather than having one take rev_id, tree_or_none and the other take
> a list of tuples.
> 
> I'd rather do it the way I have, if you feel strongly I will change it.

I see what you mean.  And we can't use a dictionary because it'll
lose the ordering, so I guess the tuples are the best option.  How about
adding assertions that len==2?  (I hate when you pass a string
instead of a list or tuple and get a delayed error.)

-- 
Martin




More information about the bazaar mailing list