rcs checkout without touching the current working file

1.2k views Asked by At

The idea is somehow ridiculous, but still I'm wondering whether there is an actual way.

My object: I would like to view an older version of a RCS file without touching the latest working version. Below are my thoughts:

Method 1: check out the older version to another directory (ridiculous since the concept looks totally wrong)

Method 2: create another branch based on the older version and then put the file into the branch (but inevitably, the checking out of the older version still need to over write the latest working file one time at least)

Yang

1

There are 1 answers

1
Keith Thompson On BEST ANSWER

You can use the -p option to send the content of (a specified version of) a file to standard output:

co -p1.1 file.txt

You can pipe the output through less or redirect it anywhere you like:

co -p1.1 file.txt > file__1.1.txt
co -p1.2 file.txt > file__1.2.txt
...

If you want to checkout multiple versions at once, you can use my own get-versions command, available here; it works with RCS, CVS, SVN, and Git. It's a command-line tool. The user interface isn't quite as polished as I'd like.

For example:

get-versions file.txt 1.1-

will check out all 1.* versions of file.txt, storing them as file.txt,1.1, file.txt,1.2, etc.