Michael Flanakin's Web Log

Comments and complaints on software and technology in general

  Home  |   Contact  |   Syndication    |   Login
  159 Posts | 18 Stories | 89 Comments | 530 Trackbacks

News

This weblog is no longer being maintained. For the latest, check out www.michaelflanakin.com!

Article Categories

Archives

Post Categories

Image Galleries

Miscellaneous

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...

  1. Create a shelves directory in the root of your repository (alongside the branches, tags, and trunk directories)
  2. If desired, create a subdirectory for each developer on the team to allow shelves to be separated by developer (i.e. shelves/flanakin/)
  3. Update files as needed
  4. Select the directory that needs to be shelved
  5. Select TortoiseSVN > Branch/Tag...
  6. 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 OK
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!

posted on Friday, December 02, 2005 8:52 AM

Feedback

# Subversion Shelving 1/3/2007 9:58 PM Eden Ridgway's Blog
Subversion Shelving

# re: Shelving in Subversion 4/6/2007 2:08 PM Scott S. McCoy
svn diff > ~/patches/my-shelved-patch.diff

# re: Shelving in Subversion 6/16/2007 10:44 AM JGP
Is there a way to store the my-shelved-patch.diff and then apply the diff file back to the files in the folder?

Like unshelving a shelveset in TFS?

Thanks,
JGP (an SVN noob)

# re: Shelving in Subversion 6/17/2007 10:24 PM Michael Flanakin
The equivalent to unshelving would be merging.

Post Feedback

Title:
Name:
Email: (never displayed)
Url:
Comments: 
Please add 8 and 6 and type the answer here: