Small CVS User Guide


This is just a guide for those who want to use CVS for the first time, or that may have forgotten some CVS commands. If you really want to take advantage of all CVS power, take a look at the CVS home page.

The CVS most commonly used commands are:

1. Download a module

Nowadays tol-project has the next modules avaliable: tol, toltcl, tolbase and toldoc.
To download any of them you need to use the checkout command:

cvs -z4 checkout -r HEAD moduleName

The -r option tells the CVS which revision to download. If no -r option is given, then the main HEAD will be downloaded.

cvs -z4 checkout moduleName

To download the branch called TOL-REL-1-1-5_BRANCH_20070220 of the module tol use the following command:

cvs -z4 checkout -r Tol_1_1_10 tol

2. Download an entire sub-directory within a module

Under some circumstances you might want to work with certain module's sub-directories.
To download only certain directories within a module you need to use the -l option, so that you will only download the files directly hosted under that directory.

cvs -z4 co -l tol
cvs -z4 co -l tol/bdat

The first command downloads the root directory contents of the tol module, but with no recursivity. The second command will download the bdat directory and will store it under the tol/bdat directory.

3. Downloaded code update

The source code you download from the CVS might be beeing modified by another member of the Tol Development Team.

The modified source code, after being tested is sent to the repository. You have another command to update the source code you downloaded:

cvs -z4 update -P -d tol

If you are on the directory you want to update, you don't need to specify it:

cvs -z4 update -P -d

The -P option forces all empty directories to be deleted. The -d option forces all new directories in the CVS to be created locally.

4. Save changes to the repository

To save the changes to the repository so that they will be avaliable for all CVS users, you have to use the commit command:

cvs -z4 commit filename

Where filename is the file name we are posting into the CVS. Of course, you can save a file list using just a sentence:

cvs -z4 commit filename1 path2/filename2 path3/filename3 ...

Once the command has been executed you will be asked for a short description of the changes you are saving into the CVS. All changes MUST have a short description of all changes. You can specify the description directly in the CVS command:

cvs -z4 commit -m "set macros *_C_DECLS to use C functions with C++ code" tol_bcommon.h

Important:
Please remember that the commits must allways include an english description. Otherwise that work would have to be done by the administrators, and they probably will cancel all your changes and ask you for the complete command.

You can set the environmental variable EDITOR or CVSEDITOR pointing to your favourite text editor to be called when asking for the description.

5. Adding a file

Adding the file filename.cpp to the directory dir:

cd dir
cvs add filename.cpp
cvs commit -m "explanatory comment" filename.cpp

Until the cvs commit command is executed, the new file will not be avaliable on the CVS repository.

6. Removing a file

Removing the filename.cpp from the dir directory:

cd dir
rm filename.cpp
cvs remove filename.cpp
cvs commit -m "explanatory comment"

7. Adding a directory

If you need to add a file to the repository but this file is under a new directory called dirname, follow this steps:

cvs add dirname
cd dirname
cvs add filename.cpp
cvs commit -m "explanatory comment"

Note that you can not add an empty directory into the CVS.

8. Removing a directory

To remove a directory from the repository you must first remove all it's contents:

cd tol/dirname
rm filename.cpp
cvs remove filename.cpp
cvs commit -m "explanatory comment"

Now remove the file filename.cpp as explained above, and remove the directory afterwards:

cd ..
cvs update -d -P

The last command will remove locally the dirname directory.

9. Save user preferences

The CVS offers the posibility of saving the most used options in a resource file, ~/.cvsrc. We recommend using the next values in that file:

cvs -z4
diff -u
update -dP
checkout -P

The first line indicates that the -z4 option (fourth level compression) will be applied every time the cvs command is used.
The second line forces the cvs diff output to be unidiff-compilant, easier to parse than the standard output.

The -dP options forces to update the directory tree when updating
The -P option indicates that empty directories will not be downloaded.

Install from Sources under Linux

Languages

Inicio de sesión de usuario

sponsored by

profit.pngminitc.png

Distribuir

Distribuir contenido