[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

I hope this might be useful to someone

From: Alexander Kamilewicz
Subject: I hope this might be useful to someone
Date: Wed, 27 Jun 2001 14:55:20 -0500

Hi all,

I was asked by some of my developers to develop a way to show what's
changed between rtags, and in some depth.

Now, as you all know, the following:

$cvs -q rdiff -s -r $rtag1 -r $rtag2 $modulename

Gives you output like this:

File module/foo/bar.jpg is removed; not included in release tag $rtag
File module/whack/zork.htm is new; current revision 1.3
File module/zip/zap/zong.jsp changed from revision 1.4 to 1.5

Which is nice and all, and helps decide, perhaps, what should be in the
next build (especially if $rtag2 is HEAD) and what shouldn't.  But to
find out more information, you're going to need to do a cvs log on each
file (or find the developer).  In my case, the module in question has
3000+ files.

So, I wrote the following perl script (below), which does the command,
and then creates 2 output files:

1.  The usual output from the cvs rdiff.
2.  Where the file is new, all of the log entries it has, where the
files is changed, all the log entries from the 1st rtag rev # to the 2nd
rtag rev #, and where the file has been removed, a note that it was

I've included the script here in the hopes it might prove useful to

Alex Kamilewicz

#!/usr/local/bin/perl -w

print "\n";

print "This script works best when run from \/workspace and when your
print "has been updated to the later rtag.\n";
print "Are you at \/workspace and have you updated to the later rtag
if (<STDIN> =~ /^n/i) {
        die "Please update your workspace.";

print "\n";

print "Name of 1st Build/Release Tag:";
chomp ($tag1=<STDIN>);

print "\n";

print "Name of 2nd Build/Release Tag:";
chomp ($tag2=<STDIN>);

if ( -f "biglogfile.txt" ) {
        unlink ("biglogfile.txt");

if ( -f "${tag2}diff.txt" ) {
        unlink ("${tag2}diff.txt");

open (DIFFILE, ">>${tag2}diff.txt") or die "error creating
${tag2}diff.txt: $!";

@files = `cvs -q rdiff -s -r $tag1 -r $tag2 module`;

print "\n";
print "The output from cvs -q rdiff -s -r $tag1 -r $tag2 module will be
put in ${tag2}diff.txt.\n";
print DIFFILE "$_" foreach(@files);
print "\n";

close (DIFFILE);

open (LOGFILE, ">>biglogfile.txt") or die "error creating
biglogfile.txt: $!";

print "Creating a log of changes between $tag1 and $tag2.\n";
print "Output will be put in biglogfile.txt.\n";
print "\n";

foreach $line (@files) {
        if ($line =~ /changed from/) {
                $line =~ /(\bmodule\/)(\S+\b).*(\d\.\d+).*(\d\.\d+)/;
                print LOGFILE "$2 changed from v. $3 to v. $4\n";
                print LOGFILE `cvs -q log -N -r$3:$4 $2`;
                print LOGFILE "\n\n";
        } elsif ($line =~ /is new/) {
                $line =~ /(\bmodule\/)(\S+\b).*(\d\.\d+)/;
                print LOGFILE "$2 is new, current version is v. $3\n";
                print LOGFILE `cvs -q log -N -r:$3 $2`;
                print LOGFILE "\n\n";
        } else {
                $line =~ /(\bmodule\/)(\S+\b)/;
                print LOGFILE "$2 was removed\n";
                print LOGFILE "\n\n";

close (LOGFILE);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]