CVSandCGIProduction overview
From Odwiki
Back to the CVS and CGI Production
CVS Overview
From the CVS manual: Basic version control functionality. That is, CVS maintains a history of all changes made to each directory tree it manages. Using this history, CVS can recreate past states of the tree, or show a developer when, why, and by whom a given change was made. If you are familiar with RCS or SCCS, the difference is that CVS operates on entire directory trees, not just single files. CVS supports branches, which allow several lines of development to occur in parallel, and provides mechanisms for merging branches back together when desired. CVS can tag the state of the directory tree at a given point and recreate that state. CVS can display the differences between tags or revisions in the standard diff formats. Can run scripts which you supply to log CVS operations or enforce site-specific policies. Client/server CVS enables developers scattered by geography or slow modems to function as a single team. The version history is stored on a single central server and the client machines have a copy of all the files that the developers are working on. Therefore, the network between the client and the server must be up to perform CVS operations (such as checkins or updates) but need not be up to edit or manipulate the current versions of the files. Clients can perform all the same operations which are available locally. Unreserved checkouts, allowing more than one developer to work on the same files at the same time. CVS provides a flexible modules database that provides a symbolic mapping of names to components of a larger software distribution. It applies names to collections of directories and files. A single command can manipulate the entire collection.
A sample CVS session:
1) Determine the contents of the new module to be created.
neptune mstory-158% ls my_shader.sl my_shader.slc my_shader.slo
2) Import the items into a new module.
neptune mstory-159% cvs import shader_project NAMZA-EDU REL-001
(vi is brought up to allow you to enter notes.)
--------------------------------------------------------------------------- Import shaders for the shader project. --mstory CVS: ---------------------------------------------------------------------- CVS: Enter Log. Lines beginning with `CVS:' are removed automatically CVS: CVS: ---------------------------------------------------------------------- "/tmp/cvsAAAa002ah" 8 lines, 279 characters N shader_project/my_shader.sl N shader_project/my_shader.slc N shader_project/my_shader.slo No conflicts created by this import
3) Change to a new directory a checkout a copy of the module and verify it's contents
neptune mstory-161% cd ~/work neptune mstory-162% cvs checkout shader_project cvs checkout: Updating shader_project U shader_project/my_shader.sl U shader_project/my_shader.slc U shader_project/my_shader.slo neptune mstory-163% cd shader_project/ neptune mstory-165% ls CVS my_shader.sl my_shader.slc my_shader.slo
4) Modify a file in the module and determine it's status and differences to the repository.
neptune mstory-166% vi my_shader.sl
surface
my_shader (float Ka = 1;
float Kd = .5;
float Ks = .5;
float roughness = .1;
color specularcolor = 1;)
{
normal Nf = faceforward (normalize(N),I);
Oi = Os;
Ci = Os * 0.9 * ( Cs * (Ka*ambient() + Kd*diffuse(Nf)) +
specularcolor * Ks*specular(Nf,-normalize(I),roughness));
}
neptune mstory-167% cvs status my_shader.sl
===================================================================
File: my_shader.sl Status: Locally Modified
Working revision: 1.1.1.1 Fri Dec 28 14:14:05 2001
Repository revision: 1.1.1.1 /hosts/venus/usr/local/cvsroot/shader_project/my_shader.sl,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)
neptune mstory-168% cvs diff my_shader.sl
Index: my_shader.sl
===================================================================
RCS file: /hosts/venus/usr/local/cvsroot/shader_project/my_shader.sl,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 my_shader.sl
6c6
< float roughness = .1;
---
> float roughness = .2;
5) Commit and check in the new changes to the repository.
neptune mstory-168% cvs commit
(vi is brought up to allow you to enter notes.)
Changed the default roughness value. --mstory CVS: ---------------------------------------------------------------------- CVS: Enter Log. Lines beginning with `CVS:' are removed automatically CVS: CVS: Committing in . CVS: CVS: Modified Files: CVS: my_shader.sl CVS: ---------------------------------------------------------------------- "/tmp/cvsAAAa002IG" 12 lines, 345 characters Checking in my_shader.sl; /hosts/venus/usr/local/cvsroot/shader_project/my_shader.sl,v <-- my_shader.sl new revision: 1.2; previous revision: 1.1 done
6) Examine the log for this module.
neptune mstory-83% cvs log cvs log: Logging . RCS file: /hosts/venus/usr/local/cvsroot/shader_project/my_shader.sl,v Working file: my_shader.sl head: 1.2 branch: locks: strict access list: symbolic names: REL-001: 1.1.1.1 NAMZA-EDU: 1.1.1 keyword substitution: kv total revisions: 3; selected revisions: 3 description: ---------------------------- revision 1.2 date: 2001/12/28 15:19:47; author: mstory; state: Exp; lines: +1 -1 Changed the default roughness value. --mstory ---------------------------- revision 1.1 date: 2001/12/28 14:14:05; author: mstory; state: Exp; branches: 1.1.1; Initial revision ---------------------------- revision 1.1.1.1 date: 2001/12/28 14:14:05; author: mstory; state: Exp; lines: +0 -0 Import shaders for the shader project. --mstory ============================================================================= RCS file: /hosts/venus/usr/local/cvsroot/shader_project/my_shader.slc,v Working file: my_shader.slc head: 1.1 branch: 1.1.1 locks: strict access list: symbolic names: REL-001: 1.1.1.1 NAMZA-EDU: 1.1.1 keyword substitution: b total revisions: 2; selected revisions: 2 description: ---------------------------- revision 1.1 date: 2001/12/28 14:14:06; author: mstory; state: Exp; branches: 1.1.1; Initial revision ---------------------------- revision 1.1.1.1 date: 2001/12/28 14:14:06; author: mstory; state: Exp; lines: +0 -0 Import shaders for the shader project. --mstory ============================================================================= RCS file: /hosts/venus/usr/local/cvsroot/shader_project/my_shader.slo,v Working file: my_shader.slo head: 1.1 branch: 1.1.1 locks: strict access list: symbolic names: REL-001: 1.1.1.1 NAMZA-EDU: 1.1.1 keyword substitution: b total revisions: 2; selected revisions: 2 description: ---------------------------- revision 1.1 date: 2001/12/28 14:14:06; author: mstory; state: Exp; branches: 1.1.1; Initial revision ---------------------------- revision 1.1.1.1 date: 2001/12/28 14:14:06; author: mstory; state: Exp; lines: +0 -0 Import shaders for the shader project. --mstory ============================================================================= neptune mstory-84%
7) Release and remove the working copy of the module.
neptune mstory-175% cvs release -d shader_project You have [0] altered files in this repository. Are you sure you want to release (and delete) directory `shader_project': y
CVS System Administration Notes
Tools like CVS, RCS, and SCCS are commonly used in the development of software or authoring of web content, but in addition system administrators have also found them to be useful for tasks such as keeping track of machines and how each one is set up.
Because CVS has a client/server protocol, it may be an alternative to tools such as rdist. You might want to take a look at the PreservePermissions feature in CVS 1.10 and later, which lets you preserve file permissions and related information. You may also be interested in cvsmapfs which is an add-on package to do this.
CVS and Development Environments
Because a CVS working directory is just a collection of files, not a special kind of filesystem or database, it can work with a wide variety of development tools. The following integrations allow one to more conveniently perform CVS operations (at least basic ones like check-in and check-out) from within the development environment.



