Next: , Previous: Changing A Log Message After Commit, Up: Advanced CVS


Getting Rid Of A Working Copy

In typical CVS usage, the way to get rid of a working copy directory tree is to remove it like any other directory tree:

     paste$ rm -rf myproj

However, if you eliminate your working copy this way, other developers will not know that you have stopped using it. CVS provides a command to relinquish a working copy explicitly. Think of release as the opposite of checkout – you're telling the repository that you're done with the working copy now. Like checkout, release is invoked from the parent directory of the tree:

     paste$ pwd
     /home/qsmith/myproj
     paste$ cd ..
     paste$ ls
     myproj
     paste$ cvs release myproj
     You have [0] altered files in this repository.
     Are you sure you want to release directory 'myproj': y
     paste$

If there are any uncommitted changes in the repository, the release fails, meaning that it just lists the modified files and otherwise has no effect. Assuming the tree is clean (totally up to date), release records in the repository that the working copy has been released.

You can also have release automatically delete the working tree for you, by passing the -d flag:

     paste$ ls
     myproj
     paste$ cvs release -d myproj
     You have [0] altered files in this repository.
     Are you sure you want to release (and delete) directory 'myproj: y
     paste$ ls
     paste$

As of CVS version 1.10.6, the release command is not able to deduce the repository's location by examining the working copy (this is because release is invoked from above the working copy, not within it). You must pass the -d <REPOS> global option or make sure that your CVSROOT environment variable is set correctly. (This bug may be fixed in future versions of CVS.)

The Cederqvist claims that if you use release instead of just deleting the working tree, people with watches set on the released files will be notified just as if you had run unedit. However, I tried to verify this experimentally, and it does not seem to be true.

Karl Fogel wrote this book. Buy a printed copy via his homepage at red-bean.com

copyright  ©  May 24 2019 sean dreilinger url: https://durak.org/sean/pubs/software/cvsbook/Getting-Rid-Of-A-Working-Copy.html