What to do about 'revid in ancestry' checks.
Aaron Bentley
aaron.bentley at utoronto.ca
Thu Jul 19 15:53:02 BST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Robert Collins wrote:
> 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(*)
That's pretty comical, considering the number of times I asked you to
review that patch.
> 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, ), )
A little more explanation of the return value would be helpful.
I've certainly wanted a get_relationship([(A, B), (A, C)]) method that
could tell me if A was a descendant or ancestor of B, or whether they
were siblings (cousins?).
> As for using get_revision_graph, thats because its the right name for
> what we are trying to convey.
It's the wrong interface, though. It would be an API break to
substitute Graph for a dict, and it would probably be a bad idea to make
Graph behave as a dict.
> 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?
Nice in theory, painful in practice. Are you offering to do it?
> 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?
I'd want to know what the other invocations of get_graph would be like.
If you're proposing that 'revisions' be substituted for a file_id, I'm
not keen on that.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGn3rO0F+nu1YWqI0RAlSiAJ4i4FPjB5Hkq0mZC2+vRLkz02/UgwCdEALl
8nHBv5uZQ1qCIqo3aCWTbe4=
=octP
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list