Revision Control

Introduction to source code control

As software projects become larger, it makes sense to move to a team model of development, where a number of programmers work together to design, implement, document, test, and maintain a project. As Fred Brooks observed, adding more developers to a project can increase the costs of communication substantially. One way to reduce these costs is for developers to work semi-independently on the code while remaining aware of, and staying up-to-date with, modifications by other team members. Revision control systems (RCS) like CVS or SVN provide tools to help make this method of team development simpler.

Advantages of revision control



Front-ends to RCS Tools

TortoiseRCS

TortoiseRCS is a Windows program that integrates RCS features into Windows Explorer (the Windows file browser). Files that belong to a RCS working directory have small overlay icons showing their current status (out-of-date, up-to-date, changed in working copy, etc.); by right-clicking on a file or working directory, you can update, commit, view differences, and execute many other RCS commands.

TortoiseRCS is free software: not only is the software available as a free download, but you can also get the source code and make changes yourself. Its homepage is http://www.tortoiseRCS.org/.

Eclipse

The Eclipse IDE has built-in support for RCS. In Eclipse, the Repositories view allows you to select RCS repositories (both local and remote), and check out projects from those repositories. If a project was checked out of a repository, you can right-click on the project or on files in the project to access a number of RCS operations: update, commit, diff, merge, revert to a previous version, and so on.

For more information on using RCS within Eclipse, see the help sections of the Eclipse documentation. You can access the documentation online, or from the Help | Help Contents... menu in Eclipse.

Version-Control Systems

CVS

CVS has, since its introduction in 1986, become the most widely-supported version control system, especially on Unix systems. Some people argue, however, that it is beginning to show its age. In recent years a number of next-generation revision control systems have appeared to address perceived flaws in CVS.

Subversion

Of the next-generation revision control systems, Subversion is the closest to CVS in terms of features and usage. Indeed, many of the subcommands of the svn command-line interface have the same name and syntax as their RCS counterparts. There are, however, a number of improvements, such as better support for copying and renaming files, a separate command for easier three-way merging, more efficient handling of large files and binary files (such as graphics), and many more.

Subversion is available on Multilab. The main web site is at http://subversion.tigris.org/; you can download source code and binaries (including a Windows command-line program) from this site. Also useful is the book Version Control with Subversion, available for free online, and also in paper form. You can also obtain documentation with the svn help subcommand. Finally, TortoiseSVN integrates Subversion into Windows Explorer, much like TortoiseRCS does for RCS. TortoiseSVN is free software, and available for download.

Visual SourceSafe

Visual SourceSafe is a proprietary revision control system by Microsoft that integrates into Visual Studio. More information is available from Microsoft's Visual Studio Developer Center.

Distributed revision control

Even more recently, a new model of revision control has appeared, called distributed revision control. In these new systems, there is no central repository for the code. Instead, each developer's working directory contains history information for that user's changes—like a local repository. To share code, developers exchange "change sets" or "patch sets" amongst one another, using operations such pull (download someone else's patch set) and push (send someone your patch set). Using these patch sets, a developer can merge others' changes into his or her local repository; thus developers can stay up-to-date while working more independently. Distributed revision control is becoming popular for open-source projects such as the Linux kernel.

Notes

  1. Fred Brooks, The Mythical Man-Month. Addison-Wesley, 1995. ISBN 200-201-83595-9.