I have a number of modules in CVS with different tags. How would I go about getting the name of the branch these tagged files exist on? I’ve tried checking out a file from the module using cvs co -r TAG and then doing cvs log but it appears to give me a list of all of the branches that the file exists on, rather than just a single branch name.
Also this needs to be an automated process, so I can’t use web based tools like viewvc to gather this info.
I have the following Korn functions that you might be able to adjust to run in bash. It should be apparent what it’s doing.
Use
get_ver()to determine the version number for a file path and given tag. Then pass the file path and version number toget_branch_name(). Theget_branch_name()function relies on a few other helpers to fetch information and slice up the version numbers.