Comment 8 for bug 876629

Revision history for this message
Martin Pool (mbp) wrote : Re: Call for testing of colocated branch support in bzr.dev

One more thing in 2.5b5 and trunk, is that 'bzr remove-branch
COLO_BRANCH_NAME', actually removes the .bzr/branch directory, leaving
you with a broken (but recoverable) setup. It's a bit of a trap
because this completes even if COLO_BRANCH_NAME is the name of a colo
branch and not of a file or directory:

mbp@joy% bzr init --format development-colo /tmp/t1
Created a standalone tree (format: development-colo)
mbp@joy% cd /tmp/t1
mbp@joy% bzr.trunk switch -b 1
mbp@joy% bzr branches
* 1
mbp@joy% bzr switch -b 2
Tree is up to date at revision 0.
Switched to branch: /tmp/t1/
mbp@joy% bzr.trunk remove-branch 1
mbp@joy% bzr branches
  1
  2
mbp@joy% bzr st
bzr: ERROR: Not a branch: "/tmp/t1/.bzr/branch/": location is a repository.

This is a bit like <http://pad.lv/876629> and perhaps the same bug.

  bzr remove-branch NAME

I think the cases we need to support are:

1 - remove a colocated branch (by default from the current repo,
probably no default for the branch name)
2 - remove a .bzr/branch directory

I think we could handle 1 with

  bzr remove-branch [-d DIR] COLO_NAME

and it must be a real named branch.

2- The current code is fine but we should probably have some checks
that the user is pointing to the root of a directory and perhaps to a
directory that contains only a branch (not a tree, not a repository).
And, for consistency with #1 (but breaking the ui a bit), we could
have the location named by -d.

What do you think?
--
Martin