Monday, April 2, 2012

Getting revision history from cvs

I had the worst time a week ago trying to get the history from cvs at a top level directory using eclipse. However I there is no option to right click a project directory, or any directory, and show the history for that item.

To get all my commits I came up with the following from reading around forums and reference sites:
cvs log -N -S -r -w > branch.log
I have no idea what all the options mean, but the "-w" are my commits and "-r" is the branch I am getting the log history on. An important point here is you will note I am feeding standard out to a file because this command prints all kinds of warning information I don't care about to the standard error stream.

The file will show something like this as a result:
RCS file: %FULL PATH FILE NAME IN REPO%,v
Working file: %FULL PATH FILE NAME ON FILE SYSTEM%
head: 1.70
branch:
locks: strict
access list:
keyword substitution: kv
total revisions: 77; selected revisions: 1
description:
----------------------------
revision 1.67.4.1
date: 2012-03-21 10:18:43 -0400;  author: %USERNAME%;  state: Exp;  lines: +4 -2;  commitid: hhCEg6Vtn6C46LXv;
%COMMIT COMMENT HERE%
=============================================================================
The key to finding my changes per ticket is in my "%COMMIT COMMENT HERE%" portion where I prefix my comments with the ticket as a standard.

This literally took me like 4 hours to put together due to my desperate attempt to find a solution working within Eclipse. Once I gave up on that, I started looking at a command line reference.

See also:

No comments:

Share on Twitter