March 17, 2004
This article was contributed by Caleb Tennis
CVS (Concurrent Versions Systems) (
http://www.cvshome.org) is by far the most widely used source control program in the open source community. Though it tends to suffice for most projects, CVS is considered by many to be antiquated, lacking features and abilities which would be very valuable to most open source projects. Subversion (
http://subversion.tigris.org) is a project which attempts to replace CVS, adding new features where needed, and changing existing functionality only when necessary.
The most notable change for CVS users is Subversion's repository handling of atomic commits. In CVS, every file was individually versioned according to its changes; in Subversion the entire repository is versioned. While conceptually different, the advantage to this change quickly becomes apparent: the entire repository can be returned to a known state. As an added bonus, the addition of special keywords allows one to view changes between file versions quickly without knowing the revision number.
Subversion adds two commands not present in CVS: "move" and "copy". With these, revision histories for files and directories are preserved between location changes. This feature is a boon for most CVS users, who commonly complain about the inability to rename files and directories easily.
In Subversion, branches and tags are nothing more than copies of a directory, making them easier to work with than their CVS counterparts. After becoming accustomed to the concept, one quickly realizes that branches in a Subversion repository are parallel to one another, whereas in CVS the branches feel orthogonal. The branching operation is considerably faster by design, and Subversion's "merge" command is more intuitive than CVS's "update -j".
Additionally, Subversion caches more meta information in the local working copy, eliminating the need for client-server communications for commands like "status", "diff", and the new "revert". Commits are processed by only sending the differences and not the entire file like in CVS, making the commit process considerably faster. Even binary files stored in the repository are handled using a binary diff, making storage more efficient.
Finally, Subversion adds new features that aren't readily available with CVS. Properties, such as MIME types or the execute permission bit can be attached to files. "Hook" scripts can be triggered to run based on certain events, such as a "commit". From the server side, repository control is more fine tuned, and many nice maintenance features have been added, without compromising ease of use.
One of the biggest concerns that many have when considering Subversion is the requirement for Apache2. It is worth noting, however, that Subversion has no requirement for Apache2. It can use the WebDAV protocol through Apache2 for repository access, but also works fine through a standalone server daemon.
These fundamental changes offer newer, and arguably better ways of working with the repository than with CVS. With so many great changes, the authors of Subversion truly have created a viable drop-in replacement for CVS. As more projects start to embrace Subversion for what new features it offers, it is sure to become the new standard for open source project revision control systems.
(
Log in to post comments)