[rfc] more control over activating fallback repositories (aka what gets stacked on)

Michael Hudson michael.hudson at canonical.com
Thu Oct 9 01:43:08 BST 2008


Martin Pool wrote:
> On Thu, Oct 9, 2008 at 10:29 AM, Robert Collins
> <robertc at robertcollins.net> wrote:
>> On Wed, 2008-10-08 at 18:21 +1300, Michael Hudson wrote:
>>> Currently, opening a branch also opens any stacked on branch specified
>>> in the branch's branch.conf file.  This is inconvenient some of the
>>> time, particularly in the innards of the codehosting system on Launchpad
>>> where we want to be able to inspect and maybe interfere with the stacked
>>> on URL before opening what it points at.
> 
> At the moment we have the invariant that if you open a branch, its
> repository is always opened and configured with a fallback repository.
>  Allowing you to have a branch without those things being true will
> probably break code that expects them to be true, and I'm not sure
> it'd be generally desirable to change them to cope without it.

I'm a little surprised this end of things has caused alarm, to be
honest.  _Of course_ the branch you'd get from saying Branch.open(...,
activate_fallbacks=False) is partially broken, and you should be able to
call most of the methods on it before activating the fallbacks.  But if
this is a concern, I'm happy to sidestep it.

> However, we do have the shortcoming that you can't really even think
> about a branch without opening it, and you can't determine it's
> stacked on url without opening it.  One way to put this in would be to
> give the branch format the method to get the stacked-on url, and have
> the branch instance call that.

That still wouldn't give you a way to open the branch as if it was
stacked on a different URL, though.

> This approach means that Launchpad won't be able to pull or scan
> branches stacked on branches not located on Launchpad, as we don't
> want it making arbitrary outgoing connections.

I don't really see what the difference is here, compared to the other
things we've talked about.

> That may be
> reasonable.  I suppose you could automatically or manually mirror that
> branch and then transform it as described.

Let's worry about this part next month :)

Cheers,
mwh



More information about the bazaar mailing list