I need a CVS command that given the name of a branch, it will give you the revision number of the last file in that branch.
CVS Tree structure:
(filename)
|
+--> 1.1-----(branch)
| |
| 1.1.1.1
| |
| 1.1.1.2
| |
| 1.1.1.3
|
|
1.2
|
|
:
For example: Using a CVS command, given the tag name "branch", how can I get CVS to give me the revision number "1.1.1.3"?
I have tried using the log
command and expected to be able to parse the output of the log
command in order to get the version number, but the version that the log
command outputs for the branch does not match the version number at the end of the branch.
ex: cvs -Q log -h filename
CVS Version information:
I posted a similar question here about getting the version number of a file from a tag name. I never got a clear answer on how to do that either, but I was able to find a workaround by parsing the log
output with a Perl script.
Since the log
output for the branch does not match the version number at the end of the branch my Perl script solution doesn't work here.
you should use
cvs log -rMyBranch. MyFilename
, whereMyBranch.
is branch in question with dot added as last character, andMyFilename
is filename in question.Example:
cvs log -rTestBranch. TestFile.txt
From there, you can easily parse the revision.