line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SVN::Dump::Property; |
2
|
|
|
|
|
|
|
|
3
|
13
|
|
|
13
|
|
30158
|
use strict; |
|
13
|
|
|
|
|
24
|
|
|
13
|
|
|
|
|
839
|
|
4
|
13
|
|
|
13
|
|
71
|
use warnings; |
|
13
|
|
|
|
|
18
|
|
|
13
|
|
|
|
|
7533
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
my $NL = "\012"; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# FIXME should I use Tie::Hash::IxHash or Tie::Hash::Indexed? |
9
|
|
|
|
|
|
|
sub new { |
10
|
468
|
|
|
468
|
1
|
2789
|
my ( $class, @args ) = @_; |
11
|
468
|
|
|
|
|
2687
|
return bless { |
12
|
|
|
|
|
|
|
keys => [], |
13
|
|
|
|
|
|
|
hash => {}, |
14
|
|
|
|
|
|
|
}, $class; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub set { |
18
|
801
|
|
|
801
|
1
|
3612
|
my ( $self, $k, $v ) = @_; |
19
|
|
|
|
|
|
|
|
20
|
801
|
100
|
|
|
|
2256
|
push @{ $self->{keys} }, $k if !exists $self->{hash}->{$k}; |
|
800
|
|
|
|
|
3018
|
|
21
|
801
|
|
|
|
|
3744
|
$self->{hash}{$k} = $v; |
22
|
|
|
|
|
|
|
} |
23
|
9
|
|
|
9
|
1
|
54
|
sub get { return $_[0]{hash}{ $_[1] }; } |
24
|
3
|
|
|
3
|
1
|
523
|
sub keys { return @{ $_[0]{keys} }; } |
|
3
|
|
|
|
|
18
|
|
25
|
3
|
|
|
3
|
1
|
2481
|
sub values { return @{ $_[0]{hash} }{ @{ $_[0]{keys} } }; } |
|
3
|
|
|
|
|
23
|
|
|
3
|
|
|
|
|
11
|
|
26
|
|
|
|
|
|
|
sub delete { |
27
|
9
|
|
|
9
|
1
|
2270
|
my ( $self, @keys ) = @_; |
28
|
9
|
100
|
|
|
|
32
|
return if !@keys; |
29
|
8
|
|
|
|
|
14
|
my $re = qr/^@{[join '|', map { quotemeta } @keys]}$/; |
|
8
|
|
|
|
|
17
|
|
|
14
|
|
|
|
|
201
|
|
30
|
8
|
|
|
|
|
30
|
$self->{keys} = [ grep { !/$re/ } @{ $self->{keys} } ]; |
|
42
|
|
|
|
|
242
|
|
|
8
|
|
|
|
|
21
|
|
31
|
8
|
|
|
|
|
19
|
delete @{ $self->{hash} }{@keys}; |
|
8
|
|
|
|
|
57
|
|
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub as_string { |
35
|
607
|
|
|
607
|
1
|
2831
|
my ($self) = @_; |
36
|
607
|
|
|
|
|
782
|
my $string = ''; |
37
|
|
|
|
|
|
|
|
38
|
607
|
|
|
|
|
7275
|
$string .= |
39
|
|
|
|
|
|
|
defined $self->{hash}{$_} |
40
|
|
|
|
|
|
|
# existing key |
41
|
|
|
|
|
|
|
? ( "K " . length($_) . $NL ) . "$_$NL" |
42
|
|
|
|
|
|
|
. ( "V " . length( $self->{hash}{$_} ) . $NL ) |
43
|
|
|
|
|
|
|
. "$self->{hash}{$_}$NL" |
44
|
|
|
|
|
|
|
# deleted key (v3) |
45
|
|
|
|
|
|
|
: ( "D " . length($_) . "$NL$_$NL" ) |
46
|
607
|
100
|
|
|
|
701
|
for @{ $self->{keys} }; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
# end marker |
49
|
607
|
|
|
|
|
1314
|
$string .= "PROPS-END$NL"; |
50
|
|
|
|
|
|
|
|
51
|
607
|
|
|
|
|
2134
|
return $string; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__ |