I am upgrading an old jsp web application using eclipse. For class version numbers CVS is used. The application is installed at client's environments by exporting it to a war file and deploying it on a tomcat, weblogic, or other app server.
The question is: Once I make a change to my application, commit the changes and export the war, where can I find something like a version number or a build number for the application as a whole? I need this number as an identifier for the app version, to be able to distinguish the latest war from the previous ones, and to later know what app version is installed by just looking at the war. Also, it is important to have this from a QA perspective.
CVS really doesn't understand 'snapshots' of the repository; it works at a file level. So your best solution would be to get up to date and use something like Git with the "git describe" command.
Assuming you can't do the obvious you might try the "cvsps" command. This does a "cvs rlog" on the database and divides the changes up into "PatchSets". Then find the highest numbered patchset (or count the patch sets leading to your tag/branch)
$ cvsps 2>/dev/null | grep '^PatchSet' | tail -1
or
$ cvsps -b HEAD 2>/dev/null | grep '^PatchSet' | wc -l