[rfc] more control over activating fallback repositories (aka what gets stacked on)
Michael Hudson
michael.hudson at canonical.com
Thu Oct 9 00:42:36 BST 2008
Robert Collins 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.
>
> There are a bunch of other places you could do this - you could patch
> into the transport logic.
You mean writing your own transport decorator that returns different
bytes for 'branch.conf' files? Or something else?
> What sort of transforms do you want to do?
"bzr+ssh://bazaar.launchpad.net/~user/project/branch" ->
"/~user/project/branch" would be the main example.
>> A reasonable way to do this seems to be to add a
>> "dont_activate_fallbacks" (or similarly named) to Branch.open and
>> related functions (and then our code would be responsible for calling
>> add_fallback_repository with appropriate arguments.
>
> I don't think this is good, because its a dangerous facility that will
> lead to incorrect behaviour if misused; if the fallback is not available
> the branch and repository are not complete and are unable to be used.
Well, yes. It would obviously be a user-beware situation. But
currently, if you are confronted with a branch with a stacked on
location that is not accessible to you for some reason, you're pretty stuck.
> I'd support some mechanism to let you /alter/ what url is used, but not
> one to disable/enable it.
Something else we talked about on the phone was a hook to do something
like this. I take it you'd rather we went down this line? I thought
what I proposed would have been easier/simpler but now I come to try to
implement it I'm not so sure, so perhaps a hook is the way to go...
Cheers,
mwh
More information about the bazaar
mailing list