Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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  ... 3.9. 3.10, 4.0, 4.1 => 3.10
share|improve this question

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.

share|improve this answer

You must log in to answer this question.

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