Ever since I first saw shelving in the new version of Visual Source Safe, I've been somewhat enthralled by it. The first thing I did was figure out how I could do that with Subversion. I started typing an email to the Svn mailing list and then I realized how simple it was to do already. All you need to do is use branches.
Here's how to do it with TortoiseSVN...
- Create a
shelves directory in the root of your repository (alongside the
- If desired, create a subdirectory for each developer on the team to allow shelves to be separated by developer (i.e.
- Update files as needed
- Select the directory that needs to be shelved
TortoiseSVN > Branch/Tag...
- Specify the a new shelved directory for the developer (i.e.
shelves/flanakin/req1234), use the working copy, choose whether or not to switch to that shelf (for further work), and click
You now have shelved code. Other developers can grab that in one of two ways: by switching or simply merging with their existing working copy. Switch if you don't plan on finishing the shelved code; merge if you plan on unshelving it and committing it into the trunk (or another branch).
Man, all these CM code words make it sound worse than it really is. It truly is a simple task, if you've ever branched or tagged with Svn. Same implementation, different concept. I'd love to see the shelving concept be integrated into the Svn docs. The term, "shelving," seems to be new, but the concept is old. Some are referring to it as private branches. Whatever it's called (I like shelving better, tho), it should be in the best practices. Best of luck to those who use it!