Using the CVS Client181
Remote access can take several forms. This can be a remote connection from a user’s
machine to the
cvspserver
that runs on port 2401. Another method would be to have CVS
connect via a remote shell (rsh) when the repository needs to be accessed.
CVS access takes place in clear text over the network with no inherent facility to prevent
passwords and data from being intercepted and used by unauthorized persons to access the
server. Several options later in the chapter describe a more secure method of access. One of
those methods is similar to the
rsh
method, but the
CVS_RSH
environment variable is set to the
ssh
instead of the insecure
rsh
command.
6.4.1Local Repositories
In order to work easily and efficiently with CVS, it is necessary to set up a series of envi-
ronmental variables that tell CVS where your CVS repository is, which editor you prefer, etc.
These variables can be set in either the system-wide or user specific files that are read when the
user logs in, or each user may set or change them manually.
The first variable is
CVSROOT
and it tells CVS which repository that you wish to work
with. Assuming that your CVS repository is located on the local machine, simply set the
CVS-
ROOT
variable to the location of the repository.
If your repository resides at “
'/usr/local/cvsroot
”' and you are using
sh
,
bash
,
ksh
or a similar shell, simply insert the following line into your startup file (
.profile,
.bash, etc.
)
export CVSROOT=/usr/local/cvsroot
If you are using
csh
or
tcsh
, insert the following line into your
.cshrc
or
.tcshrc
file:
setenv CVSROOT /usr/local/cvsroot
Should you wish to temporarily work with a different repository, the path to the repository
can be supplied on the command line with the
-d
option, as in this example:
$ cvs -d /usr/local/cvsother checkout BigProject
Once a project has been checked out of the repository, this information is also kept in the
CVS/Root
file in the project directory, as shown below:
$ cat CVS/Root
/usr/local/cvsroot
The information in the
CVS/Root
file takes precedence over the
CVSROOT
variable in
order to ensure that the files are checked back into the same repository that they were checked
out from.
The
CVS/Root
file may be overridden by the
-d
command line option. This allows you
to specifically place the file into a repository other than the one from which it was checked out.
To sum up, which checking a file back into the repository, the CVS root is determined the
following order:
Next Page >>
<< Previous Page
Back to the Table of Contents