[MERGE] Add BzrDir.get_branch_stacked_on_url

Robert Collins robertc at robertcollins.net
Tue Sep 2 05:49:33 BST 2008


On Tue, 2008-09-02 at 00:39 -0400, Aaron Bentley wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Robert Collins wrote:
> > On Mon, 2008-09-01 at 20:21 -0400, Aaron Bentley wrote:
> >> Well, I'm not opposed to this as a stop-gap as long as you file a bug
> >> that we shouldn't open fallback branches until we know that we need them.
> > 
> > stacked_on_branches are always needed today, for the repository, branch
> > history etc to operate correctly. The repository has no way to call-back
> > to the branch to ask for other locations, and I'm not sure that would be
> > a good way to construct it anyhow.
> 
> We need to know where to *find* them, sure.  I don't agree that we need
> to open them.  There are some queries that don't require stacked-on
> branches.  As we turn stacked branches into shallow branches, we will be
> avoiding opening branches anyway.

By the same token, we don't strictly need a Repository object to be open
either when we open a tree or branch, but we settled a while ago, I
thought, that it was safer and better to do so. I think the same
arguments apply here. A stacked branch where the stacked on Repository
is no longer accessible should be raised as a problem as soon as
possible to the user.

> >> The patch as it stands assumes too much about the way branches are
> >> configured.  This would fail spectacularly with a Subversion branch, if
> >> they supported stacking.
> > 
> > I agree that the BzrDirMetaDir implementation should indirect through
> > the format object of the branch though I will note that bzr-svn branches
> > are not a problem: subversion branches have their own BzrDir
> > implementation which means they already have an indirection point.
> 
> IIRC, bzr-svn's control directory inherits from BzrMetaDir, so they
> would be affected.

They may well by the default implementation - but they would be by a
'NotImplementedError' raising default as well - and they have the
ability to replace the code.

That said, bzr-svn should _not_ inherit from BzrMetaDir, that class is
for the .bzr meta-dir style layout, not generic control directories, its
almost certainly confusing stuff if it does this.

-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/20080902/fefb5742/attachment.pgp 


More information about the bazaar mailing list