views:

325

answers:

4

I'm using Visual Studio 2k8 with AnkhSVN.

When I start to modify file, it's automatically checkouted. How can I disable it? I don't want to accidentally modify my files.

+2  A: 

Your files will not be modified in your Subversion repository until you check them back in. And even when they are checked back in, you can still roll them back to any previous point.

So, no need to worry about doing something accidentally...that's the whole point of version control!

Michael Hackner
I really like this way of working a lot more, because it's easier to do prototyping without having to lock files for others. I think the "lock" dialog from SourceSafe is more obtrusive than it should be (I always had auto-checkout set), and I certainly wouldn't like my Subversion client to be that obtrusive. I remember Joel Spolky saying in his StackOverflow DevDays keynote "Everytime you show a dialog, you're forcing a user to make a decision". But the decision to start editing the file was already made.
Sander Rijken
@Sander RijkenI think that this option can be useful. For example I've got modified a lot of files in my solution and I switch to another tab (file) to see it and accidentally start typing there - IDE will not inform me about it :(If You think it's obtrusive, it don't have to be default option. You can provide a choice for an user - as it done in TFS (http://www.woodwardweb.com/WindowsLiveWriter/TFSAutomaticCheckout_B26A/Options_2.png)In my company we use TFS - I'm setting Subversion and AnkhSVN for home use - and 'prompt for check out' option prevented a lot of mistakes there.
abso
I like the default of "user edited the file -> mark it as modified" better than being forced to make a decision. You can always discard your changes through either Undo or your source control system.
jnylen
A: 

Open the AnkhSVN Conviguration dialog (Tools->AnkhSVN->Configuration…) and set DisableSolutionReload to True.

There is also an option to do the opposite—to prevent it from automatically adding new files to SVN—that you can disable (setting AutoAddNewFiles to False).

Synetech inc.
Both settings have nothing to do with the question. Furthermore those settings refer to the old AnkhSVN versions, that should only be used for Visual Studio .NET and Visual Studio .NET 2003. Visual Studio 2005 and higher should use 2.0 (or higher) versions.
Sander Rijken
He said *When I start to modify file, it's automatically checkouted.*While others have pondered whether that is a mistake and what he really meant, to me it sounds like his file is being reverted, in which case the setting would be relevant. As for the version, true I only have the older version, but I’m sure there is a similar option in the newer one.
Synetech inc.
+2  A: 

What you call "check-out" just means the file has been marked as modified locally on your machine (without the SVN server knowing anything about it). This is different than say, ClearCase, where the file is actually checked out on the server. So as Michael suggests, you don't really have to worry about it, you can always revert it locally. And if you just use Undo in VisualStudio, the file will again be marked as not modified.

Igor Brejc
+1  A: 

What some of the other answers have hinted at: You don't "checkout" files with SVN. It sounds like you're coming from a ClearCase/SourceSafe mentality. SVN works on a different versioning model. When you "checkout" a working copy, you're pulling down the latest version of the files from the repository. You are free to modify any of them. Once you are done with your edits, you push, "commit" them back to the server.

I could ramble on and on, but instead of botching it, I'll just point you to the de-facto-standard SVN Manual - here's the first chapter which explains the versioning model that SVN uses.

Yoopergeek