ext\ExtUtils\t\Embed.t fails test when upgrading a perl with different core headers.
[p5sagit/p5-mst-13.2.git] / Porting / genlog
index 218da41..9926b37 100755 (executable)
@@ -1,4 +1,4 @@
-#!/l/local/bin/perl -w
+#!/usr/bin/perl -w
 #
 # Generate a nice changelist by querying perforce.
 #
@@ -39,8 +39,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 +69,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 +90,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,7 +106,7 @@ else {
                }
            }
        }
-       next if not $change or $skip;
+       next if ((not $change) or $skip);
        print "_" x 76, "\n";
        printf <<EOT, $change, $who, $date, $time;
 [%6s] By: %-25s             on %9s %9s