Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15
File management with command-line CVS

Managing project files

At certain point in a project's development cycle, managing your project's source repository invariably involves dealing with files and directories that have become deprecated or obsolete. The decision is made to abandon a certain piece of functionality within a module, for example. Or perhaps an change in infrastructure demands getting rid of some files and moving others. This section deals with several methods for dealing with such file management issues in CVS.

Releasing files and directories

Releasing refers to a way of designating certain directories or modules that will no longer to be used in the project. The command to release is invoked within a working copy and effectively cancels cvs checkouts for the designated directories and their files. Unless these are expressly deleted, the files and directories actually remain intact within the repository, including all file revision history, but are no longer included in when working copies are checked out.

The command to release a file or directory is:

cvs rel filename (or /directory_name)

More about releasing

Removing is another way to get rid of files when you no longer want or need them to be part of the project's source repository. To do this, you must first delete the file from the working copy you have checked out on your local system.

Then, to remove a file from the shared repository, type:

cvs remove filename
After you have removed one or more files, you must commit your changes.

With "cvs remove" (or "cvs rm"), the old file is not completely eradicated but rather stored in CVS' so-called "attic" along with its complete revision history.

More about removing files
What happens when you remove a file

Renaming and moving files and directories

If you have imported some existing source code into your repository, you may have files and directories you want to rename or or move.

The best way to rename a file in your working copy involves a series of steps. Use:

cvs rm old_filename
to remove the old name, then
cvs add new_filename
and finally,
cvs commit new_filename

There really is no specific way in CVS to remove or rename directories. However, you can produce that effect by creating a new directory, moving the files you need into it, removing unwanted files from the old directory, and then simply no longer using it. Later, you can "prune" these empty directories the next time you a check out a working copy by using:

cvs checkout -P
Another way to prune directories with no more files is to update with:
cvs update -dP

More about moving and renaming files
More about moving and renaming directories

Tagging and branching

The CVS repository for your project hosted on this site supports branching and tagging your source files. At certain points in your project, you may want to enable development work in your project to progress in more than one direction simultaneously. Instead of maintaining a singular, linear path of development, CVS branching provides a way to divert or split the source tree for ancillary development activities without impacting progress of the project's primary effort. Examples of reasons to branch include:

Tagging is included in the discussion about branching because the two operations are used in conjunction. Tagging allows you to "take a snapshot" of the overall project's state at a certain point in time, for example, to preserve a build with some particular characteristic. Because CVS manages individual file revisions, tagging is an important option for benchmarking the overall state of project source code. Files included in a tag will most likely be at different points in their respective revision numbering.

The critical difference between branching and tagging is the reason they are complimentary operations:

Branching affects individual files' revision numbering, whereas tagging assigns a common identifying marker across all project files at a fixed point in time.
So, for example, project files are often tagged at the point where branches are created.

Ultimately, branches in your project with successful outcomes get incorporated or merged back in to the main development trunk. When that happens -- and it may occur repeatedly on large or long-term projects -- identifying the point where this merge occurs is another reason to create a tag.

To tag project files, type:

cvs tag unique_tag_name

Your tag name can be a release name or date, a product version identifier, or whatever you choose.

To create a branch, type:

cvs tag -b unique_tag_name

Branching and tagging are complex topics with many considerations and options. You can find more comprehensive information and instructions in the following resources:


Back to main Help index

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.