[MERGE] Add BzrDir.get_branch_stacked_on_url

Aaron Bentley aaron at aaronbentley.com
Wed Sep 3 16:19:25 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John Arbash Meinel wrote:
> So IMO, this should follow the same format as "get_bound_location()" and other
> such lookup functions. And return None when it isn't stacked rather than
> raising an exception.
> 
> I can understand raising an exception if you were opening the branch itself,
> but as you are just looking for a string, which doesn't exist 95% of the time,
> I think it is bad practice to raise an exception.
> 
> I know I'm coming late to the discussion, though.

We've already shipped 1.6 with that as the API for
Branch.get_stacked_on_url, so you're coming *very* late to this
discussion.  I prefer to return None also, but Branch.get_stacked_on_url
is already a public API.

We don't have to follow that pattern for
BzrDir.get_branch_stacked_on_url, but I think consistency with
Branch.get_stacked_on_url would make sense.

Alternatively, we could implement Branch.get_stacked_on_location and
deprecate Branch.get_stacked_on_url.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIvqr90F+nu1YWqI0RAqeuAJoCeEo9bYmLpIn2lvAW7h9hwJNYdACfYLvS
J14RWAuO8z1x5cmGy8bZGiU=
=6Ivi
-----END PGP SIGNATURE-----



More information about the bazaar mailing list