Changeset 759 for trunk/tools
- Timestamp:
- Dec 11, 2012, 4:49:07 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/svn2new.pl
r756 r759 2 2 my @i = `svn log -qv -r $r:HEAD ../asma`; 3 3 my (%a, %d); 4 my @d; 4 5 for (@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+\))?}) { 6 7 $a{$1} = 1, delete $d{$1} if !$2 || delete $a{$2}; 7 8 } 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 = (); 11 25 } 12 26 } … … 15 29 open F, ">deleted.txt" or die; 16 30 print F "$_\n" for sort keys %d; 17 printf "New: %d Deleted: %d\n", scalar %a, scalar %d;31 printf "New: %d Deleted: %d\n", scalar(keys %a), scalar(keys %d);
Note: See TracChangeset
for help on using the changeset viewer.