Search code examples
unixcvs

cvs delete all versions


I have a set of files in CVS each with multiple versions. Now there is no need to have those files and versions in CVS, mainly for space. I would like to remove the files entirely from CVS (all versions). I noticed that

cvs delete file1 

followed by

cvs commit 

only removes the last version of the file from CVS. How do I remove all the versions of the file.

Thanks!


Solution

  • Seriously consider the ramifications before doing this. Use of version control usually supports tracking history. I cannot recommend continuing with this course of action.

    Removing versions of a file is generally frowned upon in the sense that it alters history - tagged revision sets will be altered so that they no longer represent a saved historical state.

    You might as well know up front that CVS will not allow removing all revisions. At least one revision must be retained. The solution that follows was likely intended by CVS authors to only to be used to collapse intermediate revisions between revisions into a single change. The remaining revision(s) may be cvs removed, but cannot be totally removed from the repository without performing surgery on the repository.

    WARNING: Use of cvs admin -o causes all sorts of problems in the sandbox. It is not trivial to avoid causing all manner of evil symptoms from occurring after using the solution below.

    Notwithstanding all the warnings and advice to not do this, if you persist in your desire against all good and sound advice, look into cvs admin -o:

    cvs --help admin
    ...
            -o range   Delete (outdate) specified range of revisions:
               rev1:rev2   Between rev1 and rev2, including rev1 and rev2.
               rev1::rev2  Between rev1 and rev2, excluding rev1 and rev2.
               rev:        rev and following revisions on the same branch.
               rev::       After rev on the same branch.
               :rev        rev and previous revisions on the same branch.
               ::rev       Before rev on the same branch.
               rev         Just rev.
    ...