I've made modifications to log_accum.pl based on information from RMS
and Andre Spiegel.  I've tested these modifications outside of a live
CVS environment, and I believe the changes should work fine.  If
someone on savannah-hackers could give this a test run on a CVS tree
that has an in-use branch, that would be great.

As I understand the situation, with the current version of
log_accum.pl on savannah, generating diffs does not work correctly if
a branch is in use.  My patch does a cvs rlog at the time of commit to
figure out the current version on a branch and generates a diff
against the prior version (whose revision number is one minor number
less than the current revision).

I've attached a patch and the full new version of log_accum.pl.

--- log_accum.pl	2003-06-05 15:34:59.576398105 -0400
+++ new-log_accum.pl	2003-06-05 15:14:14.175451437 -0400
@@ -779,8 +779,20 @@
 		    print STDERR "main(): doing diff on $dofile\n";
 		}
 		if ($branch ne '') {
+		    my $prior_revision = '0.0';
+		    my $current_revision = '0.0';
+		    open (LOG, "-|")
+			|| exec 'cvs', '-nQq', 'rlog', '-r', "$branch.", "$modulename/$dofile";
+		    while (<LOG>) {
+			if (/^revision ((?:\d+\.)+)(\d+)/) {
+			    $current_revision = $1 . $2;
+			    $prior_revision = $1 . ($2 - 1);
+			    last;
+			}
+		    }
+
 		    open (DIFF, "-|")
-			|| exec 'cvs', '-nQq', 'rdiff', '-r', $branch, '-t', ($do_unidiff ? '-u' : '-c'), "$modulename/$dofile";
+			|| exec 'cvs', '-nQq', 'rdiff', '-r', $prior_revision, '-r', $current_revision, ($do_unidiff ? '-u' : '-c'), "$modulename/$dofile";
 		} else {
 		    open (DIFF, "-|")
 			|| exec 'cvs', '-nQq', 'rdiff', '-t', ($do_unidiff ? '-u' : '-c'), "$modulename/$dofile";

Attachment: log_accum.pl
Description: branch diff version of log_accum

_______________________________________________
Savannah-hackers mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/savannah-hackers

Reply via email to