SVN switch - under what conditions can it get broken?
I am compiling a guide for developers that includes instructions on using "svn switch" through tortoisesvn. We want the guide to be as fool-proof as possible.
Developers are switching between different branches that have been created per issue. Generally, the branches are pretty similar but there are a few challenges:
- the directory in SVN is around 1.5GB in size
- there are a large number of unversioned Sitecore files also in the webroot that we don't want to add for various reasons (licensing, additional size, 3rd party files that should be updated separately to svn)
My question is:
- When can SVN switch get itself into a completely broken state? I've read this is possible but haven't been able to replicate it myself
- Assuming we tell developers to always make sure all changes are committed before the svn switch, and we know the branches are not going to be radically different, is there any other best practice steps we should be doing?
- Will the large number of unversioned files hurt us for switching purposes? I know svn ignore would help a lot so they don't clog up the list of modifications. From my tests going from an unversioned to a versioned file is han开发者_Go百科dled nicely should we decide to add one of these files to the repositories
Thanks
Update: Dev Environment
- Laptops using Windows 7
- Visual Studio 2008 with AnkhSVN
- TortoiseSVN for all direct SVN operations
- Using Tortoise for the switch
- Windows server running Apache 2.2 + subversion for the server
I think making sure you're checked in before attempting a switch ensures you're on safe ground should a rescue mission be needed. You don't say what your dev environment is. I'd advocate ensuring VS is not running at the time the switch is done. Are you using AnkhSVN in Visual Studio (or some other plugin for SVN integration)? If you are, and they both support switch, make a policy decision about which one will be used to manage switch operations (sounds like you already chose Tortoise anyhow). I mention this, because I got into a mess recently with Tortoise and AnkhSVN and had to wipe out my working copy to get control again. I didn't lose work, but it cost me a lot of time (a) working out WTF had happened and then (2) recovering by checking out multi-megabytes of code again. To be honest we all need something a lot better than SVN, I've tried many alternatives but they all suck in different ways.
I've seen issues with an SVN switch not completing, it leaves the working copy in a state that has it looking at multiple branches (and/or the trunk). What this means is that you could change a file, thinking you are committing it to one area when in fact you are committing it back to it's original place.
For this reason I always issue an SVN switch until it immediately comes back without any further changes. This has served me well for the past five years.
精彩评论