blob: 80f3908a02cb0f086f81689190b38620d900edcd [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
/* <![CDATA[ */ @import "/branding/css/tigris.css"; /* ]]> */
</style>
<script src="/branding/scripts/sc.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="/branding/css/print.css" media="print" />
<title>Using command-line cvs</title>
</head>
<body class="docs" onLoad="self.focus()">
<div class="docs" id="ddusingcvscommandline">
<h2>Using command-line CVS to access project source files</h2>
<div id="toc">
<ul>
<li><strong><a href="/nonav/servlets/HelpTOC">Help index</a></strong></li>
</ul>
<ul>
<li>
<a href="/nonav/docs/ddCVS.html">About source code version control with CVS</a>
<ul>
<li><a href="/nonav/docs/ddCVS_cvsglossary.html">A version control glossary</a></li>
<li>
Using command-line CVS to access project source files
<ul>
<li><a href="#cvsintro">Getting started with CVS</a></li>
<li><a href="#accesscvs">Accessing a project's CVS repository</a></li>
<li><a href="#gettingsource">Getting the source code</a></li>
<li><a href="#cvslog">Viewing file revision history</a></li>
<li><a href="#cvswatch">Watching files in the CVS repository</a></li>
</ul>
</li>
<li><a href="/nonav/docs/ddCVS_cvscontributing.html">Contributing source code changes with CVS</a></li>
<li><a href="/nonav/docs/ddCVS_cvsmanaging.html">Managing project files and directories with CVS</a></li>
</ul>
</li>
</ul>
</div>
<h3><a id="cvsintro" name="cvsintro">Getting started with CVS</a></h3>
<p>If you are participating in a development project on this site, you must use CVS as the versioning control tool for project source files. This the first in a series of three tool documents covering information and commands pertinent to using CVS.</p>
<h3><a id="accesscvs" name="accesscvs">Accessing a project's CVS repository</a></h3>
<p>If you do have CVS login access for a project hosted on this site, first you must set the CVSroot to access the project's source code repository. In your shell or terminal client, type:</p>
<p><code>:pserver:yourlogin@CVS.projectname.domain.com:/home/main_CVS_dir</code></p>
<p>substituting your login and project information.</p>
<p>If you are only working on one project at a time, you only have to set CVSroot
the first time you log in to CVS</p>
<p>If you are participating in more than one project and need to access CVS
repositories located on different servers, you need to set the CVSroot for
each login session access the correct project's source repository.</p>
<p>If you do not have a specific CVS login but wish to look at an open source
project's source repository, you may still be able to log in to CVS as "anonymous"
by typing:</p>
<p><code>:pserver:anonCVS@CVS.projectname.domain.com:/home/main_CVS_dir</code></p>
<ul>
<li><a href="http://cvsbook.red-bean.com/cvsbook.html#Accessing_A_Repository">More
about accessing a CVS repository</a></li>
</ul>
<p>To log in to CVS, use the following command:</p>
<p><code>CVS login</code></p>
<p>Enter your user password when prompted. This should be the same password associated with your user account on this site.</p>
<h3><a id="gettingsource" name="gettingsource">Getting source files</a></h3>
<p>To get a "working copy" of the latest source files, you must check out the source files, a process which copies the files onto your system. First create a directory on your local machine by typing:</p>
<pre>
<code>mkdir my_working_dir (the directory name of your choosing)
cd my_working_dir</code>
</pre>
<p>Then, to check out or copy source file from the repository into your newly created local directory, type:</p>
<p><code>CVS checkout project_name</code></p>
<p>This top-level module would contain the entire source code tree (that is,
the top level directory and any subdirectories) for that part of the project.
There is a fairly common module structure for project CVS repositories initially.
As the project grows, the project's source "tree" also grows as subdirectories
are added to various modules.</p>
<p>To obtain the source code for a particular module called "module-name" within the project named "project_name", specify:</p>
<p><code>CVS checkout module_name/project_name</code></p>
<p><a href="http://cvsbook.red-bean.com/cvsbook.html#Checking_Out_A_Working_Copy">More about checking out a working copy of project files</a></p>
<h3><a id="cvslog" name="cvslog">Viewing file revision history</a></h3>
<p>Anyone with CVS read permission can view individual file histories to track
revision information by typing:</p>
<p><code>CVS log filename</code></p>
<p>The result is a display of the file's revision information, starting with the most current revision, and includes such information as the log message, status, working revision number, and repository revision number.</p>
<ul>
<li><a href="http://cvsbook.red-bean.com/cvsbook.html#Revision_Numbers">More about file revision numbers</a></li>
</ul>
<p><a id="cvsdiff" name="cvsdiff"><span class="HelpTextHeader">Comparing file revisions</span></a></p>
<p>To see the particulars of a file's modifications between two revisions, after
obtaining file revision numbering information from the "<b>CVS log</b>" command's
output, type:</p>
<p><code>CVS diff -r revision_# -r revision_#</code></p>
<p>The entire file contents display with lines from both versions where differences occur marked by revision number.</p>
<ul>
<li><a href="http://cvsbook.red-bean.com/cvsbook.html#Finding_Out_What_You__And_Others__Did_--_update_And_diff">Finding out what you and others did</a></li>
<li><a href="http://cvsbook.red-bean.com/cvsbook.html#diff">More about diffs
and options</a></li>
<li><a href="/nonav/docs/ddCVS_cvscontributing.html">More CVS help: Contributing
your changes</a></li>
</ul>
<h3><a id="cvswatch" name="cvscvswatch">Watching files in the CVS repository</a></h3>
<p>You can turn on the &quot;watch&quot; command to tell CVS that you want to
receive notifications about actions taken on a file. Too add the current user
to the list of people to receive notification of work done on files enter:</p>
<p><code>CVS watch add -a [action] -l [files] </code> </p>
<p>The -a option specifies what kinds of events CVS should notify the user about.
The -a option may appear more than once, or not at all. If omitted, the action
defaults to all. Action is one of the following: </p>
<dl>
<dd>
<dl>
<dt>edit </dt>
<dd>Another user has applied the CVS edit command (described below) to a file.
</dd>
<dt>unedit</dt>
<dd>Another user has applied the CVS unedit command (described below)
or the CVS release command to a file, or has deleted the file and allowed
CVS update to recreate it.</dd>
<dt>commit</dt>
<dd>Another user has committed changes to a file. </dd>
<dt>all</dt>
<dd>All of the above. </dd>
<dt>none </dt>
<dd>None of the above. </dd>
</dl>
</dd>
</dl>
<p>The files and -l option are processed as for the CVS watch commands. </p>
<p>To remove a notification request established using CVS watch add, the arguments
are the same:</p>
<p><code>CVS watch remove -a [action] -l [files]</code></p>
<p>If the -a option is present, only watches for the specified actions are
removed.</p>
<p>When the conditions exist for notification, the users will receive an email
from the SourceCast server notifying them of the action performed on the files
they are watching.</p>
<div class="courtesylinks">
<p><a href="#toc">Top</a> | <a href="/nonav/servlets/HelpTOC">Help index</a></p>
</div>
</div>
</body>
</html>