Monday, January 5, 2009

Drupal and CVS

CVS is how Drupal developers manage code. It is a tool for managing the revisions and releases of a software project that is being developed by multiple people. In such a project, each developer will create one (or more) separate copies of the code, then make local modifications to fix bugs or add features. After debugging this modified code, the developer uploads it to a server, where it is merged with the other developers' modified code to create the next release of the software. Often, two or more developers will modify the same module at the same time, which creates a big problem when they try to combine their work. It is very easy for one of them to unintentionally overwrite the other's changes.

CVS helps to manage this problem by maintaining a central code repository -- a directory on the CVS server that contains the definitive archive of a project's code, as well as a complete history of that code's development. You can use CVS to download a local copy of the code -- either the very latest version (which is often called HEAD, and is typically very unstable), or one of the earlier, stable versions (which are labelled with tags to identify them). When other developers change the code, CVS can download those changes and update your local copy.

When project maintainers make changes they wish to share, CVS is used to upload and commit them. If your changes threaten to overwrite those of another developer, CVS will warn you and give you a chance to resolve the conflict. And when you make a mistake, CVS can help you recover: you can read a complete log of all the changes to the code since the project began, retrieve versions of files from any time in the past, and generate patch files that summarize the difference between any two versions of the code.

In addition, CVS helps developers stay up to date on the state of the project. For example, the Drupal CVS server will email all CVS commits to all maintainers, automatically informing them of the work you have done.

No comments: