0

I have a project that uses CVS and recently bumped the baseline to the next major revision, 4.0. What I am trying to do, is get the last version of a file before that bump (programatically, I know I can inspect the file in an editor).

For instance, if I have the following couple files with versions, I want to get what is after the arrow (=>):

 makefile ... 3.4, 3.5, 4.0       => 3.5
 main.cc  ... 3.9. 3.10, 4.0, 4.1 => 3.10

1 Answer 1

0

Here you are:

cvs rlog -b YourModuleName 2>/dev/null |sed '$bd;/^RCS file:/{:d;x;s/\n/\t/g;s/revision[.0-9\t ]*revision //;s/\trevision.*$//;n};/^revision/H;d'

For a file that has only one revision it will print its name but no revision.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .