Get the version number of the marked file in WinCvs

It seems like it should be that simple, but I can't find any solution that works ...

I need a CVS command that sets the name of the tag that you applied to the file, it will give you the version number.


CVS tree structure:

(filename) | +--> 1.1-----(branch) | | | 1.1.1.1---(tag1) | | | 1.1.1.2---(tag2) | | | 1.1.1.3---(tag3) | | | : 1.2 | | : 

For example: using the CVS command, given the tag name "tag2", how can I get CVS to give me the version number "1.1.1.2"?


The closest I can find is to use the log command with the -Q flag, but that still gives me much more information than I need.

ex: cvs -Q log -h filename

Passing a tag to the log command seems inefficient.


CVS Version Information:

enter image description here


My current solution is to use a perl script to parse the output from the log command, but there should be an easier way ...

+7
version-control branch versioning cvs
source share
1 answer

Passing the tag name (with the -r parameter) to the log command has an effect, but not particularly useful, and the effect is hidden from -h.

Usually the easiest way to get the version number for your VERSION file (the usual use case for this) is to include a keyword in it; i.e:

 # Thu 21 May 08:40:59 BST 2015 THISREV="$Revision$" 

Note. To get the version number of the repository, this VERSION file must be committed each time you commit the repo.

If you need a revision for a specific file, you basically refuse scripts from the "symbolic names" part of the log. So for r-1-0-0 you do this:

 cvs -Q log -h VERSION | awk '/^\tr-1-0-0:/ {print $NF;}' 

There is no direct equivalent to the git describe command.

+1
source share

All Articles