X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Porting%2Fgenlog;h=610e9762a1432a5622443b9b019408d4afa245e2;hb=357244ac7b8824046a2f6fdab432230dbbd8cadd;hp=218da41d0423a92909cb01cae1a08009fad0627d;hpb=2ebe8b91ab67435fb4f0ac6eaaf84ce563103cf0;p=p5sagit%2Fp5-mst-13.2.git diff --git a/Porting/genlog b/Porting/genlog index 218da41..610e976 100755 --- a/Porting/genlog +++ b/Porting/genlog @@ -1,4 +1,4 @@ -#!/l/local/bin/perl -w +#!/usr/bin/perl -w # # Generate a nice changelist by querying perforce. # @@ -16,6 +16,7 @@ # use Text::Wrap; +use Text::Tabs; $0 =~ s|^.*/||; unless (@ARGV) { @@ -39,8 +40,8 @@ my %branch_exclude; while (@ARGV) { $_ = shift; - if (/^(\d+)\.\.(\d+)$/) { - push @changes, $1 .. $2; + if (/^(\d+)\.\.(\d+)?$/) { + push @changes, $1 .. ($2 || (split(' ', `p4 changes -m 1`))[1]); } elsif (/^\d+$/) { push @changes, $_; @@ -69,10 +70,12 @@ if ($?) { die "$0: `p4 -p $p4port describe -s @changes` failed, status[$?]\n"; } else { + tr/\r/\n/ foreach @desc; chomp @desc; while (@desc) { my ($change,$who,$date,$time,@log,$branch,$file,$type,%files); my $skip = 0; + my $nbranch = 0; $_ = shift @desc; if (/^Change (\d+) by (\w+)\@.+ on (\S+) (\S+)\s*$/) { ($change, $who, $date, $time) = ($1,$2,$3,$4); @@ -88,6 +91,7 @@ else { last unless /^\.\.\./; if (m{^\.\.\. //depot/(.*?perl|[^/]*)/([^#]+)#\d+ (\w+)\s*$}) { ($branch,$file,$type) = ($1,$2,$3); + $nbranch++; if (exists $branch_exclude{$branch} or @branch_include and not exists $branch_include{$branch}) { @@ -103,12 +107,12 @@ else { } } } - next if not $change or $skip; - print "_" x 76, "\n"; - printf < 25 && ($kind eq 'integrate' || $kind eq 'branch')) || @$files > 100; - print wrap(sprintf("%12s ", $editkind{$kind}), - sprintf("%12s ", $editkind{$kind}), - "@$files\n"); + $output .= wrap(sprintf("%12s ", $editkind{$kind}), + sprintf("%12s ", $editkind{$kind}), + "@$files\n"); } } + print unexpand($output); } }