[MERGE] get_revision_graph_with_ghosts and fix for common_ancestor.
Aaron Bentley
aaron.bentley at utoronto.ca
Tue Mar 7 16:13:50 GMT 2006
-----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?
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.
So I think you need to generate a list of the combined results, sorted
by the order in which parents appeared. The comparison function is
probably pretty wacky, since no two entries are guaranteed to have an
ordering relative to each other in any given list.
Or I suppose we could just throw up our hands and use a set.
> 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.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFEDbE+0F+nu1YWqI0RAu5MAJ9mcEVuB55E/4xVnb2cEp763dry7wCfTQab
j70ln8FIWrNuvTyI+PNpJ6o=
=Mp07
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list