Comment 2 for bug 243386

Revision history for this message
John A Meinel (jameinel) wrote :

Well, 'bzr switch' is a bit different than "merge" in that it doesn't allow you to give the path to a subdirectory of a branch.
So it first tries the path as a relative path, and if it doesn't find anything, it falls back to relative to the current "other" branch.

So, for example:

 bzr switch foo

Is './foo' a branch, if so, switch to that
elif cur_target + '../foo' is a branch, switch to that
else fail

'bzr merge' is going to have a harder time, because it has to say:

if './foo' is a branch, use that
elif './foo' is an existing file inside a containing tree, use the containing tree
elif cur_target + '../foo' is a branch, switch to that
elif cur_target + '../foo' is a file inside of a containing tree # we could probably ignore this one
else fail

However, this seems fairly easy to extract into a helper function. The next problem is to know exactly when it would be active. Only in a checkout, all the time, etc.