next up previous
Next: Releasing and Deleting Your Up: Simple Project Management Using Previous: Adding, Deleting, and Renaming

Adding, Deleting, and Renaming Directories

Adding directories to a module is much the same as adding a regular file, with the caveat that adding files is not recursive. That is to say, when you add a directory, the files and subdirectories it contains are not automatically added as well.

So if you wish to add a directory called ``realms'' which contains a number of files within it, including a subdirectory called ``antharia'' which also contains a number of files, you would have to execute something like:

cvs add realms realms/* realms/antharia/*

In order to delete a directory, first you must delete and cvs remove all the files in it if you haven't already, taking care not to remove the special ``CVS'' directory within it. Then, you don't attempt to remove the directory directly, but by invoking cvs update with the ``-P'' option (to prune empty directories):

cvs update -P

To rename a directory, you'll first want to move all the files in it into a new directory (again, taking care to leave the ``CVS'' subdirectory alone, which is why we don't just use ``mv'' on the directory). Then cvs remove all the files from the old directory and cvs add all the files from the new one. When you're satisfied with your work, you can invoke cvs commit and cvs update -P:

mkdir zork
mv realms/*.c zork
cvs remove realms
cvs add zork zork/*
cvs commit -m ``Moved files from realms to zork''
cvs update -P

Notice that when you want to remove all the files from a directory, you just specify the name of the directory itself - but this does not mark the directory for removal. Directories are removed only when all of their files have been removed and cvs update -P is invoked. When attempting to remove all the files from a directory in this fashion, make sure that all the files (except the CVS directory) are actually gone, or else CVS will complain.


next up previous
Next: Releasing and Deleting Your Up: Simple Project Management Using Previous: Adding, Deleting, and Renaming
Michael S. Bland
2000-11-22