Working with Subversion the same as with Visual Source Safe in Visual Studio
Asked Answered
F

3

8

At work I just started using Subversion with AnkhSVN instead of Visual Source Safe. I managed to integrate it well enough but it doesn't seem the same. Using VSS the following would happen:

A user check out a file by right clicking and selecting "check out" or by editing it. If another user tried to modify the same file he would get an error. No 2 users could edit the same file at the same time. No fancy merging. No conflicts and no conflict resolutions.

I understand the the philosophy behind Subversion is different but is there any way that this behavior described above could be duplicated with Subversion?

There is an option in AnkhSVN called "Automatically lock files on change..." but even if I activate this option when I edit a file it never gets automatically locked. Even if this option worked the other users wouldn't see the lock until they commited the file. They wouldn't get an error when they tried to edit it like they would in Visual Source Safe.

So basically: can Visual Source Safe's behavior be duplicated using Subversion and AnkhSVN?

Frolicsome answered 13/3, 2010 at 19:50 Comment(5)
Why would you want to? Subversion was not designed for this kind of process. If you prefer the VSS way of working, why not use VSS?Pensionary
Well, I can't. Subversion was chosen and I had no say in it.Frolicsome
@Thomas: I wouldn't trust my source code to VSS any more. I've seen too many broken databases, and merging changes between branches is really impossible. SVN has adopted a way to communicate un-mergable files that need locking, and AnkhSVN implements this in a way to matches what VSS would do very closely. I'm not trying to get into the SVN vs VSS discussion here though :)Marmoreal
So how do I add "svn:needs-lock" from AnkhSVN or do I have to do it from the Subversion command line?Frolicsome
THe Agent SVN Visual Studio has an option to let you do this. zeusedit.com/agentEmission
V
8

The point of using subversion over source safe is that you don't have exclusive lock and many people can work on the same file.

You are loosing quite a lot of the benefits of SVN if you start using it with exclusive locks on files.

The idea is that you fix conflicts during merges of code.

See this SO question and answers for a bit of a discussion on the issues (Revision control locking: Is the jury still out?).

Versatile answered 13/3, 2010 at 19:56 Comment(0)
E
6

The Agent SVN is a MS-SCCI plugin (just like VSS) for Subversion so it integrates with Visual Studio just like VSS.

It also has a Lock on check out option and with that feature on it does feel a lot like VSS.

Emission answered 29/12, 2011 at 13:39 Comment(0)
M
2

You need to set svn:needs-lock subversion properties on the files that you want to explicitly lock. It's really only recommended for files that cannot be easily merged, like (most) binary files and not on text/code files. Usually text/code files merge great automatically, and when they don't conflicts are usually easy to solve.

AnkhSVN will ask you to take lock the file (same as checkout in VSS) when you attempt to edit it when the svn:needs-lock property is set. If you enable the "Automatically lock files" feature, the lock dialog is suppressed, and you will take a lock on the file without a dialog showing up.

Svnbook explains the differences between a lock-modify-unlock and copy-modify-merge, and the svn:needs-lock behavior is also described

Marmoreal answered 13/3, 2010 at 19:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.