SVN: Working with branches using the same working copy
- by uXuf
We've just moved to SVN from CVS. We have a small team and everyone checks in code on the trunk and we have never ever used branches for development.
We each have directories on a remote dev server with the codebase checked out. Each developer works on their own sandbox with an associated URL to pull up the app in a browser (something like the setup here: Trade-offs of local vs remote development workflows for a web development team).
I've decided that for my current project, I'll use a branch because it would span multiple releases. I've already cut a branch out, but I am using the same directory as the one originally checked out (i.e. for the trunk).
Since it's the same directory (or working copy) for both the branch and the trunk, if for e.g. a bug pops up in the app I switch to the trunk and commit the change there, and then switch back to my branch for my project development.
My questions are:
Is this a sane way to work with branches?
Are there any pitfalls that I need to be aware of?
What would be the optimal way to work with branches if separate working copies are out of the question?
I haven't had issues yet as I have just started doing this way but all the tutorials/books/blog posts I have seen about branching with SVN imply working with different working copies (or perhaps I haven't come across an explanation of mixed working copies in plain English).
I just don't want to be sorry three months down the road when its time to integrate the branch back to the trunk.