New branch created accidentally

Eric Siegerman lists08-bzr at davor.org
Wed Jan 26 18:13:13 UTC 2011


On 1/26/2011 3:48 AM, Ewan Milne wrote:
> One specific corner case: if one has a shared repo, location <repo>,
> and a branch below <branch>, then one accidentally pushes to <repo>
> instead of <repo>/<branch>. This results in a new branch created in
> the same location as <repo>, so the new branch can't be removed by
> deleting the directory. I think that deleting the <repo>/.bzr/branch
> directory will remove the branch - is that correct?

Ouch!  I'm surprised that's even possible -- I'd have expected
bzr to complain.  But I've just tested it, and it succeeds.
This behaviour seems dangerous; because it's a corner case that
one won't be expecting, one could easily fall into the trap Ewan
describes, thus accidentally nuking the entire shared repo.

So the question is, is it useful?  If not, I think bzr should
refuse to do it.  Do you agree?

What about with --use-existing-dir?  I lean towards refusing even
then, on the assumption that --use-existing-dir is intended to
let you turn a totally non-bzr (and typically empty) directory
into a branch, not to reconfigure an existing bzr-controlled
directory -- and especially not into something weird and
unexpected.

  - Eric





More information about the bazaar mailing list