release--Indicate that a Module is no longer in use

This command is meant to safely cancel the effect of cvs checkout. Since cvs doesn't lock files, it isn't strictly necessary to use this command. You can always simply delete your working directory, if you like; but you risk losing changes you may have forgotten, and you leave no trace in the cvs history file (The history file 在 附录 C) that you've abandoned your checkout.

Use cvs release to avoid these problems. This command checks that no uncommitted changes are present; that you are executing it from immediately above a cvs working directory; and that the repository recorded for your files is the same as the repository defined in the module database.

If all these conditions are true, cvs release leaves a record of its execution (attesting to your intentionally abandoning your checkout) in the cvs history log.

release options

The release command supports one command option:

-d

Delete your working copy of the file if the release succeeds. If this flag is not given your files will remain in your working directory.

Warning: The release command deletes all directories and files recursively. This has the very serious side-effect that any directory that you have created inside your checked-out sources, and not added to the repository (using the add command; 添加一个文件到源码库的一个目录 在 第 7 章) will be silently deleted--even if it is non-empty!

release output

Before release releases your sources it will print a one-line message for any file that is not up-to-date.

Warning: Any new directories that you have created, but not added to the cvs directory hierarchy with the add command (添加一个文件到源码库的一个目录 在 第 7 章) will be silently ignored (and deleted, if -d is specified), even if they contain files.

U file, P file

There exists a newer revision of this file in the repository, and you have not modified your local copy of the file (U and P mean the same thing).

A file

The file has been added to your private copy of the sources, but has not yet been committed to the repository. If you delete your copy of the sources this file will be lost.

R file

The file has been removed from your private copy of the sources, but has not yet been removed from the repository, since you have not yet committed the removal. commit--Check files into the repository.

M file

The file is modified in your working directory. There might also be a newer revision inside the repository.

? file

file is in your working directory, but does not correspond to anything in the source repository, and is not in the list of files for cvs to ignore (see the description of the -I option, and 使用 cvsignore 忽略某些文件 在 附录 C). If you remove your working sources, this file will be lost.

release examples

Release the tc directory, and delete your local working copy of the files.

$ cd ..         # You must stand immediately above the
                # sources when you issue cvs release.
$ cvs release -d tc
You have [0] altered files in this repository.
Are you sure you want to release (and delete) directory `tc': y
$