quick.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

   

space.gif

   

space.gif

  ../images/main/bullet_green_ball.gif CVS Quick Start

To help you get up to speed quickly using CVS, this chapter explains the most common CVS operations. The commands and examples in this chapter are based on standard situations and cover only the most common options.

   

space.gif

  ../images/main/bulllet_4dots_orange.gif Installing CVS

For Linux distribution, CVS is installed by default, in case it is not installed. Just the start the software manager and install CVS.

   

space.gif

If you want the difficult way, you can always get the CVS source and compile it and install it.

   

space.gif

   

space.gif

  ../images/main/bulllet_4dots_orange.gif Creating a repository

To set up a CVS repository, first choose the machine and disk on which you want to store the revision history of the source files. CPU and memory requirements are modest, so most machines should be adequate. To create a repository, run the CVS init command. It will set up an empty repository in the CVS root specified in the usual way. For example,

   

space.gif

cvs -d /usr/local/cvsroot init

   

space.gif

cvs init is careful to never overwrite any existing files in the repository, so no harm is done if you run cvs init on an already set-up repository.

   

space.gif

  ../images/main/bulllet_4dots_orange.gif Adding projects to repository

When you begin using CVS, you will probably already have several projects that can be put under CVS control. In these cases the easiest way is to use the import command. An example is probably the easiest way to explain how to use it. If the files you want to install in CVS reside in `wdir', and you want them to appear in the repository as `$CVSROOT/asic-world/rdir', you can do this:

   

space.gif

$ cd wdir

$ cvs import -m "Imported sources" asic-world/verilog verilog first

   

space.gif

Unless you supply a log message with the `-m' flag, CVS starts an editor and prompts for a message. The string `verilog' is a vendor tag, and `first' is a release tag. They may fill no purpose in this context, but since CVS requires them they must be present.

   

space.gif

You can now verify that it worked, and remove your original source directory.

   

space.gif

 $ cd ..
 $ cvs checkout asic-world.com/rdir       
 $ diff -r wdir asic-world/rdir
 $ rm -r wdir
   

space.gif

Erasing the original sources is a good idea, to make sure that you do not accidentally edit them in wdir, bypassing CVS. Of course, it would be wise to make sure that you have a backup of the sources before you remove them.

   

space.gif

The checkout command can either take a module name as argument (as it has done in all previous examples) or a path name relative to $CVSROOT, as it did in the example above.

   

space.gif

It is a good idea to check that the permissions CVS sets on the directories inside $CVSROOT are reasonable, and that they belong to the proper groups.

   

space.gif

If some of the files you want to import are binary, you may want to use the wrappers features to specify which files are binary and which are not.

   

space.gif

  ../images/main/bulllet_4dots_orange.gif Checking Out files

Create or update a working directory containing copies of the source files specified by modules. You must execute checkout before using most of the other CVS commands, since most of them operate on your working directory.

   

space.gif

Depending on the modules you specify, checkout may recursively create directories and populate them with the appropriate source files. You can then edit these source files at any time (regardless of whether other software developers are editing their own copies of the sources); update them to include new changes applied by others to the source repository; or commit your work as a permanent change to the source repository.

   

space.gif

   

space.gif

Checkout Options

   

space.gif

Option

Description

-D date

Use the most recent revision no later than date. This option is sticky, and implies `-P'.

-f

Only useful with the `-D date' or `-r tag' flags. If no matching revision is found, retrieve the most recent revision

-k kflag

Process keywords according to kflag. his option is sticky; future updates of this file in this working directory will use the same kflag. The status command can be viewed to see the sticky options.

-l

Local; run only in current working directory.

-n

Do not run any checkout program

-P

Prune empty directories.

-p

Pipe files to the standard output.

-R

Checkout directories recursively. This option is on by default.

-r tag

Use revision tag. This option is sticky, and implies `-P'.

-A

Reset any sticky tags, dates, or `-k' options.

-c

Copy the module file, sorted, to the standard output, instead of creating or modifying any files or directories in your working directory.

-d dir

Create a directory called dir for the working files, instead of using the module name. In general, using this flag is equivalent to using `mkdir dir; cd dir' followed by the checkout command without the `-d' flag.

-j tag

With two `-j' options, merge changes from the revision specified with the first `-j' option to the revision specified with the second `j' option, into the working directory. With one `-j' option, merge changes from the ancestor revision to the revision specified with the `-j' option, into the working directory. The ancestor revision is the common ancestor of the revision which the working directory is based on, and the revision specified in the `-j' option.

-N

Only useful together with `-d dir'. With this option, CVS will not "shorten" module paths in your working directory when you check out a single module.

-s

Like `-c', but include the status of all modules, and sort it by the status string.

   

space.gif

Example

   

space.gif

%cvs co asic-world/verilog

   

space.gif

   

space.gif

   

space.gif

   

space.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

  

Copyright © 1998-2014

Deepak Kumar Tala - All rights reserved

Do you have any Comment? mail me at:deepak@asic-world.com