How to delete file in RCS
Sam Lee <[email protected]> Thu, 4 Nov 2021 03:06:06 +0000
| Newsgroups | gmane.comp.gnu.rcs |
|---|---|
| Message-ID | <20211104030606.d7u7q6k67ej7m64z@localhost> |
Hello, I have a software project that consists of multiple files. All files are version-controlled by RCS. Now, I want to remove one file from the project (because it has become useless after I refactored my code). How do I delete the file, while preserving its history in RCS? I cannot do `rm RCS/useless.c,v` because I want to preserve history (i.e. I want to be able to build old versions of my software). Instead, I could simply delete the contents of the file and check in the empty file (i.e. `co -l useless.c`, followed by `> useless.c` to delete the contents, followed by `ci -m'Emptied the file' useless.c`). However, `co RCS/*,v` would still check out the file. This is messy if I have many "deleted" files, because `co RCS/*,v` would check out all the "deleted" files too. The other solution I have thought of is to give a new symbolic name to all files in my project whenever one file gets a new revision. For example, right after the first ever check in of the files in the project, I would give all files a symbolic name of "V_1" (using `rcs -nV_1: *`). Then, whenever I make a revision to any file, I would increment the project-wide version number. For example, after making a new revision to example.c, I would give a new symbolic name "V_2" to all files (`rcs -nV_2: *`). This is somewhat similar to rcsfreeze, except that this adds symbolic names to the checked out files only (not to all RCS/*,v files). This allows files to be "deleted" easily; files are "deleted" by not giving them a symbolic name with an updated version number. I can then check out the latest version of my software using `co -rV_x RCS/*,v`, where x is the highest version number. However, this approach seems cumbersome and error-prone (when incrementing version numbers), and every file will have a very long list of symbolic names. I'm sure that I am missing something, since I am just a beginner in RCS. What is the "proper" way to manage the deletion of files in a multi-file project version-controlled by RCS? Best regards, Sam Lee