Printer Friendly
The Free Library
19,573,952 articles and books
Member login
User name  
Password 
 
Join us Forgot password?

CVS for beginners.


Like many other software tools CVS (1) (Concurrent Versions System) A version control system for Unix that was initially developed as a series of shell scripts in the mid-1980s. CVS maintains the changes between one source code version and another and stores all the changes in one file.  is being credited with the properties of a panacea, not only with retrieval capabilities that tempt the developer to leave documentation properties to future generations, but also the added powers of awakening the legacy dead.

The following note posted on the internet firmly outlines the capabilities and the limitations of the Concurrent Versions System (programming) Concurrent Versions System - (CVS) A cross-platform code management system originally based on RCS.

CVS tracks all revisions to a file in an associated file with the same name as the original file but with the string ",v" (for version) appended to the filename.
.

CVS is a Version Control System.

Using it, you can record the history of your source files. For example, bugs sometimes creep in Verb 1. creep in - enter surreptitiously; "He sneaked in under cover of darkness"; "In this essay, the author's personal feelings creep in"
sneak in

penetrate, perforate - pass into or through, often by overcoming resistance; "The bullet penetrated her chest"
 when software is modified, and you might not detect the bug until a long time after you make the modification. With CVS, you can easily retrieve old versions to see exactly which change caused the bug. This can sometimes be a big help.

You could of course save every version of every file you have ever created. This would however waste an enormous amount of disk space. CVS stores all the versions of a file in a single file in a clever way that only stores the differences between versions.

CVS also helps you if you are part of a group of people working on the same project. It is all too easy to overwrite (1) A data entry mode that writes over existing characters on screen when new characters are typed in. Contrast with insert mode.

(2) To record new data on top of existing data such as when a disk record or file is updated.
 each others' changes unless you are extremely careful. Some editors, like GNU Emacs GNU Emacs - Emacs , try to make sure that the same file is never modified by two people at the same time.

Unfortunately, if someone is using another editor, that safeguard will not work. CVS solves this problem by insulating the different developers from each other. Every developer works in his own directory, and CVS merges the work when each developer is done.

CVS started out as a bunch of shell scripts written by Dick Grune Dick Grune is a Dutch computer scientist and university lecturer most well-known for inventing and developing the first version of CVS, the Concurrent Versions System. External links
  • Dick Grune's home page
, posted to the newsgroup newsgroup

Internet forum for discussion of specific subjects. Newsgroups are organized into subjects (e.g., automobiles); each typically has several subgroups (e.g., classic cars, Formula One racing cars).
 comp.sources.unix in the volume 6 release of July, 1986. While no actual code from these shell scripts is present in the current version of CVS much of the cvs conflict resolution algorithms come from them.

In April, 1989, Brian Berliner designed and coded CVS. Jeff Polk later helped Brian with the design of the CVS module and vendor branch support.

You can get CVS in a variety of ways, including free download from the internet. For more information on downloading CVS and other CVS topics, see: http://www.cvshome-org/ http://www.loria.fr/-moll//cvs-index-html

There is a mailing list An automated e-mail system on the Internet, which is maintained by subject matter. There are thousands of such lists that reach millions of individuals and businesses. New users generally subscribe by sending an e-mail with the word "subscribe" in it and subsequently receive all new , known as info-cvs, devoted to CVS. To subscribe or unsubscribe To cancel a service. It is often possible to unsubscribe to an e-mail service by typing the word "unsubscribe" into a reply message. Contrast with subscribe. See opt-out.  write to info-cvs-request@gnu gnu (n) or wildebeest (wĭl`dəbēst'), large African antelope, genus Connochaetes. .org. If you prefer a usenet group, the right group is comp.software.config-mgmt which is for CVS discussions (along with other configuration management systems). In the future, it might be possible to create a comp.software.config-mgmt.cvs, but probably only if there is sufficient CVS traffic on comp.software.config-mgmt.

You can also subscribe to Verb 1. subscribe to - receive or obtain regularly; "We take the Times every day"
subscribe, take

buy, purchase - obtain by purchase; acquire by means of a financial transaction; "The family purchased a new car"; "The conglomerate acquired a new company";
 the bug-cvs mailing list, described in more detail in Dealing with bugs in CVS or this manual. To subscribe send Mail to bug-cvs-request@gnu.org.

What CVS is not?

CVS can do a lot of things for you, but it does not try to be everything for everyone.

* CVS is not a build system. Though the structure of your repository and modules file interact with your build system (e.g. 'Makefile's), they are essentially independent.

* CVS does not dictate how you build anything. It merely stores files for retrieval in a tree structure you devise.

* CVS does not dictate how to use disk space in the checked out working directories. If you write your 'Makefile's or scripts in every directory so they have to know the relative positions of everything else, you wind up requiring the entire repository to be checked out.

If you modularize your work, and construct a build system that will share files (via links, mounts, VPATH VPATH Vertical Path  in 'Makefile's, etc.), you can arrange your disk usage however you like.

But you have to remember that any such system is a lot of work to construct and maintain. CVS does not address the issues involved.

Of course, you should place the tools created to support such a build system (scripts, 'Makefile's, etc) under CVS.

Figuring out what files need to be rebuilt when something changes is, again, something to be handled outside the scope of CVS. One traditional approach is to use make for building, and use some automated tool for generating the dependencies which make uses.

* CVS is not a substitute for management Your managers and project leaders are expected to talk to you frequently enough to make certain you are aware of schedules, merge points, branch names and release dates. If they don't, CVS can't help.

CVS is an instrument for making sources dance to your tune. But you are the piper and the composer. No instrument plays itself or writes its own music.

* CVS is not a substitute for developer communication.

When faced with conflicts within a single file, most developers manage to resolve them without too much effort. But a more general definition of "conflict" includes problems too difficult to solve without communication between developers. CVS cannot determine when simultaneous changes within a single file, or across a whole collection of files, will logically conflict with one another. Its concept of a conflict is purely textual, arising when two changes to the same base file are near enough to spook the merge (i.e. diff 3) command.

CVS does not claim to help at all in figuring out non-textual or distributed conflicts in program logic.

For example: Say you change the arguments to function x defined in file 'A'. At the same time, someone edits file 'B', adding new calls to function x using the old arguments. You are outside the realm of CVS's competence. Acquire the habit of reading specs and talking to Noun 1. talking to - a lengthy rebuke; "a good lecture was my father's idea of discipline"; "the teacher gave him a talking to"
lecture, speech

rebuke, reprehension, reprimand, reproof, reproval - an act or expression of criticism and censure; "he had to
 your peers.

* CVS does not have change control

Change control refers to a number of things. First of all it can mean bug-tracking, that is being able to keep a database of reported bugs and the status of each one (is it fixed? in what release? has the bug submitter agreed that it is fixed?). Another aspect of change control is keeping track of the fact that changes to several files were in fact changed together as one logical change. If you check in several files in a single cvs commit operation, CVS then forgets that those files were checked in together, and the fact that they have the same log message is the only thing tying them together. Keeping a GNU style 'ChangeLog' can help somewhat. Another aspect of change control, in some systems, is the ability to keep track of the status of each change. Some changes have been written by a developer, others have been reviewed by a second developer, and so on. Generally, the way to do this with CVS is to generate a diff (using cvs diff or diff) and email it to someone who can then apply it using the patch utility. This is very flexible, but depends on mechanisms outside CVS to make sure nothing fails through the cracks.

* CVS is not an automated testing (testing) automated testing - Software testing assisted with software tools that require no operator input, analysis, or evaluation.  program

It should be possible to enforce mandatory use of a testsuite using the commitinfo file. I haven't heard a lot about projects trying to do that or whether there are subtle gotchas, however.

* CVS does not have a builtin process model

Some systems provide ways to ensure that changes or releases go through various steps, with various approvals as needed as needed prn. See prn order. . Generally, one can accomplish this with CVS but it might be a little more work. In some cases you'll want to use the 'commitinfo', 'loginfo', rcsinfo', or 'verifymsg' files, to require that certain steps be performed before cvs will allow a checkin. Also consider whether features such as branches and tags can be used to perform tasks such as doing work in a development tree and then merging certain changes over to a stable tree only once they have been proven.

A sample session

As a way of introducing CVS, we'll go through a typical work-session using CVS. The first thing to understand Is that CVS stores all files in a centralized cen·tral·ize  
v. cen·tral·ized, cen·tral·iz·ing, cen·tral·iz·es

v.tr.
1. To draw into or toward a center; consolidate.

2.
 repository ; here we assume a section has been set up.

Suppose you are working on a simple compiler. The source consists of a handful of C files and a 'Makefile'.

The compiler is called 'tc' (Trivial Compiler), and the repository Is set up so that there is a module called 'tc'.

Getting the source

The first thing you must do is to get your own working copy of the source for 'tc'. For this, you use the checkout command:

$ cvs checkout tc

This will create a new directory called 'tc' and populate To plug in chips or components into a printed circuit board. A fully populated board is one that contains all the devices it can hold.  it with the source flies.

$ cd tc $ 1s CVS Makefile backend.c driver. c frontend.c parser A routine that analyzes a continuous flow of text-based input and breaks it into its constituent parts. See parse.

(language) parser - An algorithm or program to determine the syntactic structure of a sentence or string of symbols in some language.
.c

The 'CVS' directory is used internally by CVS. Normally, you should not modify or remove any of the files in it. You start your favorite editor, hack away at 'backend. c', and a couple of hours later you have added an optimization pass to the compiler. A note to RCS (1) (Remote Computer Service) A remote timesharing service.

(2) (Revision Control System) A Unix utility that provides version control.

RCS - Revision Control System
 and SCCS SCCS - Source Code Control System: a popular code management system for Unix systems.  users: There is no need to lock the files that you want to edit.

Committing your changes

When you have checked that the compiler is still compilable you decide to make a new version of 'backend. c'. This will store your new 'backend. c' in the repository and make it available to anyone else who is using that same repository.

$ cvs commit backend.c

CVS starts an editor, to allow you to enter a log message. You type in "Added an optimization pass.", save the temporary file, and exit the editor.

The environment variable $CVSFDITOR determines which editor Is started. If $CVSEDITOR is not set, then if the environment variable $EDITOR is set, it will be used. If both $CVSEDITOR and $EDITOR are not set then there is a default which will vary with your operating system operating system (OS)

Software that controls the operation of a computer, directs the input and output of data, keeps track of files, and controls the processing of computer programs.
, for example vi for unix or notepad The text editor that comes with Windows. It is a very elementary utility, but gets the job done most of the time. See text editor and WordPad.

(text, tool) Notepad - The very basic text editor supplied with Microsoft Windows.
 for Windows NT/95. In addition, CVS checks the $VISUAL environment variable. Opinions vary on whether this behavior is desirable and whether future releases of CVS should check $VISUAL or ignore it. You will be OK either way if you make sure that $VISUAL is either unset un·set  
adj.
1. Not yet firm or solidified: unset gelatin; unset cement.

2. Not mounted in a setting: an unset gem. 
 or set to the same thing as $EDITOR,.

When CVS starts the editor, it includes a list of files which are modified. For the CVS client, this list is based on comparing the modification time of the file against the modification time that the file had when it was last acquired or updated. Therefore, if a file's modification time has changed but its contents have not, it will show up as modified. The simplest way to handle this is simply not to worry about it--if you proceed with the commit CVS will detect that the contents are not modified and treat it as an unmodified Adj. 1. unmodified - not changed in form or character
unqualified - not limited or restricted; "an unqualified denial"

modified - changed in form or character; "their modified stand made the issue more acceptable"; "the performance of the modified aircraft
 file. The next update will alert CVS to the fact that the file is unmodified, and it will reset its stored timestamp so that the file will not show up in future editor sessions.

If you want to avoid starting an editor you can specify the log message on the command line using the '-m' flag instead, like this:

$ cvs commit-m "Added an optimization pass" backend.c

Cleaning Up

Before you turn to other tasks you decide to remove your working copy of tc. One acceptable way to do that is

$ cd.. $ rm-r tc

but a better way is to use the release command ie

$ cd.. $ cvs release-d tc M drivers.c ? tc

You have (1) altered files in this repository.

Are you sure you want to release (and delete) directory 'tc' : n

** 'release' aborted a·bort  
v. a·bort·ed, a·bort·ing, a·borts

v.intr.
1. To give birth prematurely or before term; miscarry.

2. To cease growth before full development or maturation.

3.
 by user choice.

The 'release' command checks that all your modifications have been committed. If history logging is enabled it also makes a note in the history file

When you use the '-d' flag with 'release', it also removes your working copy.

In the example above, the 'release' command wrote a couple of lines of output. '? tc' means that the file 'tc' is unknown to CVS. That is nothing to worry about: 'tc' is the executable compiler, and it should not be stored in the repository.

'M driver.c' is more serious. It means that the file 'driver.c' has been modified since it was checked out. The 'release' command always finishes by telling you how many modified files you have in your working copy of the sources, and then asks you for confirmation before deleting any files or making any note in the history file. You decide to play it safe and answer n RET ret  
v. ret·ted, ret·ting, rets

v.tr.
To moisten or soak (flax, for example) in order to soften and separate the fibers by partial rotting.

v.intr.
To become so moistened or soaked.
 when 'release' asks for confirmation.

Viewing differences

You do not remember modifying 'driver.c', so you want to see what has happened to that file.

$ cd tc $ evs diff driver.c

This command runs 'diff' to compare the version of 'driver.c' that you checked out with your working copy. When you see the output you remember that you added a command line option that enabled the optimization pass. You check it in, and release the module.

$ cvs commit-m "Added an optimization pass" driver.c Checking in driver.c; /usr/local/cvsroot/te/driver.c, v <-- driver.c new revision: 1.2; previous revision: 1.1 done

$ cd.. $ cvs release-d tc ? tc

You have [0] altered files in this repository.

Are you sure you want to release (and delete) directory 'tc' :y

This document was generated by DerekRobert Price on September, 29 2003 using texi2htmi 1.67. www.cvshome.org/docs/manual/cvs-1.11.7/cvs_1.html

"Java Web Services (1) Loosely, any online service delivered over the Web. Such usage appears in articles from non-technical sources, but not in IT-oriented publications, because definition #2 below describes the correct use of the term.  in a Nutshell"

"Java Web Services in a Nutshell" by Kim Topley is a succinct introduction, high-speed tutorial, and reference to the Java/XML APIs, more commonly known as the JWSDP JWSDP Java Web Services Developer Pack  or "Java Web Services Developer's Pack." These APIs are capable of handling everything from simple XML Simple XML
Simple XML is a variation of XML containing only elements. All attributes are converted into elements. Not having attributes or other xml elements such as the XML declaration / DTDs allows the use of simple and fast parsers.
 to SOAP and full ebXML vocabularies.

What makes "Java Web Services in a Nutshell" unique, the author says, is that it contains more detail and more relevant examples than are currently available elsewhere. "The coverage is up-to-date with the current JWSDP release. And the book covers only what is currently released. There is no padding based around future specifications that have not yet been made part of the JWSDP/J2EE 1.4."

The most important API in the JWSDP is JAX-RPC JAX-RPC Java Api for Xml-Based Remote Procedure Call  (Java API for XML-based RPC Java API for XML-based RPC (JAX-RPC) allows invoking from a Java application a Java based Web Service with a known description while still being consistent with its WSDL description. It can be seen as Java RMIs over Web Services. JAX-RPC 2.0 was renamed to JAX-WS 2. ). "This is also the API that developers most consistently post questions about. This book covers all aspects of JAX-RPC in detail, with the tutorial coverage exceeding 150 pages.

"Java Web Services in a Nutshell" provides:

A fast-paced introduction to web services and the new features of the J2EE (Java 2 Platform, Enterprise Edition) A platform from Sun for building distributed enterprise applications. J2EE services are performed in the middle tier between the user's machine and the enterprise's databases and legacy information systems.  1.4 platform that support web services.

In-depth coverage of the Java API for XML-based Remote Procedure Calls (JAX-RPC), the API that most Java programmers use to build or access web services Chapter 3, "SAAJ SAAJ SOAP with Attachments API for Java (web services) ," is available free online at:

http://www.oreilly.com/catalog/ javawsian/chapter/index.html
COPYRIGHT 2003 A.P. Publications Ltd.
No portion of this article can be reproduced without the express written permission from the copyright holder.
Copyright 2003, Gale Group. All rights reserved. Gale Group is a Thomson Corporation Company.

 Reader Opinion

Title:

Comment:



 

Article Details
Printer friendly Cite/link Email Feedback
Title Annotation:Teach-In
Author:Price, Derek
Publication:Software World
Date:Nov 1, 2003
Words:2485
Previous Article:Making the most of the software development process.
Next Article:Internet Society oppose 'site finder'.



Related Articles
Argentine tango stars plan a visit.
New piano course for adult beginners. (Music Marketplace).
DRESSED TO KILT.
Yoga & Pilates studio directory.
Small moments big impact: teaching first-year students how to practice.
Piano Coach.
The Art of Effective Piano Teaching.
Art of teaching conference.
Pedagogy and charity.

Terms of use | Copyright © 2012 Farlex, Inc. | Feedback | For webmasters | Submit articles