Question

I have CVS used in my company. I would like to stay on the current version for the file, but retrieve copy of the older version into different file name.

I have current revision 1.136, but I need to get revision 1.130.

head: 1.136
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 136;   selected revisions: 136
Was it helpful?

Solution

You could try to

  • retrieve the old version
  • rename it to a different name
  • restore the current version

It should be possible to do it with something like:

cvs checkout -D 2010-05-01 directory/file1 #Use  the  most  recent  revision  no later than 2010-05-01
cp directory/file1 myNewFile.txt
cvs update -C directory/file1

OTHER TIPS

I've got it slightly different way:

cvs up -r1.130 myfile.txt
cp myfile.txt myfile.txt.v1.130
cvs up -r1.136 myfile.txt

Excerpt from a bash script I wrote:

module="$(cat "$SOURCE_DIR/CVS/Repository")"
cvs -Q co -r "$rev" -p "$module/$pathname" > "$pathname"

The name of the module is stored in the Repository file within the CVS folder.

A breakdown of the cvs options:

Option Meaning
-Q Don't print anything but the content of the file.
co Short version of checkout.
-r Specify revision number.
$rev The revision number.
-p Print the file to stdout.
$module/$pathname The file to be retrieved.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top