summaryrefslogtreecommitdiff
path: root/Porting
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-10-16 13:55:27 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-10-16 13:55:27 +0000
commit2ebe8b91ab67435fb4f0ac6eaaf84ce563103cf0 (patch)
tree95d8d1bd10b1abe5f2fac5da04e46d8dd1634b38 /Porting
parentdc67250a4bf75dbb2330c3abfd63b9822c4e4700 (diff)
downloadperl-2ebe8b91ab67435fb4f0ac6eaaf84ce563103cf0.tar.gz
Add the capability to include/exclude branches.
p4raw-id: //depot/perl@7347
Diffstat (limited to 'Porting')
-rwxr-xr-xPorting/genlog24
1 files changed, 22 insertions, 2 deletions
diff --git a/Porting/genlog b/Porting/genlog
index efb7ef8e10..218da41d04 100755
--- a/Porting/genlog
+++ b/Porting/genlog
@@ -20,7 +20,7 @@ use Text::Wrap;
$0 =~ s|^.*/||;
unless (@ARGV) {
die <<USAGE;
- $0 [-p \$P4PORT] <change numbers or from..to>
+ $0 [-p \$P4PORT] [-bi branch_include] [-be branch_exclude] <change numbers or from..to>
USAGE
}
@@ -32,6 +32,11 @@ my %editkind;
my $p4port = $ENV{P4PORT} || 'localhost:1666';
+my @branch_include;
+my @branch_exclude;
+my %branch_include;
+my %branch_exclude;
+
while (@ARGV) {
$_ = shift;
if (/^(\d+)\.\.(\d+)$/) {
@@ -43,6 +48,12 @@ while (@ARGV) {
elsif (/^-p(.*)$/) {
$p4port = $1 || shift;
}
+ elsif (/^-bi(.*)$/) {
+ push @branch_include, $1 || shift;
+ }
+ elsif (/^-be(.*)$/) {
+ push @branch_exclude, $1 || shift;
+ }
else {
warn "Arguments must be change numbers, ignoring `$_'\n";
}
@@ -50,6 +61,9 @@ while (@ARGV) {
@changes = sort { $b <=> $a } @changes;
+@branch_include{@branch_include} = @branch_include if @branch_include;
+@branch_exclude{@branch_exclude} = @branch_exclude if @branch_exclude;
+
my @desc = `p4 -p $p4port describe -s @changes`;
if ($?) {
die "$0: `p4 -p $p4port describe -s @changes` failed, status[$?]\n";
@@ -58,6 +72,7 @@ else {
chomp @desc;
while (@desc) {
my ($change,$who,$date,$time,@log,$branch,$file,$type,%files);
+ my $skip = 0;
$_ = shift @desc;
if (/^Change (\d+) by (\w+)\@.+ on (\S+) (\S+)\s*$/) {
($change, $who, $date, $time) = ($1,$2,$3,$4);
@@ -73,6 +88,11 @@ else {
last unless /^\.\.\./;
if (m{^\.\.\. //depot/(.*?perl|[^/]*)/([^#]+)#\d+ (\w+)\s*$}) {
($branch,$file,$type) = ($1,$2,$3);
+ if (exists $branch_exclude{$branch} or
+ @branch_include and
+ not exists $branch_include{$branch}) {
+ $skip++;
+ }
$files{$branch} = {} unless exists $files{$branch};
$files{$branch}{$type} = [] unless exists $files{$branch}{$type};
push @{$files{$branch}{$type}}, $file;
@@ -83,7 +103,7 @@ else {
}
}
}
- next unless $change;
+ next if not $change or $skip;
print "_" x 76, "\n";
printf <<EOT, $change, $who, $date, $time;
[%6s] By: %-25s on %9s %9s