Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference betweeb subversion and cvs

 
Mary Wallace
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Author,

How subversion is diff from CVS
 
Jeff Machols
author
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mary - There are a couple of key things that make Subversion better than CVS. First, directories along with branches, tags, properties (labels) are all versioned. So you can get the entire repository back in the exact state include the meta-data and directory structure.

The second big improvment is atomic commits. I will attach an expert from an article about this:

One of the biggest and most powerful enhancements in Subversion is the concept of atomic commits. Logically, CVS treats a commit as a set of individual checkins, one for each file changed. Each file has its own incremental revision number and log message. Subversion treats each commit as one change to the repository and has a global reversion number. This is the part of Subversion that takes some getting used to. The reversion number on a file or entry in the repository is on a per-commit basis, not per-file. The global reversion number starts with 0 and is incremented as a whole number for each commit on the repository. Each entry changed for that commit will have it�s new revision number set to the global revision number. In Subversion, revision numbers in a file are not necessarily sequential (1.1, 1.2, 1.3). Your revision numbers will look more like: r1, r10 ,r25. Since a commit is treated as a new snapshot of the repository, it will capture adds, moves and copies of objects as well as changes to an object. This is a powerful mechanism that enables you to retrieve the state of the repository at any given time with extreme ease. To illustrate the revision numbering, consider the following sequence of events:

�A new repository is created. Two files, foo.c and bar.c are created and committed
�You make a change to foo.c and commit
�Someone else makes a change to both files and commits

Now look at the logs for the two files. Since foo.c was changed each time a commit was done on the repository, it will have a log entry for each revision. The file bar.c was not changed during the commit of revision 2, so it will not contain a log entry for r2.

$ svn log bar.c
------------------------------------------------------------------------
r3 | alex| 2004-02-25 14:14:31 -0500 (Wed, 25 Feb 2004) | 2 line
Added license header to all files
------------------------------------------------------------------------
r1 | jeff | 2004-02-25 14:12:51 -0500 (Wed, 25 Feb 2004) | 2 line
initial version


$ svn log foo.c
------------------------------------------------------------------------
r3 | alex| 2004-02-25 14:14:31 -0500 (Wed, 25 Feb 2004) | 2 lines
Added license header to all files
------------------------------------------------------------------------
r2 | jeff | 2004-02-25 14:13:16 -0500 (Wed, 25 Feb 2004) | 2 lines
Added main function
------------------------------------------------------------------------
r1 | jeff | 2004-02-25 14:12:51 -0500 (Wed, 25 Feb 2004) | 2 lines
initial version
------------------------------------------------------------------------

Revision 2 of the repository will contain a version of bar.c, it will just be identical to r1. Since the identical copies are links inside the repository, it does not use extra space. In fact, Subversion is actually cheaper in terms of storage than CVS because the revision numbers and log messages are stored once globally, instead of one per file. This also makes modifications to log messages easier because it only needs to be changed in one place.
 
Siripa Siangklom
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Subversion, being designed with the network in mind, allows many functions to be performed off-line. This includes "tagging" and "branching", as well as copying, status, and diffs. CVS had no off-line commands.
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This part of subversion is quite unknown for me. Can you detail a little bit what offline mode would be?

--
./pope
[the_mindstorm]
 
Jeff Machols
author
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Subversion will allow you to run commands directly on the repository from the local machine, so you do not have to have a working copy.
 
Siripa Siangklom
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Appendix A in Version Control with Subversion.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic