Changeset 759 for trunk/tools


Ignore:
Timestamp:
Dec 11, 2012, 4:49:07 PM (12 years ago)
Author:
pfusik
Message:

new.m3u: corrected.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/svn2new.pl

    r756 r759  
    22my @i = `svn log -qv -r $r:HEAD ../asma`;
    33my (%a, %d);
     4my @d;
    45for (@i) {
    5         if (m{^   A /trunk/asma/(\S+\.sap)(?: \(from /trunk/asma/(\S+\.sap)\))?}) {
     6        if (m{^   A /trunk/asma/(\S+\.sap)(?: \(from /trunk/asma/(\S+\.sap):\d+\))?}) {
    67                $a{$1} = 1, delete $d{$1} if !$2 || delete $a{$2};
    78        }
    8         elsif (m{^   D /trunk/asma/(\S+\.sap)}) {
    9                 $d{$1} = 1;
    10                 delete $a{$1};
     9        elsif (m{^   D /trunk/asma/(\S+)}) {
     10                # postpone deletes after adds, so that copy+delete in one commit works
     11                push @d, $1;
     12        }
     13        elsif (m{^---}) {
     14                for (@d) {
     15                        $d{$_} = 1;
     16                        if (/\.sap$/) {
     17                                delete $a{$_};
     18                        }
     19                        else {
     20                                my $dir = $_;
     21                                delete @a{grep m{^$dir/}, keys %a};
     22                        }
     23                }
     24                @d = ();
    1125        }
    1226}
     
    1529open F, ">deleted.txt" or die;
    1630print F "$_\n" for sort keys %d;
    17 printf "New: %d Deleted: %d\n", scalar %a, scalar %d;
     31printf "New: %d Deleted: %d\n", scalar(keys %a), scalar(keys %d);
Note: See TracChangeset for help on using the changeset viewer.