[MERGE] Allow parent_providers to not have a get_parents attribute.

Robert Collins robertc at robertcollins.net
Thu Jan 10 23:18:32 GMT 2008


On Thu, 2008-01-10 at 17:52 -0500, Aaron Bentley wrote:
> 
> ParentProviders are a private API and we can freely remove anything we
> like from them.  But Graph is not a private API, and it provides a
> get_parents method.

As discussed on IRC, the current 'deprecation' on
ParentProviders.get_parents is not a functional deprecation, because the
parents_provider public parameter to Graph means that external plugins
like bzr-svn etc are very likely to have implemented a ParentsProvider,
and an old ParentsProvider doesn't have get_parents_map, so the new
graph will just error; likewise a new provider is forced to implement
get_parents. Various get_parents calls may well be being used but not
showing as deprecated - because Graph does /not/ provide a get_parents
method. Graph *uses* the get_parents method on the object its composed
with.

> You can't just set the method to None some of the time.  You can
> easily
> implement it in terms of get_parent_map.  You can even copy & paste
> the
> code from a ParentProvider.  You can deprecate it.
> 
> Or else, if for some reason, you think an API break is necessary, you
> can remove the method, and document that API break.
> 
> But setting it to None some of the time doesn't make sense.

I had been following suit with the previous API break (requiring
get_parents_map). I think, given that we have an API break but only
in .dev, that I'll do a full deprecation patch.

-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/20080111/de7c6ece/attachment.pgp 


More information about the bazaar mailing list