Thread: [poe-commits] poe/mylib cvs-log.perl,1.6,1.7
Brought to you by:
rcaputo
From: <rc...@us...> - 2004-04-25 15:06:34
|
Update of /cvsroot/poe/poe/mylib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12205/mylib Modified Files: cvs-log.perl Log Message: Add command line switches, and normalize whitespace so the results are more machine friendly. Index: cvs-log.perl =================================================================== RCS file: /cvsroot/poe/poe/mylib/cvs-log.perl,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** cvs-log.perl 17 Apr 2004 17:11:14 -0000 1.6 --- cvs-log.perl 25 Apr 2004 15:05:36 -0000 1.7 *************** *** 2,22 **** # $Id$ ! # This program is Copyright 2002 by Rocco Caputo. All rights are # reserved. This program is free software. It may be modified, used, # and redistributed under the same terms as Perl itself. # Generate a nice looking change log from the CVS logs for a Perl ! # project. use strict; use Text::Wrap qw(wrap fill $columns $huge); $Text::Wrap::huge = "wrap"; $Text::Wrap::columns = 74; ! use Time::Local; ! my $date_range = "-d'1 year ago<'"; ! # $date_range = "-d'2 years ago<'"; my ( %rev, %file, %time, %tag, %tags_by_time, %log, %last_tag_times, ); --- 2,37 ---- # $Id$ ! # This program is Copyright 2002-2004 by Rocco Caputo. All rights are # reserved. This program is free software. It may be modified, used, # and redistributed under the same terms as Perl itself. # Generate a nice looking change log from the CVS logs for a Perl ! # project. The log is also easy for machines to parse. + use warnings; use strict; + use Getopt::Long; use Text::Wrap qw(wrap fill $columns $huge); + use Time::Local; + $Text::Wrap::huge = "wrap"; $Text::Wrap::columns = 74; ! my $date_range = "1 year ago<"; # How back to check. ! my $cvs_dir = "."; # Where to log from. ! my $send_help = 0; # Display help and exit. ! GetOptions( ! "age=s" => \$date_range, ! "dir=s" => \$cvs_dir, ! "help" => \$send_help, ! ) or exit; ! ! die( ! "$0 usage:\n", ! " --age 'cvs date spec'\n", ! " --dir /path/to/cvs/checkout\n", ! ) if $send_help; my ( %rev, %file, %time, %tag, %tags_by_time, %log, %last_tag_times, ); *************** *** 30,40 **** sub ST_SKIP () { 0x10 } ! sub FL_TIME () { 0 } ! sub FL_AUTH () { 1 } ! sub FL_DESC () { 2 } ! sub LOG_VER () { 0 } ! sub LOG_DSC () { 1 } ! sub LOG_AUTH () { 2 } ### Gather the change log information for the date range, and collate --- 45,55 ---- sub ST_SKIP () { 0x10 } ! sub FL_TIME () { 0 } ! sub FL_AUTH () { 1 } ! sub FL_DESC () { 2 } ! sub LOG_VER () { 0 } ! sub LOG_DSC () { 1 } ! sub LOG_AUTH () { 2 } ### Gather the change log information for the date range, and collate *************** *** 46,50 **** my $rcs_file = ""; ! open(LOG, "/usr/bin/cvs log $date_range .|") or die "can't get cvs log: $!"; while (<LOG>) { --- 61,67 ---- my $rcs_file = ""; ! chdir($cvs_dir) or die "Can't chdir $cvs_dir: $!"; ! open(LOG, "/usr/bin/cvs log -d '$date_range' .|") ! or die "can't get cvs log: $!"; while (<LOG>) { *************** *** 154,157 **** --- 171,177 ---- foreach my $ver (keys %{$file{$file}}) { my $desc = fill(" ", " ", $file{$file}{$ver}[FL_DESC]); + # Blank lines should have the right amount of leading space. This + # makes it easier for other utilities to parse. + $desc =~ s/^\s*$/ /mg; $file{$file}{$ver}[FL_DESC] = $desc; } |