CVS Resources
Note that the CVS Resources have moved tohttp://chess.eecs.berkeley.edu/softdevel/faq/1/
This page is no longer being maintained.
CVS is the Concurrent Version control System, based on RCS.
CVS allows multiple developers to concurrently modify source code packages.Remote Links
- Yahoo CVS links
- Cyclic Software - Commercial Support for CVS, lots of good links and binaries
- CVS and RCS Tutorial
- Mailing Lists: -
comp.software.config-mgmt-info-cvsarchive - FAQ: Local copy from 10.x distribution - Cyclic.com CVS FAQ
- CVS-Index at
www.loria.fr - WinCVS - Windows CVS GUI
- tkCVS - Tk Interface to CVS
- jCVS - Java Interface to CVS
- Scriptics NetCVS page
- pcl-cvs emacs mode
Local Links
- CVS and SSH binaries for Windows
- John Reekie's CVS notes, including information about setting up under windows.
- CVS Resources for the Ptolemy Group Only
- Documentation
- CVS PostScript and PDF documentation
- The CVS and SSH installer includes CVS documentation in Windows Help format which was taken from WinCVS. The two Windows Help format files are available as
cvshlp.zip - CVS HTML Documentation (Dated 5/1/96)
- Man pages:
cvs(1)-cvs(5)-cvsbug
- Common CVS Commands
- Common CVS tasks
- Administrative CVS Commands
- Binary Files
- EDITOR Variable
- Local Installation
Common CVS Commands
Below is some text from William Wu about CVS commandscvs import [module|file]- add files/modules into the repository directory.
cvs commit [module|file]- Check in your modified files/module to the repository, creates a new file that merge your file and the one in repository. Note it is a MERGE not a replace, so it could cause problem. A good rule is to after you modified the file, do a cvs update (see below) first, so you have the newest version, and try to recompile and run, so that you can find any conflict that arise.
cvs update [module|file]- updates your files to the files in the repository, if you have made some change to your files, it will merge the two. This is always a good thing to do before you do commit, since someone else can modify the file and check in after you last update, thus it is possible the changes he made is in conflict with you changes. By doing a update, you can find out about the changes he made and spot any conflict. (conflict is indicated by a letter c in front of file name, in the messages from CVS)
You can runcvs -n updateto preview what would happen if you rancvs update. The-noption does not change any files, it only issues reports. cvs checkout [module|file]- Use this when you check out the files/module for the first time. When someone had import a new file in, you can use this command to check it out, or I think do a update on the module will also add the new file to you directory.
cvs status [module|file]- Give a status report on the files comparing with the newest version in the repository. The files status can be Up-to-Date, Modified ... Uses this command before commit, then you can check if you need to do a update or not.
cvs diff [module|file]- does a diff with your file and its newest version in repository.
cvs history [module|file]- gives a report on the history of modication done on this file, users, date etc.
These are some commonly used ones, you can always use cvs(1) man page for help.
Common CVS tasks
Checking out just one directory
The old symbolic links method we used with SCCS probably won't work as well. Your best bet is to just check out the entire treeTo check out just one directory outside of your tree, you can use the directory name with cvs checkout
cvs checkout ptII/ptolemy/plot
will create the directory ptII/ptolemy/plot in the current directory.
.cvsrc file
Brian Evans suggested that if your~/.cvsrc file contains the following:
cvs -z3
update -d -P
Then you will get the following features automatically:
cvs -z3- compression when doing a
cvs checkout. This can be especially useful when you are dialed in from home update -d -P- When you do
cvs update, create and prune directories as necessary.
Administrative CVS Commands
Below are some common scenarios for fixing up the CVS database. See the FAQ for more examples.Ignoring files
/users/cvs/Repository/CVSROOT/cvsignore contains the patterns for files that are ignored when cvs update is done. If cvsignore includes *.class, then when you do cvs update, you won't see messages like
? DEActor.class
? DEDirector.class
Adding a directory
- Create the directory
mkdir foo - Update the Repository and create
foo/CVScvs add foo - Populate
foowith your files - Add the files:
cd foo cvs add file1 file2 cvs commit
Deleting a file
- (optional) Make sure that you do not have any uncommitted changes to the file:
cvs update foo.c - Remove the file:
rm -f foo.c - Tell CVS you want to remove the file:
cvs remove foo.c - Commit the changes, move the file to the CVS attic directory
cvs commit foo.c
Fixing a Binary file</>
This is covered in Chapter 9 of the CVS documentation.If a file gets added without -kb, then you can fix it with
-
cvs admin -kb foo.class -
cvs update -A foo.class - Then copy in a good copy of the file from outside CVS.
-
cvs commit -m "Make it binary" foo.class
cvs remove -f foo.c will remove the file for you.
Renaming a file
The faq says:
4. How do I rename a file?
CVS does not offer a way to rename a file in a way that CVS can track
later. See Section 4B for more information.
Here is the best (to some, the only acceptable) way to get the effect
of renaming, while preserving the change log:
Copy the RCS (",v") file directly in the Repository.
cp $CVSROOT//,v $CVSROOT//,v
By duplicating the file, you will preserve the change history and the
ability to retrieve earlier revisions of the old file via the "-r
" or "-D " options to "checkout" and "update".
Remove the old file using CVS.
cd / rm
cvs remove
cvs commit
This will move the to the Attic associated with .
Retrieve and remove all the Tags from it.
By stripping off all the old Tags, "checkout -r" and "update -r" won't
retrieve revisions Tagged before the renaming.
cd /
cvs update
cvs log # Save the list of Tags
cvs tag -d
cvs tag -d
. . .
This technique can be used to rename files within one directory or
across different directories. You can apply this idea to directories
too, as long as you apply the above to each file and don't delete the
old directory.
Of course, you have to change your build system (e.g. Makefile) in
your to know about the name change.
Warning: Stripping the old tags from the copied file will allow "-r
" to do the right thing, but you will still have problems with
"-D " because there is no place to store the "deletion time".
See 5B.3 for more details.
Last modified: _6/13/1997_
Binary Files
See Fixing a Binary file above.Using cvswrappers might be useful
EDITOR Variable
When CVS needs a log message, it reads theEDITOR environment variable to determine which editor to startup. If you set EDITOR to emacs, then each time CVS needs a log message it will start up an emacs. If you always have an emacs process running. Consider using emacsclient instead.
- Edit your
~/.emacsfile and add(server-start)to it - Edit your
~/.cshrcfile and addsetenv EDITOR emacsclient
emacs process. When you are done editing, type C-x #
For more information about emacsclient, start up emacs and type M-x info and search for the emacs online documentation.
Local Installation
The local installation is in/usr/eesww/gnu/cvs
Installing
configure --prefix=/usr/eesww/share/gnu/cvs-1.10.3 --exec-prefix=/usr/eesww/gnu/cvs-1.10.3 --enable-encryption- Edit
config.hand change/* #undef HAVE_KERBEROS */to#define HAVE_KERBEROS 1 - Edit
src/Makefile, and add the following to theINCLUDESline-I/usr/kerberos/include/kerberosIV -I/usr/kerberos/include - Edit
Makefile, and add the following toLIBS-L/usr/kerberos/lib -lkrb -ldes -lcompat - Compilation failed because
flock was undefinedUndefined first referenced symbol in file flock /usr/kerberos/lib/libkrb.a(tf_util.o)The fix was to editMakefileand add-lcompatafter-lkrb - Create directories:
mkdir /usr/eesww/share/gnu/cvs-1.10.3 mkdir /usr/eesww/share/gnu/cvs-1.10.3/info mkdir /usr/eesww/gnu/cvs-1.10.3 mkdir /usr/eesww/gnu/cvs-1.10.3/bin mkdir /usr/eesww/share/gnu/cvs-1.10.3/man mkdir /usr/eesww/share/gnu/cvs-1.10.3/man/man1 mkdir /usr/eesww/share/gnu/cvs-1.10.3/man/man5 mkdir /usr/eesww/share/gnu/cvs-1.10.3/man/man8 make install /usr/eesww/share/gnu/cvs-1.10.3/doccontains.psand.pdfdocumentation files that were placed there by hand.
Last Updated: $Date$
