Menu Close

How do I revert to a previous version of a file at CVS?

How do I revert to a previous version of a file at CVS?

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.

How do I undo a commit in CVS?

cvs export the ‘old version’ by tag (or you could do it by date) into a new folder. ensure the ‘current version’ is checked out, updated, and live. copy the files from the old version into the folder with the current version. commit the result with a suitable comment.

How do you remove sticky tags from CVS?

The sticky tags will remain on your working files until you delete them with ‘ cvs update -A ‘. The ‘ -A ‘ option merges local changes into the version of the file from the head of the trunk, removing any sticky tags, dates, or options (other than sticky ‘ -k ‘ options on locally modified files).

What is CVS update?

The cvs update command is used to merge changes that have been made to a repository into files that have been checked out. Note that it is reverse operation from the one we normally do on VMS, we only ever merge changes made from a checkout into the CMS repository.

How do I check my cvs version?

cvs log -h shows just the header information. To get just the version, it’s easy enough to filter that through sed, awk, or Perl. This gives you the version in the repository. If you want the version of the checked-out file, you can use ident (part of RCS) — but only if you’ve included the proper keywords in the file.

What is sticky tag in CVS?

Various CVS operations cause the working copy to have a sticky tag , meaning a single tag that corresponds to each revision for each file (in the case of a branch, the sticky tag is applied to any new files added in the working copy).

How do I delete a folder in CVS?

The way that you remove a directory is to remove all the files in it. You don’t remove the directory itself; there is no way to do that. Instead you specify the ‘ -P ‘ option to cvs update or cvs checkout , which will cause CVS to remove empty directories from working directories.

How do I rename a folder in CVS?

Adding, removing, and renaming files and directories

  1. You must have a working copy of the directory.
  2. Create the new file inside your working copy of the directory.
  3. Use `cvs add filename ‘ to tell CVS that you want to version control the file.
  4. Use `cvs commit filename ‘ to actually check in the file into the repository.

What is CVS checkout?

cvs checkout The way you reserve files in CVS that you want to edit. To check out a subdirectory tree, cd to the directory in your working space into which you want cvs to place the directory it checks out.

How to compare two revisions of a CVS file?

to compare two revisions. It may be possible to do the comparison you require directly, but we can also automate it by processing the results of cvs log filename. So, for example, you get the latest revision number with You want to merge these together, so create a BASH script file (say called lastdiff.sh) that contains:

Why won’t CVS update my old files?

More pernicious, CVS will not update the file with a normal “cvs update” command because it will look at the sticky tag and assume you want the file to be at version 1.5. The -A tag tells update to get rid of the sticky tag and do a full update of the file. Save the version of “oldfile” to something else and check out the “current” version.

Is it possible to compare two CVS logs?

It may be possible to do the comparison you require directly, but we can also automate it by processing the results of cvs log filename. So, for example, you get the latest revision number with You want to merge these together, so create a BASH script file (say called lastdiff.sh) that contains:

How to find the difference between checked out version and head?

You can use cvs diff to find out the differences between the local checked out version and the version present on the head. Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question.