***************************************************************************

                      CVS Reference Card
            (Compiled by J.Pety, pety@iram.fr, 2003)

***************************************************************************

Usual commands:
  cvs checkout [file/directory]
  cvs update   [file/directory]
  cvs log      [file/directory]
  cvs status   [file/directory]
  cvs diff     [file/directory]
  cvs commit   [file/directory] [-m""]
  cvs add      [file/directory]
  cvs delete   [file/directory]

Comments:
  - Obtaining quick help:
       cvs --help           ==> general help
       cvs update --help    ==> help about update
  - cvs update 
      * Tells you what you modified compared to the working copy but also 
        retrieves all the changes made in the repository since your last
	update (=> this can make a lot of unwanting changes in your working
	copy).
  - cvs diff -cbBi
      * -c gives context diff which are easier to understand.
      * -bB ignores changes in blank characters or lines.
      * -i ignores changes in case.
  - cvs commit
      * Always takes into account changes in blank characters and/or blank
        lines and/or case.
  - cvs status
      * Allows to know the status of the working copy compared to the
        repository one (Up-to-date or Locally Modified or Needs Patch or
	Needs Merge).
  - cvs log
      * To browse through the log.

***************************************************************************

Reverting:

  File p_cct.graphic revision number is 1.2. I want to revert to revision
  1.1. Here is what I need to do:

     prompt> cvs up -j 1.2 -j 1.1 p_cct.graphic 
     RCS file: /alma/cvs/cvs-test/CVSROOT/sou/p_cct.graphic,v
     retrieving revision 1.2
     retrieving revision 1.1
     Merging differences between 1.2 and 1.1 into p_cct.graphic
     prompt> cvs up
     cvs update: Updating .
     M p_cct.graphic
     prompt> cvs commit -m "Reverted to version 1.1" p_cct.graphic 
     Checking in p_cct.graphic;
     /alma/cvs/cvs-test/CVSROOT/sou/p_cct.graphic,v  <--  p_cct.graphic
     new revision: 1.3; previous revision: 1.2
     done
     prompt> cvs up
     cvs update: Updating .

  Nothing is lost in the process. But remember: Reverting is not a
  substitute for communication!

***************************************************************************

Adding files: a 3 step process

  touch newfile
  cvs add newfile
  cvs ci -m "Added newfile" newfile

***************************************************************************

Adding directories: a 2 step process

  mkdir newdir
  cvs add newdir

***************************************************************************

Removing files: a 3 step process

  rm oldfile
  cvs remove oldfile
  cvs commit -m "Removed oldfile" oldfile

  File is not really removed from the repository. It is stored in a
  subdirectory of the repository named Attic. So no directory in the source
  tree should be named Attic!... You still see in the "cvs log" command but
  not anymore in the cvs "status command".

***************************************************************************

Removing directories: a multi-step process

  cd olddir
  rm file1 file2 file3
  cvs remove file1 file2 file3
  cvs ci -m "Removed all files in olddir" 
  cd ..
  cvs update -P

  This is the last command that really remove the directory from the
  working copy. However the directory stays empty in the repository. This
  is done to permit retrieving of old version of the software where the
  directory was important!

***************************************************************************

Renaming files:

  mv oldname newname
  cvs remove oldname
  cvs add newname
  cvs ci -m "Renamed oldname to newname" oldname newname

***************************************************************************

Renaming directories:

  mkdir newdir
  cvs add newdir
  mv olddir/* newdir/.
  cd olddir
  cvs remove file1 file2 file3
  cd ../newdir
  cvs add file1 file2 file3
  cd ..
  cvs commit -m "Renamed olddir to newdir"
  cvs co -P
  
  Difficult process. The best policy is to come up with a good layout
  before the first commit! 

***************************************************************************

Binary files:

  - CVS does not handle very well binary files because:
      * line end character conversion between UNIX, MAC and WINDOWS OS;
      * keyword expansion.
  - So binary files must be added with a particular flag:
       cvs add -kb file.bin
  - diff does not know how 2 binary files differs. So when a binary file is
    changed everything is copied into the ,v file.
  - There will be problems with merging...

***************************************************************************

Configuration of client-side of cvs: 

  In your home directory, you can create a .cvsrc file inside which you
  will put all the default options you want to use. For instance:

    cvs -q 
    diff -cbBi
    update -P
    checkout -P

  You can also create a .cvsignore file where you put the file you never
  want cvs to make transaction with. For instance:

    work.pc
    work.pcl
    *.aux
    *.idx
    *.ilg
    *.ind
    *.log
    *.out
    *.pdf
    *.toc
    *.hlp
    *-help.tex

  The three first lines represent binary files created by ifc. All other
  lines represent the file created in the documentation processing. To
  help you, an example of .cvsignore file adapted to GILDAS is given in the
  admin/cvsignore file of the distribution.

***************************************************************************

Administrative files in your working copy

  CVS
  CVS/Root          Root directory where the sources under CVS are
  CVS/Repository    Path of the current directory compared to the CVS Root directory
  CVS/Entries       List of files and subdirectories in the current directory
                    The revision number and the UNIVERSAL time of last update is written 

  Other files may appear depending on your activity.

***************************************************************************

