How Can I Use CVS?

CVS is your friend. CVS is a great tool for maintaining source code. Using CVS, you can keep track of changes you've made and revert back to a previous version of the code, if needed.

CVSWeb is a good friend of CVS.

Getting Started

Importing Source into the Repository

Checking Out Code from the Repository

Committing Changes to the Repository

Tagging a Group of Changes

Tagging lets you group files to create a snapsnot of a certain point in time. You can then checkout files based on this tag (by using the tag name in place of the revision).

Merging in a New Vendor Release

First, read up on the process. Useful links:

The basic idea is to import the new vendor source into the vendor branch and do a three-way merge (diff of original source and new vendor source get merged into your changed code).

Here's what I did to merge in ns-2-snapshot-20010903 into my modified source (ns-packmime), which was based on ns-2.1b8:

Making Patches

CVS makes it really easy to create a patch from one revision to another. I wanted a patch from ns-2.1b8 to my current changes, I wrote create-patch.csh. To apply these patches, I used

Here's what I did before (the new scripts are WAY easier!):

[~clark/src/ns-2.1b8]% cvs commit
[~clark/src/ns-2.1b8]% cd ..
[~clark/src]% cvs patch -kk -R -r NS_2_1B8 -D now ns-2 > packmime.patch

One problem I had was that the patch didn't work in directories below ns-2.1b8. So, I cut apart packmime.patch and created a patch file for each directory that needed patching. (This is also why I created the script to make the patch.)

Misc Commands

Useful Links


Other DiRT documents
Author: Michele Weigle