Comment 3 for bug 243386

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 243386] [NEW] url lookups should be able to use the same heuristic switch does

On Fri, 2008-06-27 at 14:33 +0000, Aaron Bentley wrote:

> So if you have a branch named "down" in a subdirectory, "bzr merge down"
> wouldn't work. Would we do "bzr merge ./down" for that?

So given three trees:
.
./down
../down

what should 'bzr merge down' do - should it grab ./down or ../down? I
think that ./down is going to be a nested branch - either that or its a
very rare layout. So grabbing ../down is actually more appropriate than
the current behaviour of grabbing down as we do today. But we could
think of this as a search path:
find_branch_heuristic(branch, branchname)
  if is_abs(branchname):
    # probe directly
  else:
    for prefix in lookup_locations(branch):
      # probe for prefix + '/' + branchname
      # and then ...
      if branchname != '.' and found_branch.base == branch.base:
          continue

If we chose to look in ['.', branch.base + '..'] we'd fine ./down
before ../down, still find ../down if there was no ./down that is a
branch.

-Rob

--
GPG key available at: <http://www.robertcollins.net/keys.txt>.