I have a subversion repository with the standard layout, i.e. trunk/ and branches/ (and tags/). When working on a bigger change, a feature branch is used, regularly synced with trunk, and later reintegrated back into trunk (using 1.5 now). Pretty standard stuff.
What I am wondering is whether such a feature branch, once finished and merged should be kept around, or deleted. The subversion book occasionally seems to suggest that it is common to delete them, but I've also seen a bunch of Open Source projects which do keep the branches.
I am also somewhat concerned about how deleting a branch will make it harder to keep track of which branches existed, especially when potentially duplicate names enter the scenario (say we search-refactor twice), their commit histories disappearing somewhere in the depth of the repository etc.
On the other hand, branches are used quite a lot, especially with 1.5 now, and I do like the thought of not having to poke through a large list of inactive branches to find the ones I am currently working on.
What are the pros and cons that I am missing? What are people doing?
It depends on what you created the branch for in the first place. A branch is usually used for maintaining a released or soon-to-be-released version of software, so in general, no, you would not delete it.
Right click on the folder and do a "Show Log." Find the revision where you deleted the specific branch folder. Select the revision immediately before that revision. Right click and choose "Browse Repository." You are now looking at the state of the repository at the point in time right before you deleted the branch.
Find the branch folder you want to delete, right-click it, and select "Delete." Enter your commit message, and you're done.
If you are really worried about deleting them, lest they be forgotten, then simply create a folder under branches called 'inactive' and svn move
your older, inactive branches into that folder. This might be the best of both worlds for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With