Fred Hamilton
Fred Hamilton

Reputation: 697

What version control system is best designed to *prevent* concurrent editing?

We've been using CVS (with TortoiseCVS interface) for years for both source control and wide-ranging document control (including binaries such as Word, Excel, Framemaker, test data, simulation results, etc.). Unlike typical version control systems, 99% of the time we want to prevent concurrent editing - when a user starts editing a file, the pre-edit version of the file becomes read only to everyone else.

Many of the people who will be using this are not programmers or even that computer savvy, so we're also looking for a system that let's people simply add documents to the repository, check out and edit a document (unless someone else is currently editing it), and check it back in with a minimum of fuss.

We've gotten this to work reasonably well with CVS + TortoiseCVS, but we're now considering Subversion and Mercurial (and open to others if they're a better fit) for their better version tracking, so I was wondering which one supported locking files most transparently. For example, we'd like exclusive locking enabled as the default, and we want to make it as difficult as possible for someone to accidentally start editing a file that someone else has checked out. For example when someone checks out a file for editing, it checks with the master database first even if they have not recently updated their sandbox. Maybe it even won't let a user check out a document if it's off the network and can't check in with the mothership.

Upvotes: 6

Views: 1848

Answers (8)

3264
3264

Reputation: 371

I know it's not on your list, but we have been happy with Perforce. You can prevent multiple checkouts with

Your Perforce administrator can use the p4 typemap command to ensure that all files of a specified type (for instance, //depot/.../*.gif for all .gif files) can only be opened by one user at a time. See the Perforce Command Reference for details.

Upvotes: 5

Jim T
Jim T

Reputation: 12416

I don't think any distributed version control, like mercury or git, is going to work for you here. SVN has only the most basic features for locking - and the file is set readonly, which in the likes of some office tools, means you can edit it, then find you can't save it until you check it out, then you check it out only to find that the server version was different, and you either loose the server version or your local version.

I can't believe I'm saying it, but if you want to work that way, then visual source safe is the only system I know of designed like that. If you want a more modern/reliable version, look at sourcegear's Vault - although they went to great efforts to make something that looked like vss but worked well in an svn like environment.

But perhaps a dedicated document management solution would be better - or perhaps even something like portal server.

Upvotes: 0

nimrodm
nimrodm

Reputation: 23809

The original RCS. When checking out a file, you lock it: "co -l filename". Thereafter, until you check it back in ("ci filename"), no one can alter the file.

Upvotes: 0

Martin Geisler
Martin Geisler

Reputation: 73778

You mention Mercurial, and despite being a Mercurial developer, I must agree with the suggestions to use Subversion. Mercurial is all about letting people develop in a distributed fashion. This includes making private commits which are only shared with others at a later time. In other words -- Mercurial makes no attempt to lock files on a central server (there is not even a concept of a central server).

Go with Subversion, it is as fine a centralized revision control system that you'll find (I have only tried the open source systems, I don't know anything of closed source systems). If you want, you can still experiment with hgsubversion "on the side".

Upvotes: 2

Tobias Langner
Tobias Langner

Reputation: 10808

I know IBM ClearCase prevents that. We use it for that reason in our company.

Upvotes: 1

Arne Burmeister
Arne Burmeister

Reputation: 20594

Subversion offers enforced locking. When the Propoerty svn:needs-lock is set, the file is checked out read-only and the user needs to lock it to get an writable working copy. No other user can get the same file locked from there.

Upvotes: 10

D'Arcy Rittich
D'Arcy Rittich

Reputation: 171421

Sounds like Subversion with TortoiseSVN would fit the bill. As Arne Burmeister mentioned, you can default it to needs-lock mode, where every file checked-out will be read-only until you get a lock on it. Through the use of hooks you can have it notify other users when a file is locked or unlocked.

TortoiseSVN integrates with Windows explorer so requires little computer savvy.

Note that Subversion has a "steal lock" feature, but you can disable this if you wish through the use of the PreLock hook.

Upvotes: 4

Allov
Allov

Reputation: 1328

If it's only documents (like word, excel, etc.) you could have a look at Alfresco's Document Manager, it's pretty simple to use.

http://www.alfresco.com/products/dm/features/

Upvotes: 0

Related Questions