Chapter 17. Managing Source Code with CVS

By David Sweet

In This Chapter

The open nature of the KDE project is reflected not only in the fact that the source code is freely distributed, but in the way it is distributed. The project uses CVS, the Concurrent Versions System, to maintain a source-code repository and keep the most up-to-date versions of the development code continuously available for download by interested parties.

17.1. What Is CVS?

CVS, the Concurrent Versions System, is used by the KDE project to manage the KDE source code—source code that is being developed by programmers around the world. The official version of the code is kept on the CVS server. KDE developers can download the portions of code that they are interested in, make changes, and upload the modified code to the server using the cvs utility.

CVS is released under the GNU General Public License, the same license used by KDE applications. Information about CVS is available from You may also find links to source and binary distributions there, although the CVS client, cvs, is included in popular Linux distributions and may already be on your system.

The features offered by CVS are appropriate for distributed computing. When users wish to make changes to files, the system saves only the changes the user has made rather than replacing the original file. Every change to a file increments its version number. This means that changes can be reversed. It also means that a virtual snapshot of the source code can be saved with minimal effort; CVS needs to keep a record only of the current version numbers for the files included in the snapshot. The snapshot can then be accessed by reverting all the files to their recorded version numbers. CVS can also maintain more than one development "branch" using this versioning system so that multiple versions of a piece of software can be developed in parallel.

Because it makes the process of distributed development simpler, CVS is used by many free software projects other than KDE. The list includes GIMP, Mozilla, XEmacs, Python, and DES Cracker.

17.1.1. The Role of CVS in the KDE Project

The core KDE code is kept in CVS (note that the term "CVS" is used colloquially to refer to the source-code repository as well as the software used to maintain it). This includes the KDE libraries and applications distributed with KDE. Also in CVS are KOffice, an office suite, KLyX, a GUI for the LaTeX typesetting system, and applications being developed for future versions of KDE.

The KDE CVS is also used to maintain two KDE Web sites,, and Keeping the Web site in CVS allows developers to add and update documentation. Having many maintainers means that the Web site can be kept larger and more up-to-date.

This same philosophy applies to the source code (indeed, the primary function of CVS is to maintain software). If you have many programmers downloading, examining, improving, and debugging the most current source, the code improves and everyone benefits. This may lead to some duplicated effort or occasional source-code conflicts because more than one developer may have a piece of code checked out at one time. Experience has shown that these small problems associated with having many developers are more than made up for by the large volume of high-quality code that is produced.