[MERGE] trees - add get_parent_ids

Robert Collins robertc at robertcollins.net
Fri Jun 16 15:19:08 BST 2006


On Fri, 2006-06-16 at 10:01 -0400, Aaron Bentley wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Robert Collins wrote:
> > This patch adds a get_parent_ids() call to all our tree objects (at
> > least, I think to all of them ;)).
> > 
> > This call returns:
> > [] for a tree with unknown parents
> 
> I think this should be something other than the empty list.  Possibly an
> exception.
> 
> > ['null:'] for a tree descending from null:
> 
> e.g. revno 1, right?

revno 1 yes.

> > [revid, ...] in general.
> > 
> > EmptyTree descends from ['null:'].
> 
> EINFINITELOOP.  EmptyTree doesn't descend from 'null:', it *is* 'null:'.
>  EmptyTree should return [], because 'null:' does not descend from 'null:'.

Ah, ok.

> > RevisionTree mirrors the revision graph.
> > WorkingTree provides the union of last_revision and pending merges.

How about I change the api to be:
[] for a tree known to have no parents including EmptyTree.
[revid, ...] for trees descending from non-null parents.
raises BzrError *for now* if we do not know the parents. (When we have a
use for it, we can and should create a specific exception. I'm just not
sure what it should be called, and as we have no code that can generate
this situation I'm hesitant about putting in an exception that may never
ever be used/possible to use.

Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060617/be6e8d60/attachment.pgp 


More information about the bazaar mailing list