Essay Preview: Cvs
Report this essay
Introduction to CVS
What is CVS for?
CVS maintains a history of a source tree, in terms of a series of changes. It stamps each change with the time it was made and the user name of the person who made it. Usually, the person provides a bit of text describing why they made the change as well. Given that information, CVS can help developers answer questions like:

Who made a given change?
When did they make it?
Why did they make it?
What other changes did they make at the same time?
How to use CVS — First Sketch
Before discussing too many vague terms and concepts, lets look over the essential CVS commands.
Setting your repository
CVS records everyones changes to a given project in a directory tree called a repository . Before you can use CVS, you need to set the CVSROOT environment variable to the repositorys path. Whoever is in charge of your projects configuration management will know what this is; perhaps theyve made a global definition for CVSROOT somewhere.

In any case, on our system, the CVS repository is `/u/src/master. In that case, you would need to enter the commands
setenv CVSROOT /u/src/master
if your shell is csh or one of its descendents, or
CVSROOT=/u/src/master
export CVSROOT
if your shell is Bash or some other Bourne shell variant.
If you forget to do this, CVS will complain when you try to use it:
$ cvs checkout httpc
cvs checkout: No CVSROOT specified! Please use the `-d option
cvs [checkout aborted]: or set the CVSROOT environment variable.
Checking out a working directory
CVS doesnt work on ordinary directory trees; you need to work within a directory that CVS created for you. Just as you check out a book from a library before taking it home to read it, you use the cvs checkout command to get a directory tree from CVS before working on it. For example, suppose you are working on a project named httpc, a trivial HTTP client:

$ cvs checkout httpc
cvs checkout: Updating httpc
U httpc/.cvsignore
U httpc/Makefile
U httpc/httpc.c
U httpc/poll-server
The command cvs checkout httpc means, “Check out the source tree called httpc from the repository specified by the CVSROOT environment variable.”
CVS puts the tree in a subdirectory named `httpc:
$ cd httpc
$ ls -l
total 8
drwxr-xr-x 2 jimb 512 Oct 31 11:04 CVS
-rw-r–r– 1 jimb 89 Oct 31 10:42 Makefile
-rw-r–r– 1 jimb 4432 Oct 31 10:45 httpc.c
-rwxr-xr-x 1 jimb 460 Oct 30 10:21 poll-server
Most of these files are your working copies of the httpc sources. However, the subdirectory called `CVS (at the top) is different. CVS uses it to record extra information about each of the files in that directory, to help it determine what changes youve made since you checked it out.

Making changes to files
Once CVS has created a working directory tree, you can edit, compile and test the files it contains in the usual way — theyre just files.
For example, suppose we try compiling the package we just checked out:
$ make
gcc -g -Wall -lnsl -lsocket httpc.c -o httpc
httpc.c: In function `tcp_connection:
httpc.c:48: warning: passing arg 2 of `connect from incompatible pointer type
It seems that `httpc.c hasnt been ported to this operating system yet. We need to cast one of the arguments to connect. To fix that, line 48 must change from this:

if (connect (sock, &name, sizeof (name)) >= 0)
to this:
if (connect (sock, (struct sockaddr *) &name, sizeof (name)) >= 0)
Now it should compile:
$ make
gcc -g -Wall -lnsl -lsocket httpc.c -o httpc
$ httpc GET
HTML text for Cyclic Softwares home page follows
Merging your changes
Since each developer uses their own working directory, the changes you make to your working directory arent automatically visible to the other developers on your team. CVS doesnt publish your changes until youre ready. When youre done testing your changes, you must commit them to the repository to make them

Get Your Essay

Cite this page

Directory Tree And Terms Of A Series Of Changes. (July 6, 2021). Retrieved from https://www.freeessays.education/directory-tree-and-terms-of-a-series-of-changes-essay/