Suresh - CVS vs VSS

Concurrent Version System vs Visual Source Safe

I think lot of users are confused when they shift from VSS to CVS and I thought of putting the main differences in a simple way.

Most companies in India are still using VSS where my client in Japan is using CVS. Most people complain about CVS when they first start using it because they simply compare with VSS , but will start liking it once they get used to it. I really love CVS because this gives better control and freedom for the developer.

VSS

  1. VSS always gives a server side view of the source even in your client machine.
  2. VSS always allow a single user to edit/modify a particular file. For other users, the source becomes read only. i.e., if one user start modifying a file, it is locked in the server.
  3. Intended for use within a small team of members. While one guy is doing modifications to a file, others have to wait unless he commits the changes to the server

CVS

  1. CVS always gives a client side view of the source. It won't let you know what has changed in the server unless otherwise you query (run a update command) to the CVS Server.
  2. CVS allows multiple users to edit/modify the file at the same time. i.e. it serves on the First Come First Serve basis. Any number of users can modify the file but only the first one to commit the changes to the server will be allowed.
  3. Supports huge volume of users sitting in various parts of the world. No need to wait for one guy but anybody who does the modifications early can commit the changes to the server.

How CVS Behaves

User 1

Local version Server version
1.0 1.0

User 2

Local version Server version
1.0 1.0

Say User 1 and User 2 have taken version 1.0 and start doing modifications simultaneously.

Say our sample file is sample.java

Scenario 1 : User 1 has modified sample.java from line 10 to 15

User 2 has modified sample.java from line 20 to 30

User 1 commit the changes to the server flawlessly and now the server version will change to 1.1

User 1

Local version Server version
1.1 1.1

User 2

Local version Server version
1.0 1.0

Now when User 2 tries to commit the changes to the server, the server will check the version of User 2 with its own. since his version is older than the current version in the server, it throws error 1 and complains that the source can't be commited.

Now User 2 has to update his local copy from the server by running the "update" command. The server will modify User 2's local copy and merge the differences flawlessly since the modifications are done in different places.

User 2 can now commit the new changes by simply running "commit" query.

Scenario 2 :

User 1 has modified sample.java from line 10 to 15

User 2 too has modified sample.java from line 10 to 15

Here also the server will merge the differences but will throw a conflict and puts >>>>> marks stating the area of conflict.

Now User 2 should remove the conflict and then only he can "commit" the changes to the server.