[MERGE] get_revision_graph_with_ghosts and fix for common_ancestor.

Robert Collins robertc at robertcollins.net
Tue Mar 7 21:03:12 GMT 2006


On Tue, 2006-03-07 at 11:13 -0500, Aaron Bentley wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Robert Collins wrote:
> 
> > --- a/bzrlib/revision.py	
> > +++ b/bzrlib/revision.py	
> > @@ -277,15 +277,44 @@
> > +        # combine the graphs
> > +        pending = set([revision_id])
> > +        def find_parents(node_id):
> > +            """find the parents for node_id."""
> > +            for graph in graphs:
> > +                ancestors = graph.get_ancestors()
> > +                try:
> > +                    return ancestors[node_id]
> > +                except KeyError:
> > +                    pass
> 
> Wouldn't graph combination make sense as a Graph method?

Yes. I'd like to leave that for another day and focus on the data
storage and knits issues for now.

> I think this is still wrong, because if you have ghosts, get_ancestors
> will not list the same thing in every graph, so the results aren't going
> to be consistent.

I'm not sure what you are thinking of here - do you have a specific case
for failure? I added a test for the 'ghost is filled in the other
repository' case. This code block returns the parent list for a single
node, which is the same in all the graphs - either the node is not
present or its the node.parent_ids list. So its correct ;)

> >                           self.bzrdir.open_repository().get_revision_graph(None))
> 
> Hmm.  What's None supposed to signify here?  If the null revision, we
> should use NULL_REVISION.

None -> no filter.
NULL_REVISION - >a graph of the NULL_REVISION only.

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/20060308/0179b351/attachment.pgp 


More information about the bazaar mailing list