What to do about 'revid in ancestry' checks.

Robert Collins robertc at robertcollins.net
Thu Jul 19 06:23:50 BST 2007


On Thu, 2007-07-19 at 00:05 -0400, Aaron Bentley wrote:


> Huh?  I've suggested using the Graph object.  Why would you use
> get_revision_graph (which returns a dict) instead of get_graph (which
> returns a Graph)?

I didn't notice 'get_graph' even existing(*)

So on Graph, I propose reachable as a method name.

reachability = graph.reachable([(start_keys, target_keys)...])

This is a little awkward but handles the following use cases:

 - has A been merged into B ?
    reachable([(B, A)]) -> ((True, ), ) or ((False, ), )
 - has A been merged into any of B, C, D?
   (I have wanted this in the past to find which branches I haven't
merged bzr.dev into)
   reachable([(B, C, D), (A, )]) -> ((True, ), ) or ((False, ), )
 - which of A, B, C have been merged into D?
   (I want this for a 'whats not merged in these branches command, to
find unmerged things relative to bzr.dev')
   reachable([(D, ), (A, B, C )]) -> ((True, True, True), ) etc. 

The nested results on the targets allow separate queries to be provided
at once, allowing things like a cross-product (which branches have been
merged into which other branches) as a single query without forcing
complete calculations on every lookup which an automatic cross-product
would require.

...

As for using get_revision_graph, thats because its the right name for
what we are trying to convey. I did mention in my mail that I'd be happy
to change the interface to return the Graph object.

How do you feel about us renaming get_graph to get_revision_graph, if
its for doing graphs at the revision level?

Or if you object to changing the interface of get_revision_graph, how
about get_graph('revisions') to indicate we're getting the revision
graph?

-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: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070719/044328ac/attachment.pgp 


More information about the bazaar mailing list