Line | |
---|
1 | my $r = shift or die "Usage: perl svn2new.pl STARTING_SVN_REVISION\n"; |
---|
2 | my @i = `svn log -qv -r $r:HEAD ../asma`; |
---|
3 | my (%a, %d); |
---|
4 | my @d; |
---|
5 | for (@i) { |
---|
6 | if (m{^ A /trunk/asma/(\S+\.sap)(?: \(from /trunk/asma/(\S+\.sap):\d+\))?}) { |
---|
7 | $a{$1} = 1, delete $d{$1} if !$2 || delete $a{$2}; |
---|
8 | } |
---|
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 = (); |
---|
25 | } |
---|
26 | } |
---|
27 | open F, ">new.txt" or die; |
---|
28 | print F "$_\n" for sort keys %a; |
---|
29 | open F, ">deleted.txt" or die; |
---|
30 | print F "$_\n" for sort keys %d; |
---|
31 | printf "New: %d Deleted: %d\n", scalar(keys %a), scalar(keys %d); |
---|
Note: See
TracBrowser
for help on using the repository browser.