RCS file: /usr/local/cvs/scripts/myFile.pl,v
Working file: myFile.pl
head: 1.4
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 4; selected revisions: 4
description:
----------------------------
revision 1.4
date: 2001/08/02 21:28:39; author: alw9; state: Exp; lines: +1 -1
some comment here
----------------------------
revision 1.3
date: 2001/07/30 04:15:00; author: alw9; state: Exp; lines: +2 -0
another comment
----------------------------
revision 1.2
date: 2001/07/25 18:01:05; author: alw9; state: Exp; lines: +1 -1
cvs comments go here
----------------------------
revision 1.1
date: 2001/07/25 17:38:17; author: jms18; state: Exp;
put this in the cvs repository
and comment the cvs
=============================================================================
####
#!/usr/bin/perl -w
use strict;
use Cwd;
my($ver, $date, $coder);
my $currentDir = cwd(); # remember starting dir
# change into temp working area
chdir "/tmp" or die "Could not change to /tmp because: $!\n";
# grab the cvs project from the repository
`cvs co scripts`;
#hop into the temp dir
chdir "./scripts" or die "Could not change to /tmp because: $!\n";
# run 'cvs log' against file and grab the output
my @output = `cvs log myFile.pl`;
for(@output)
{
next if 1..11; # skip first eleven lines of output
$ver = $1 if(/^revision\s(\d+\.\d+)$/);
$date = $1, $coder = $2
if(m!^date:\s(\d{4}/\d{2}/\d{2})\s[\d|:]+;\s+author:\s+(\w+);!);
# if we have everything we were looking for
# print it out and undef the variables
if( defined($ver) && defined($date) && defined($coder) )
{
print "ver = $ver\ndate = $date\ncoder = $coder\n\n";
undef $ver;
undef $date;
undef $coder;
next;
}
} # end while
# change back to tmp dir and delete the project
chdir "/tmp" or die "Could not change to /tmp because: $!\n";
`rm -rf ./scripts`;
# return the user to his scheduled dir
chdir $currentDir or die "Could not change to $currentDir because: $!\n";
####
$ver = $1, $date = $2, $coder = $3
if(m!\Arevision\s(\d+\.\d+)$
^date:\s(\d{4}/\d{2}/\d{2})\s[\d|:]+;\s+author:\s+(\w+);
[\w|\s|:|;|\d|\+|-]+\Z!mx);