TWiki home TWiki > Know > CVS TWiki webs:
Main | TWiki | Know | Sandbox
Know . { Readme | Changes | Index | Search | Go }
CVS Version Management System

For All Users: Accessing the CVS Archive

Preliminary work to start fetching files from the CVS archive

Fetch the files and start working on a project

A CVS Project may contain multiple CVS Modules. Following diagram shows an example.

cvs-repository-setup.jpg
Let's assume that you will be participating in a project called project_ foo and it consists of a single module module_bar. Let's also assume that you will be working on the Linux host supreme and your username on the CVS server mammoth is yasar. Procedure is as follows:

Additional information

Graphical interfaces for CVS

CVS Environment variables

Miscellaneous

For Project Managers: Creating a New CVS Project Repository in the CVS Archive

Assuming you want to create a repository called projname on mammoth granting access to [user1 user2 ... usern]. Note that the specified users must already exist on the system.

Usage Comments

Removing a project

Alternatively, the manual method

For Project Participants: Creating a New Module in a Project Repository

Creating a new module based on existing source code

We will now create a new module based on existing source code in directory /home/user/modname. The module to be added to the repository entitled projname.

  1. Change to the source directory that contains the files of the module, its name is also modname:
    cd /home/user/modname
  2. Import only text files to the repository first:
    cvs -d username@mammoth.ctie.monash.edu.au:/home/cvs/projname import -m "The initial log message for the project" modname ctie start
    (binary files will be added with -kb keyword later).
  3. Change to a test directory to checkout the module
    cd /home/user/temp
  4. Checkout the module
    =cvs -d username@mammoth.ctie.monash.edu.au:/home/cvs/projname checkout modname=
    This should create a new directory /home/user/temp/modname. This directory will contain the checkout version of the module. Inside this directory is a subdirectory called CVS. this allows you to ignore specifying the -d username@mammoth... parameter in future calls to CVS as long as this is the current working directory. If everything is looking OK you can go back to the cd /home/user/modname directory and add the binary files.

Creating a new empty module called modname

  1. Create the source directory that will contain the files of the module, its name will be also modname.
  2. Go to that directory, say
    cd /home/user/modname
  3. Import this empty module into the project projname:
    cvs -d username@mammoth.ctie.monash.edu.au:/home/cvs/projname import -m "The initial log message for the project" modname ctie start
  4. Go to the parent directory: cd ..
  5. Checkout the new module:
    cvs -d username@mammoth:/home/cvs/projname co modname
  6. You can now create new files or copy files into the checked-out directory.
  7. Import the new text files into the module repository:
    cvs add textfilename1 textfilename2 ....
  8. If you have binary files (gif, jpeg images for example), use this command:
    cvs add -kb binaryfilename1 binaryfilename2 ...

CVS Command Reference

Command Summary

cvs -H <command> Display options for command

Branching

Make sure the module is in stable state and no one is going to check things in.

  1. cvs tag -b <branch_name>
  2. cvs co -d <new dir> -r <branch_name> <module path> This will check out a copy at the branch point so you can start working in that branch. Any commits you do in <new dir> will increment the branch's revision. Others can continue working on the trunk.
    Alternatively cvs -q update -r <branch_name> will modify the current directory to be part of the branch.

Another possible branch command is cvs rtag <branch_name> <module_name>. This does not require a working directory at all and will create a branch out of the latest sources in the repository.

Merging

Once you've decided the code needs merging back to the trunk do in the latest working copy not the branch working dir

  1. cvs update -d -j <branch_name> This merges all changes on that branch onto the trunk. Conflicts will have to be resolved before committing the merges back onto the trunk.
  2. cvs tag <tag_name> in the branches copy. This is required if you want to continue working from the same branch after the merge. This way you can merge the changes from this point to the trunk. You need two -j options with the previous command to effect such a merge the first -j is the <tag_name> with the second been the <branch_name>.

Retrieve previous revision

To retrieve just a single file without overwriting your changes
  1. cvs -Q update -p -r <revision no> <file> > <new filename>
  2. cvs update -A <file> Revert back to the latest (HEAD revision) after applying the above command(removes the sticky tag).

Creating a patch

The following command does not require a working directory (sandbox in cervisia's terminology).

  1. cvs rdiff -u -D 20011030 -D 20020130 <module> > diffoutput.txt Creates the patch file diffoutput.txt. This can be applied with patch -p1 < diffoutput.txt in the directory with version as at 20011030 and will bring it up to the version on this date 20020130.
  2. cvs diff -r <Tag> Execute this from the working directory to create a patch against a branch or tag name. Useful to compare current changes from a previous reference point in development.

Tagging

The following command when run from a working directory will tag exactly the checked out versions with the tagname supplied. Thus if there are newer revisions in the repository those revisions will NOT be tagged.

  1. cvs tag <tagname>

CVS Bibliography

Attachment: Action: Size: Date: Who: Comment:
mkcvsproj action 5040 29 Jul 2003 - 08:14 BrettPentland Removed code that adds CTIE staff to project
rmcvsproj action 2969 31 Mar 2002 - 06:55 AhmetSekercioglu  

Topic CVS . { Edit | Attach | Ref-By | Printable | Diffs | r1.28 | > | r1.27 | > | r1.26 | More }
Revision r1.28 - 27 Jan 2006 - 04:19 GMT - AhmetSekercioglu
Parents: WebHome
Copyright © 1999-2003 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback.