For legacy reasons, I'm using CVS on a project. Recently I committed some changes which broke our code and I needed to revert them. What's CVS's analog of git revert -r <old_revision>
?
Looking at past questions like How to revert big change, CVS commits don't group the files that were changed. Is the only way to revert by using dates?
Also, what's the best way to view past changes? CVS log outputs too much info, most of which is unnecessary. I want to see commit messages and changed files.
Retrieving the older version of the file is simple, but it is a little tricky to then use the old version as a starting point for new edits. CVS "tags" the file with the version number. This tag can get in the way of either committing the old version with new edits or going back to the most up to date version.
Whenever you commit a file you specify a log message. To look through the log messages which have been specified for every revision which has been committed, use the cvs log command (see section log--Print out log information for files).
Technically, the way to send files to the CVS repository is to add them to Eclipse's version control and then commit them. You do that by right-clicking the files and selecting Team→ Add to Version Control. Then select Team→ Commit to commit the files.
CVS documentation can be found here, but from this site it tells how to revert a single file:
MAKING THE OLD VERSION THE CURRENT VERSION
Save the version of "oldfile" to something else and check out the "current" version.
Note: you must still to do update -A to get the current version, because even though you have > renamed
"oldfile" the tag is still associated with the file "oldfile" and is not removed till > update -A is done.Then rename the "old" version to the "current" version.
% mv oldfile oldfile.old.ver
% cvs update -A oldfile
% mv oldfile.old.ver oldfile
% cvs commit -m "reverting to version 1.5" oldfileYou can now carry on checking out, editing and commiting the file as normal.
This won't handle many files in a recursive fashion, but hopefully helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With