Common CVS commands

From IGSTK

Jump to: navigation, search

Contents

CVS Command

CVS (Concurrent Version System) is the tool used in IGSTK, and many other open source projects, in order to implement revision control during the developement of the software. Developers must become familiar with the basic commands of CVS in order to take good advantage of its features. For a full account of CVS and its features please refer to the excellent book

   Open Source Development with CVS, 3rd Edition


List of commonly used commands

How to tag the repository

This is typically done just before a release, or whenever a major change is about to occur in the toolkit.

This is mostly a task for developers, users of the toolkit should not be concerned about this process.

Update the current checkout

The first step for tagging a repository is to make sure that your local checkout is up to date and that it does not have any locally modified files. In order to ensure that you should cd in to your local checkout and use the CVS command:

  cvs -q update -d -P -A

Where the options are:

  • q = quiet
  • P = pruning remove empty directories
  • D = add new directories
  • A = remove sticky tags (particularly important if you do this on the source tree used for nightly builds)


Build the current version

Go to the binary directory where you are building this source tree and update the configuration, then run an experimental build. This can be done with:

   ctest -D Experimental

Wait until the build is completed and submitted to the Dashboard. Then go to the Dashboard and Roll it up. If the build appears green in the refreshed Dashboard, then you are cleared for tagging the repository.


Set the CVS Tag

Note that the policy of tagging involves two stages. First we tag the development phase by using a tag such as "Release-Iteration-5-Sandbox-Phase", this label is used for tagging both the main IGSTK library and the IGSTK Sandbox. The importance of tagging both with the same label is due to the fact that the Sandbox needs to be built against a compatible version of the main IGSTK library.

Once code reviews and fixes have been completed, we proceed to tag the release phase with a label such as "Release-Iteration-5". Again, this label will be applied to both the IGSTK main library and the IGSTK Sandbox.

The command used for tagging will be

  cvs tag Release-Iteration-5 

and this command should be typed at the top directory of both the IGSTK library and the top directory of the IGSTK Sandbox.

How to a generate a downloadable tarball file

To generate a downloadable tarball file, first checkout IGSTK code with no CVS tags and directories in it. For example, to generate a downloadable tarball for Release-Iteration-5, use the following commands

  cvs -d :pserver:user-name@public.kitware.com:/cvsroot/IGSTK export -r Release-Iteration-5 -d IGSTK-Release-5 IGSTK
  tar -zcvf IGSTK-Release-5.tgz IGSTK-Release-5
  

Similarly, to generate downloadable tarball for the Sandbox, use the following commands

  cvs -d :pserver:user-name@public.kitware.com:/cvsroot/IGSTK export -r Release-Iteration-5 -d Sandbox-Release-5 Sandbox
  tar -zcvf Sandbox-Release-5.tgz Sandbox-Release-5

How to checkout a particular release

This is fundamental for developers who are using IGSTK as and elelment of their applications. FDA regulations require applications for medical devices to have a clearly defined procedure for enforcing the consistent use of versions of third party libraries.


The first thing needed for checking out a specific release is to know the TAG used for that release. The tag is passed to the "cvs update" command. In the following example we illustrate the set of commands needed for checking out IGSTK for the first time.

First, mover to the directory where you what the IGSTK subdirectory to be created. The type the following CVS command.

 cvs -d :pserver:anonymous@public.kitware.com:/cvsroot/IGSTK login

To the password question replay with "igstk" in lower case.

 password:   igstk

As an "anonymous" user you are entitled to get read-only access to the source code in the repository. It is a common misconceptions for outsiders of the Open Source

 cvs -d :pserver:anonymous@public.kitware.com:/cvsroot/IGSTK co IGSTK
 cd IGSTK
 cvs update -r Release-Iteration-1
 cd ..
 cvs -d :pserver:anonymous@public.kitware.com:/cvsroot/IGSTK co Sandbox
 cd Sandbox
 cvs update -r Release-Iteration-1


How to Export in order to prepare tarballs

The following commands were used for Exporting from the CVS repository. The advantage of "Export" with respect to "Checkout" is that export removes all the CVS directories.

In order to Export the basic IGSTK library you can use the command

 cvs -d :pserver:anonymous@public.kitware.com:/cvsroot/IGSTK export -r Release-Iteration-1 IGSTK


In order to Export the Sandbox module you can use the command

 cvs -d :pserver:anonymous@public.kitware.com:/cvsroot/IGSTK export -r Release-Iteration-1 Sandbox
Personal tools
TOOLBOX
LANGUAGES