In my development team we use requirements management to control the expected behavior and functions of our products and a bug report tool to track ‘problem reports’ (PR). Any change in the requirements is done by a ‘change proposal’ (CP) which acts much like a commit on a code repository.
In order to make any commit that changes the final product one must supply on the CVS commit commentary a trace which can be either a CP (this means that the change on your code reflects a change in the product) or a PR (which means the changes in the code are being made to correct a problem). CPs and PRs are numbered so that one can link changes in code to the causing item (CP or PR).
Sample commentaries
Error correction commit commentary:
Kind: Error Correction
Trace: PR-015 Crashing upon startup
Description: Edited file foo.c in order to verify uninitialized variables.
Product change commit commentary:
Kind: Development
Trace: CP-053 New login mechanism
Description: Added login mechanism with library X and blablabla.
My problem here is that I don’t have any easy way of retrieving all the files that were changed for a specific CP or PR neither can I retrieve all the changes made to the code.
I have tried to use regexp (RE from python) in order to parse the log but it has been a little tough to cover all possible logs. My regular expressions failed to retrieve the list here and there even after adapting it some times.
So, I’ve been thinking if there isn’t any easier way or any project or product or even a CVS built-in feature that might help me here.
The objective question: How do I retrieve the list of modified files in a commit which is identifiable by a well-formed tag (the CP or PR)? Is there an easier way or should I stick to log parsing?
Environment details:
OS: Windows XP
CVS server: cvsnt
CVS client: tortoise / cvsnt
Didn’t want to answer my own question but I think it may be helpful for future reference for people with the same problem.
Well, I managed to perform a search within the ‘log messages’ (cvs term for the commit commentaries) filtering by the content of the text in the log message and group the files changed on that commit.
As pointed out by ‘Joakim Elofsson’ here, cvsps is a good tool for grouping commit information in ‘patch sets’ which are individual commits with references to all the files changed in those commits.
I used the version of cvsps packed for cygwin as at this moment there’s no port for windows.
Just install the cygwin with the internet setup available here and, when choosing packages, search for cvsps and cvs, install both.
I couldn’t manage to use the checked out files on my system (through the /cygdrive/c folder) so I checked them out from the cygwin shell.
BEGIN Obs for tortoise users
You’ll need to setup CVSROOT environment var to the current CVSROOT of your repository by the command:
Usually, if check the properties page of any file of your checked out code base there will be a tab named CVS. There’ll be your CVSROOT string. (if you’re using :sspi: to connect to your remote repository as I do, you may try to switch it to :pserver:, it did work for me but I don’t know exactly why).
END Obs for tortoise users
Well, after checking out your repository use command:
This will create the cvsps patchset base for your requests. Then use:
It will search the patch sets for log messages matching the input regexp.
This is a sample from using
cvsps -lP100-PR-FEX` on my database (changed some filenames and paths for being able to make it public…):You may also use it to compare changes between tags (which I use to control releases) with
cvsps -r <tag1> -r <tag2>.