Igor Chubin
Igor Chubin

Reputation: 64593

How to properly remove a bazaar branch?

How to properly remove a bazaar branch from a repository?

What if I want to remove a branch completely, so it would be impossible to find if this branch existed?

I'm aware of the remove-branch command, but are there any alternatives?

Upvotes: 4

Views: 2334

Answers (2)

bialix
bialix

Reputation: 21473

If you want to ditch the branch, you can just use plain rm -rf branch_name (or similar machinery on Windows, including cleaning Recycle Bin).

Some history still be preserved in shared repository though, and could be found with bzr heads --dead command. If you absolutely need to be sure no hidden history left you need to do something more involved:

# make new empty shared repository
bzr init-repo /path/to/temp-repo
# branch everything from old repo to temp-repo
bzr branch /path/to/old-repo/branch-1 /path/to/temp-repo/branch-1
...
bzr branch /path/to/old-repo/branch-N /path/to/temp-repo/branch-N
# after that you're ready to delete old-repo and replace it with temp-repo
# newly created repo will have only revisions present in active branches

Upvotes: 4

jelmer
jelmer

Reputation: 2450

bzr remove-branch is the easiest way to remove a branch. If you can't use that command, can you mention why not?

You can also just remove the branch directory manually, e.g.: bzr rm -rf .bzr/branch. This will however skip several checks that bzr remove-branch will do.

Upvotes: 4

Related Questions