| 1 | #!/pro/bin/perl | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | # Copyright (c) 2007-2023 H.Merijn Brand. All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||
| 5 | package VCS::SCCS; | ||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 4 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | 4 | ▶ | use POSIX qw(mktime); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | 4 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||
| 13 | 4 | ▶ | use vars qw( $VERSION ); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 14 | 4 | $VERSION = "0.28"; | |||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||
| 16 | ### ########################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||
| 18 | # We can safely use \d instead of [0-9] for this ancient format | ||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||
| 20 | sub new { | ||||||||||||||||||||||||||||||||||||||||||
| 21 | 12 | ▶ | my $proto = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=17 SCAR=28.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | 12 | ▶ | my $class = ref ($proto) || $proto or return; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
ref $proto || $proto
MC/DC0%0/2
ref $proto || $proto
ref $proto
$proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
| |||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||
| 24 | # We can safely rule out "0" as a valid filename, ans 99.9999% of | ||||||||||||||||||||||||||||||||||||||||||
| 25 | # SCCS source files start with s. | ||||||||||||||||||||||||||||||||||||||||||
| 26 | 12 | ▶ | my $fn = shift or croak ("SCCS needs a valid file name"); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 27 | 9 | ▶ | -e $fn or croak ("$fn does not exist"); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 28 | 8 | ▶ | -f $fn or croak ("$fn is not a file"); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 29 | 6 | ▶ | -s $fn or croak ("$fn is empty"); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 30 | 5 | (my $filename = $fn) =~ s{\b(?:SCCS|sccs)/s\.(?=[^/]+$)}{}; | |||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | 5 | ▶ | open my $fh, "<", $fn or croak ("Cannot open '$fn': $!"); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||
| 34 | # Checksum | ||||||||||||||||||||||||||||||||||||||||||
| 35 | # ^Ah checksum | ||||||||||||||||||||||||||||||||||||||||||
| 36 | 4 | ▶ | <$fh> =~ m/^\cAh(\d+)$/ or croak ("SCCS file $fn is supposed to start with a checksum"); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||
| 38 | 3 | my %sccs = ( | |||||||||||||||||||||||||||||||||||||||||
| 39 | file => $filename, | ||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||
| 41 | checksum => $1, | ||||||||||||||||||||||||||||||||||||||||||
| 42 | delta => {}, | ||||||||||||||||||||||||||||||||||||||||||
| 43 | users => [], | ||||||||||||||||||||||||||||||||||||||||||
| 44 | flags => {}, | ||||||||||||||||||||||||||||||||||||||||||
| 45 | comment => "", | ||||||||||||||||||||||||||||||||||||||||||
| 46 | body => undef, | ||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||
| 48 | current => undef, | ||||||||||||||||||||||||||||||||||||||||||
| 49 | vsn => {}, # version to revision map | ||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||
| 51 | tran => undef, | ||||||||||||||||||||||||||||||||||||||||||
| 52 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||
| 54 | # Delta's At least one! ^A[ixg] ignored | ||||||||||||||||||||||||||||||||||||||||||
| 55 | # ^As inserted/deleted/unchanged | ||||||||||||||||||||||||||||||||||||||||||
| 56 | # ^Ad D version date time user v_new v_old | ||||||||||||||||||||||||||||||||||||||||||
| 57 | # ^Am MR | ||||||||||||||||||||||||||||||||||||||||||
| 58 | # ^Ac comment | ||||||||||||||||||||||||||||||||||||||||||
| 59 | # ^Ae | ||||||||||||||||||||||||||||||||||||||||||
| 60 | 3 | $_ = <$fh>; | |||||||||||||||||||||||||||||||||||||||||
| 61 | 3 | ▶ | while (m{^\cAs (\d+)/(\d+)/(\d+)$}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||
| 63 | 73 | my @delta; | |||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||
| 65 | 73 | my ($l_ins, $l_del, $l_unc) = map { $_ + 0 } $1, $2, $3; | |||||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||||||
| 67 | 73 | { local $/ = "\cAe\n"; | |||||||||||||||||||||||||||||||||||||||||
| 68 | 73 | @delta = split m/\n/, scalar <$fh>; | |||||||||||||||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||
| 71 | 73 | my ($type, $vsn, $v_r, $v_l, $v_b, $v_s, | |||||||||||||||||||||||||||||||||||||||||
| 72 | $date, $y, $m, $d, $time, $H, $M, $S, | ||||||||||||||||||||||||||||||||||||||||||
| 73 | $user, $rev, $prv) = | ||||||||||||||||||||||||||||||||||||||||||
| 74 | (shift (@delta) =~ m{ | ||||||||||||||||||||||||||||||||||||||||||
| 75 | \cAd # Delta | ||||||||||||||||||||||||||||||||||||||||||
| 76 | \s+ ([DR]) # Type Delta/Remove? | ||||||||||||||||||||||||||||||||||||||||||
| 77 | \s+ ((\d+)\.(\d+) | ||||||||||||||||||||||||||||||||||||||||||
| 78 | (?:\.(\d+)(?:\.(\d+))?)?) # Vsn %R%.%L%[.%B%[.%S%]] | ||||||||||||||||||||||||||||||||||||||||||
| 79 | \s+ ((\d\d)/(\d\d)/(\d\d)) # Date %E% | ||||||||||||||||||||||||||||||||||||||||||
| 80 | \s+ ((\d\d):(\d\d):(\d\d)) # Time %U% | ||||||||||||||||||||||||||||||||||||||||||
| 81 | \s+ (\S+) # User | ||||||||||||||||||||||||||||||||||||||||||
| 82 | \s+ (\d+) # current rev | ||||||||||||||||||||||||||||||||||||||||||
| 83 | \s+ (\d+) # new rev | ||||||||||||||||||||||||||||||||||||||||||
| 84 | \s*$ | ||||||||||||||||||||||||||||||||||||||||||
| 85 | }x); | ||||||||||||||||||||||||||||||||||||||||||
| 86 | 73 | ▶ | $y += $y < 70 ? 2000 : 1900; # SCCS is not Y2k safe! | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||||||||||
| 88 | # Type R rev's are removed/overridden deltas: | ||||||||||||||||||||||||||||||||||||||||||
| 89 | # D 4.21 22 21 | ||||||||||||||||||||||||||||||||||||||||||
| 90 | # D 4.20 21 19 | ||||||||||||||||||||||||||||||||||||||||||
| 91 | # R 4.20 20 19 | ||||||||||||||||||||||||||||||||||||||||||
| 92 | # D 4.19 19 18 | ||||||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||||
| 94 | 73 | my @mr = grep { s/^\cAm\s*// } @delta; # MR number(s) | |||||||||||||||||||||||||||||||||||||||||
| 95 | 73 | my @cmnt = grep { s/^\cAc\s*// } @delta; # Comment | |||||||||||||||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||||||||||||||||
| 97 | 73 | ▶ | $sccs{current} ||= [ $rev, $vsn, $v_r, $v_l, $v_b, $v_s ]; | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$sccs{"current"} ||= [$rev, $vsn, $v_r, $v_l, $v_b, $v_s]
MC/DC100%1/1
$sccs{"current"} ||= [$rev, $vsn, $v_r, $v_l, $v_b, $v_s]
$sccs{"current"}
Truth table100%2/2
A
A= $sccs{"current"}
| |||||||||||||||||||||||||||||||||||||||||||
| 98 | 73 | $sccs{delta}{$rev} = { | |||||||||||||||||||||||||||||||||||||||||
| 99 | lines_ins => $l_ins, | ||||||||||||||||||||||||||||||||||||||||||
| 100 | lines_del => $l_del, | ||||||||||||||||||||||||||||||||||||||||||
| 101 | lines_unc => $l_unc, | ||||||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||||
| 103 | type => $type, | ||||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||
| 105 | version => $vsn, # %I% | ||||||||||||||||||||||||||||||||||||||||||
| 106 | release => $v_r, # %R% | ||||||||||||||||||||||||||||||||||||||||||
| 107 | level => $v_l, # %L% | ||||||||||||||||||||||||||||||||||||||||||
| 108 | branch => $v_b, # %B% | ||||||||||||||||||||||||||||||||||||||||||
| 109 | sequence => $v_s, # %S% | ||||||||||||||||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||||||||||||||||
| 111 | date => $date, # %E% | ||||||||||||||||||||||||||||||||||||||||||
| 112 | time => $time, # %U% | ||||||||||||||||||||||||||||||||||||||||||
| 113 | stamp => mktime ($S, $M, $H, $d, $m - 1, $y - 1900, -1, -1, -1), | ||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||
| 115 | committer => $user, | ||||||||||||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||||||||||||
| 117 | mr => join (", ", @mr), | ||||||||||||||||||||||||||||||||||||||||||
| 118 | comment => join ("\n", @cmnt), | ||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||
| 120 | prev_rev => $prv, | ||||||||||||||||||||||||||||||||||||||||||
| 121 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 122 | 73 | ▶ | exists $sccs{vsn}{$vsn} or $sccs{vsn}{$vsn} = $rev; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 123 | 73 | $_ = <$fh>; | |||||||||||||||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||
| 126 | # Users | ||||||||||||||||||||||||||||||||||||||||||
| 127 | # ^Au | ||||||||||||||||||||||||||||||||||||||||||
| 128 | # user1 | ||||||||||||||||||||||||||||||||||||||||||
| 129 | # user2 | ||||||||||||||||||||||||||||||||||||||||||
| 130 | # ... | ||||||||||||||||||||||||||||||||||||||||||
| 131 | # ^AU | ||||||||||||||||||||||||||||||||||||||||||
| 132 | 3 | ▶ | if (m{^\cAu}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 133 | 2 | { local $/ = "\cAU\n"; | |||||||||||||||||||||||||||||||||||||||||
| 134 | 2 | $sccs{users} = [ (<$fh> =~ m{^([A-Za-z].*)$}gm) ]; | |||||||||||||||||||||||||||||||||||||||||
| 135 | } | ||||||||||||||||||||||||||||||||||||||||||
| 136 | 2 | $_ = <$fh>; | |||||||||||||||||||||||||||||||||||||||||
| 137 | } | ||||||||||||||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||||||||||||||
| 139 | # Flags | ||||||||||||||||||||||||||||||||||||||||||
| 140 | # ^Af q Project name | ||||||||||||||||||||||||||||||||||||||||||
| 141 | # ^Af v ... | ||||||||||||||||||||||||||||||||||||||||||
| 142 | # ^Af e 1 | ||||||||||||||||||||||||||||||||||||||||||
| 143 | 3 | ▶ | while (m/^\cAf \s+ (\S) \s* (.+)?$/x) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 144 | 5 | $sccs{flags}{$1} = $2; | |||||||||||||||||||||||||||||||||||||||||
| 145 | 5 | $_ = <$fh>; | |||||||||||||||||||||||||||||||||||||||||
| 146 | } | ||||||||||||||||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||||||||||||||||
| 148 | # Comment | ||||||||||||||||||||||||||||||||||||||||||
| 149 | # ^At comment | ||||||||||||||||||||||||||||||||||||||||||
| 150 | 3 | ▶ | while (s/^\cA[tT]\s*//) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 151 | 6 | ▶ | m/\S/ and $sccs{comment} .= $_; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 152 | 6 | $_ = <$fh>; | |||||||||||||||||||||||||||||||||||||||||
| 153 | } | ||||||||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||||||||
| 155 | # Body | ||||||||||||||||||||||||||||||||||||||||||
| 156 | 3 | local $/ = undef; | |||||||||||||||||||||||||||||||||||||||||
| 157 | 3 | $sccs{body} = [ split m/\n/, $_ . <$fh> ]; | |||||||||||||||||||||||||||||||||||||||||
| 158 | 3 | close $fh; | |||||||||||||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||||||||||||
| 160 | 3 | return bless \%sccs, $class; | |||||||||||||||||||||||||||||||||||||||||
| 161 | } # new | ||||||||||||||||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||||||||||||||||
| 163 | sub file { | ||||||||||||||||||||||||||||||||||||||||||
| 164 | 10 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
file: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 165 | 10 | return $self->{file}; | |||||||||||||||||||||||||||||||||||||||||
| 166 | } # file | ||||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||
| 168 | sub checksum { | ||||||||||||||||||||||||||||||||||||||||||
| 169 | 2 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
checksum: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 170 | 2 | return $self->{checksum}; | |||||||||||||||||||||||||||||||||||||||||
| 171 | } # checksum | ||||||||||||||||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||||||||||||||||
| 173 | sub users { | ||||||||||||||||||||||||||||||||||||||||||
| 174 | 1 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
users: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 175 | 1 | return @{$self->{users}}; | |||||||||||||||||||||||||||||||||||||||||
| 176 | } # users | ||||||||||||||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||||||||||||||
| 178 | sub flags { | ||||||||||||||||||||||||||||||||||||||||||
| 179 | 2 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
flags: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 180 | 2 | return { %{$self->{flags}} }; | |||||||||||||||||||||||||||||||||||||||||
| 181 | } # flags | ||||||||||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||||||||||
| 183 | sub comment { | ||||||||||||||||||||||||||||||||||||||||||
| 184 | 1 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
comment: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 185 | 1 | return $self->{comment}; | |||||||||||||||||||||||||||||||||||||||||
| 186 | } # comment | ||||||||||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||||||||||
| 188 | sub current { | ||||||||||||||||||||||||||||||||||||||||||
| 189 | 2 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
current: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 190 | 2 | ▶ | $self->{current} or return; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 191 | 2 | ▶ | wantarray ? @{$self->{current}} : $self->{current}[0]; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 192 | } # current | ||||||||||||||||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||||||||||||||||
| 194 | sub delta { | ||||||||||||||||||||||||||||||||||||||||||
| 195 | 13 | ▶ | my ($self, $rev) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
delta: called CC=5 SCAR=16.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 196 | 13 | ▶ | $self->{current} or return; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 197 | 13 | ▶ | if (!defined $rev) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 198 | 1 | $rev = $self->{current}[0]; | |||||||||||||||||||||||||||||||||||||||||
| 199 | } | ||||||||||||||||||||||||||||||||||||||||||
| 200 | elsif (exists $self->{delta}{$rev}) { | ||||||||||||||||||||||||||||||||||||||||||
| 201 | #$rev = $rev; | ||||||||||||||||||||||||||||||||||||||||||
| 202 | } | ||||||||||||||||||||||||||||||||||||||||||
| 203 | elsif (exists $self->{vsn}{$rev}) { | ||||||||||||||||||||||||||||||||||||||||||
| 204 | 1 | $rev = $self->{vsn}{$rev}; | |||||||||||||||||||||||||||||||||||||||||
| 205 | } | ||||||||||||||||||||||||||||||||||||||||||
| 206 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 207 | 1 | return; | |||||||||||||||||||||||||||||||||||||||||
| 208 | } | ||||||||||||||||||||||||||||||||||||||||||
| 209 | 12 | return { %{ $self->{delta}{$rev} } }; | |||||||||||||||||||||||||||||||||||||||||
| 210 | } # delta | ||||||||||||||||||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||||||||||||||||
| 212 | sub version { | ||||||||||||||||||||||||||||||||||||||||||
| 213 | 9 | ▶ | my ($self, $rev) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
version: called CC=5 SCAR=16.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 214 | 9 | ▶ | ref $self eq __PACKAGE__ or return $VERSION; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 215 | 6 | ▶ | $self->{current} or return; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||||||||||||||||
| 217 | # $self->version () returns most recent version | ||||||||||||||||||||||||||||||||||||||||||
| 218 | 6 | ▶ | $rev or return $self->{current}[1]; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 219 | |||||||||||||||||||||||||||||||||||||||||||
| 220 | # $self->revision (12) returns version for that revision | ||||||||||||||||||||||||||||||||||||||||||
| 221 | exists $self->{delta}{$rev} and | ||||||||||||||||||||||||||||||||||||||||||
| 222 | 2 | ▶ | return $self->{delta}{$rev}{version}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||||||||||||||||||
| 224 | 1 | return; | |||||||||||||||||||||||||||||||||||||||||
| 225 | } # version | ||||||||||||||||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||||||||||||||||
| 227 | sub revision { | ||||||||||||||||||||||||||||||||||||||||||
| 228 | 6 | ▶ | my ($self, $vsn) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
revision: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 229 | 6 | ▶ | $self->{current} or return; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||||||||||||||||
| 231 | # $self->revision () returns most recent revision | ||||||||||||||||||||||||||||||||||||||||||
| 232 | 6 | ▶ | $vsn or return $self->{current}[0]; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 233 | |||||||||||||||||||||||||||||||||||||||||||
| 234 | # $self->revision (12) returns version for that revision | ||||||||||||||||||||||||||||||||||||||||||
| 235 | exists $self->{vsn}{$vsn} and | ||||||||||||||||||||||||||||||||||||||||||
| 236 | 2 | ▶ | return $self->{vsn}{$vsn}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||||||||||||||||
| 238 | 1 | return; | |||||||||||||||||||||||||||||||||||||||||
| 239 | } # revision | ||||||||||||||||||||||||||||||||||||||||||
| 240 | |||||||||||||||||||||||||||||||||||||||||||
| 241 | sub revision_map { | ||||||||||||||||||||||||||||||||||||||||||
| 242 | 1 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
revision_map: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 243 | 1 | ▶ | $self->{current} or return; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 244 | |||||||||||||||||||||||||||||||||||||||||||
| 245 | 70 | return [ map { [ $_ => $self->{delta}{$_}{version} ] } | |||||||||||||||||||||||||||||||||||||||||
| 246 | 340 | sort { $a <=> $b } | |||||||||||||||||||||||||||||||||||||||||
| 247 | 1 | keys %{$self->{delta}} ]; | |||||||||||||||||||||||||||||||||||||||||
| 248 | } # revision | ||||||||||||||||||||||||||||||||||||||||||
| 249 | |||||||||||||||||||||||||||||||||||||||||||
| 250 | 4 | my %tran = ( | |||||||||||||||||||||||||||||||||||||||||
| 251 | SCCS => { # Documentation only | ||||||||||||||||||||||||||||||||||||||||||
| 252 | }, | ||||||||||||||||||||||||||||||||||||||||||
| 253 | RCS => { | ||||||||||||||||||||||||||||||||||||||||||
| 254 | # "%W%[ \t]*%G%" => '$""Id""$', | ||||||||||||||||||||||||||||||||||||||||||
| 255 | # "%W%[ \t]*%E%" => '$""Id""$', | ||||||||||||||||||||||||||||||||||||||||||
| 256 | # "%W%" => '$""Id""$', | ||||||||||||||||||||||||||||||||||||||||||
| 257 | # "%Z%%M%[ \t]*%I%[ \t]*%G%" => '$""SunId""$', | ||||||||||||||||||||||||||||||||||||||||||
| 258 | # "%Z%%M%[ \t]*%I%[ \t]*%E%" => '$""SunId""$', | ||||||||||||||||||||||||||||||||||||||||||
| 259 | # "%M%[ \t]*%I%[ \t]*%G%" => '$""Id""$', | ||||||||||||||||||||||||||||||||||||||||||
| 260 | # "%M%[ \t]*%I%[ \t]*%E%" => '$""Id""$', | ||||||||||||||||||||||||||||||||||||||||||
| 261 | # "%M%" => '$""RCSfile""$', | ||||||||||||||||||||||||||||||||||||||||||
| 262 | # "%I%" => '$""Revision""$', | ||||||||||||||||||||||||||||||||||||||||||
| 263 | # "%G%" => '$""Date""$', | ||||||||||||||||||||||||||||||||||||||||||
| 264 | # "%E%" => '$""Date""$', | ||||||||||||||||||||||||||||||||||||||||||
| 265 | # "%U%" => '', | ||||||||||||||||||||||||||||||||||||||||||
| 266 | }, | ||||||||||||||||||||||||||||||||||||||||||
| 267 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 268 | |||||||||||||||||||||||||||||||||||||||||||
| 269 | sub set_translate { | ||||||||||||||||||||||||||||||||||||||||||
| 270 | 4 | ▶ | my ($self, $type) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_translate: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 271 | |||||||||||||||||||||||||||||||||||||||||||
| 272 | 4 | ▶ | if (ref $type eq "HASH") { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 273 | 1 | $self->{tran} = "CUSTOM"; | |||||||||||||||||||||||||||||||||||||||||
| 274 | 1 | $tran{CUSTOM} = $type; | |||||||||||||||||||||||||||||||||||||||||
| 275 | } | ||||||||||||||||||||||||||||||||||||||||||
| 276 | elsif (exists $tran{uc $type}) { | ||||||||||||||||||||||||||||||||||||||||||
| 277 | 2 | $self->{tran} = uc $type; | |||||||||||||||||||||||||||||||||||||||||
| 278 | } | ||||||||||||||||||||||||||||||||||||||||||
| 279 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 280 | 1 | $self->{tran} = undef; | |||||||||||||||||||||||||||||||||||||||||
| 281 | } | ||||||||||||||||||||||||||||||||||||||||||
| 282 | } # set_translate | ||||||||||||||||||||||||||||||||||||||||||
| 283 | |||||||||||||||||||||||||||||||||||||||||||
| 284 | sub _tran { | ||||||||||||||||||||||||||||||||||||||||||
| 285 | 38685 | ▶ | my ($self, $line) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_tran: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||||
| 286 | 38685 | ▶ | my $tt = $self->{tran} or return $line; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 287 | 11 | ▶ | my $tr = $tran{$tt} or return $line; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 288 | 11 | my $re = $tr->{re}; | |||||||||||||||||||||||||||||||||||||||||
| 289 | 11 | $line =~ s{($re)}{$tr->{$1}}g; | |||||||||||||||||||||||||||||||||||||||||
| 290 | 11 | return $line; | |||||||||||||||||||||||||||||||||||||||||
| 291 | } # _tran | ||||||||||||||||||||||||||||||||||||||||||
| 292 | |||||||||||||||||||||||||||||||||||||||||||
| 293 | sub translate { | ||||||||||||||||||||||||||||||||||||||||||
| 294 | 32 | ▶ | my ($self, $rev, $line) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
translate: called CC=8 SCAR=20.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 295 | |||||||||||||||||||||||||||||||||||||||||||
| 296 | 32 | ▶ | my $type = $self->{tran} or return $line; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 297 | 9 | ▶ | exists $self->{delta}{$rev} or return $line; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 298 | |||||||||||||||||||||||||||||||||||||||||||
| 299 | 9 | (my $def_M = $self->file ()) =~ s{.*/}{}; | |||||||||||||||||||||||||||||||||||||||||
| 300 | |||||||||||||||||||||||||||||||||||||||||||
| 301 | # TODO (or don't): %D%, %H%, %T%, %G%, %F%, %P%, %C% | ||||||||||||||||||||||||||||||||||||||||||
| 302 | 9 | my %delta = %{$self->delta ($rev)}; | |||||||||||||||||||||||||||||||||||||||||
| 303 | 9 | my $I = $delta{version}; | |||||||||||||||||||||||||||||||||||||||||
| 304 | 9 | my $Z = "@(#)"; | |||||||||||||||||||||||||||||||||||||||||
| 305 | 9 | ▶ | my $M = exists $self->{flags}{"m"} ? $self->{flags}{"m"} : $def_M; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 306 | 9 | ▶ | my $Q = exists $self->{flags}{"q"} ? $self->{flags}{"q"} : ""; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 307 | 9 | ▶ | my $Y = exists $self->{flags}{"t"} ? $self->{flags}{"t"} : ""; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 308 | 9 | $tran{SCCS}{"%U%"} = $delta{"time"}; | |||||||||||||||||||||||||||||||||||||||||
| 309 | 9 | $tran{SCCS}{"%E%"} = $delta{"date"}; | |||||||||||||||||||||||||||||||||||||||||
| 310 | 9 | $tran{SCCS}{"%R%"} = $delta{"release"}; | |||||||||||||||||||||||||||||||||||||||||
| 311 | 9 | $tran{SCCS}{"%L%"} = $delta{"level"}; | |||||||||||||||||||||||||||||||||||||||||
| 312 | 9 | $tran{SCCS}{"%B%"} = $delta{"branch"}; | |||||||||||||||||||||||||||||||||||||||||
| 313 | 9 | $tran{SCCS}{"%S%"} = $delta{"sequence"}; | |||||||||||||||||||||||||||||||||||||||||
| 314 | 9 | $tran{SCCS}{"%I%"} = $I; | |||||||||||||||||||||||||||||||||||||||||
| 315 | 9 | $tran{SCCS}{"%Z%"} = $Z; | |||||||||||||||||||||||||||||||||||||||||
| 316 | 9 | $tran{SCCS}{"%M%"} = $M; | |||||||||||||||||||||||||||||||||||||||||
| 317 | 9 | $tran{SCCS}{"%W%"} = "$Z$M\t$I"; | |||||||||||||||||||||||||||||||||||||||||
| 318 | 9 | $tran{SCCS}{"%A%"} = "$Z$Y $M $I$Z"; | |||||||||||||||||||||||||||||||||||||||||
| 319 | 9 | $tran{SCCS}{"%Q%"} = $Q; | |||||||||||||||||||||||||||||||||||||||||
| 320 | 9 | $tran{SCCS}{"%Y%"} = $Y; | |||||||||||||||||||||||||||||||||||||||||
| 321 | |||||||||||||||||||||||||||||||||||||||||||
| 322 | 9 | ▶ | unless (exists $tran{$type}{re}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 323 | 2 | my $kw = join "|", reverse sort keys %{$tran{$type}}; | |||||||||||||||||||||||||||||||||||||||||
| 324 | 2 | ▶ | $tran{$type}{re} = $kw ? qr{$kw} : undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 325 | } | ||||||||||||||||||||||||||||||||||||||||||
| 326 | |||||||||||||||||||||||||||||||||||||||||||
| 327 | 9 | return $self->_tran ($line); | |||||||||||||||||||||||||||||||||||||||||
| 328 | } # translate | ||||||||||||||||||||||||||||||||||||||||||
| 329 | |||||||||||||||||||||||||||||||||||||||||||
| 330 | sub body { | ||||||||||||||||||||||||||||||||||||||||||
| 331 | 16 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
body: called CC=24 SCAR=32.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 332 | |||||||||||||||||||||||||||||||||||||||||||
| 333 | 16 | ▶ | $self->{body} && $self->{current} or return; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$self->{"body"} and $self->{"current"}
MC/DC0%0/2
$self->{"body"} and $self->{"current"}
$self->{"body"}
$self->{"current"}
Truth table33%1/3
A and B
A= $self->{"body"}B= $self->{"current"}
| |||||||||||||||||||||||||||||||||||||||||||
| 334 | 16 | ▶ | my $r = shift || $self->{current}[0]; | ||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
shift() || $self->{'current'}[0]
MC/DC0%0/2
shift() || $self->{'current'}[0]
shift()
$self->{'current'}[0]
Truth table66%2/3
A || B
A= shift()B= $self->{'current'}[0]
| |||||||||||||||||||||||||||||||||||||||||||
| 335 | |||||||||||||||||||||||||||||||||||||||||||
| 336 | 16 | ▶ | exists $self->{vsn}{$r} and $r = $self->{vsn}{$r}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 337 | |||||||||||||||||||||||||||||||||||||||||||
| 338 | 16 | my @lvl = ([ 1, "I", 0 ]); | |||||||||||||||||||||||||||||||||||||||||
| 339 | 16 | my @body; | |||||||||||||||||||||||||||||||||||||||||
| 340 | |||||||||||||||||||||||||||||||||||||||||||
| 341 | # my $v = sub { | ||||||||||||||||||||||||||||||||||||||||||
| 342 | # join " ", map { sprintf "%s:%02d", $_->[1], $_->[2] } @lvl[1..$#lvl]; | ||||||||||||||||||||||||||||||||||||||||||
| 343 | # }; # v | ||||||||||||||||||||||||||||||||||||||||||
| 344 | |||||||||||||||||||||||||||||||||||||||||||
| 345 | my %rseq; | ||||||||||||||||||||||||||||||||||||||||||
| 346 | 16 | my $rr = $r; | |||||||||||||||||||||||||||||||||||||||||
| 347 | 16 | ▶ | while ($rr) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 348 | 301 | $rseq{$rr} = 1; | |||||||||||||||||||||||||||||||||||||||||
| 349 | 301 | $rr = $self->{delta}{$rr}{prev_rev}; | |||||||||||||||||||||||||||||||||||||||||
| 350 | } | ||||||||||||||||||||||||||||||||||||||||||
| 351 | |||||||||||||||||||||||||||||||||||||||||||
| 352 | 16 | $self->translate ($r, ""); # Initialize translate hash | |||||||||||||||||||||||||||||||||||||||||
| 353 | |||||||||||||||||||||||||||||||||||||||||||
| 354 | 16 | my $want = 1; | |||||||||||||||||||||||||||||||||||||||||
| 355 | 16 | for (@{$self->{body}}) { | |||||||||||||||||||||||||||||||||||||||||
| 356 | 110245 | ▶ | if (m/^\cAE\s+(\d+)$/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 357 | 22970 | my $e = $1; | |||||||||||||||||||||||||||||||||||||||||
| 358 | # print STDERR $v->(), " END $e (@{$lvl[-1]})\n"; | ||||||||||||||||||||||||||||||||||||||||||
| 359 | # SCCS has a seriously ill design so that chunks can overlap | ||||||||||||||||||||||||||||||||||||||||||
| 360 | # Below example is from actual code | ||||||||||||||||||||||||||||||||||||||||||
| 361 | # D 9 | ||||||||||||||||||||||||||||||||||||||||||
| 362 | # E 9 | ||||||||||||||||||||||||||||||||||||||||||
| 363 | # I 9 | ||||||||||||||||||||||||||||||||||||||||||
| 364 | # D 10 | ||||||||||||||||||||||||||||||||||||||||||
| 365 | # E 10 | ||||||||||||||||||||||||||||||||||||||||||
| 366 | # I 10 | ||||||||||||||||||||||||||||||||||||||||||
| 367 | # D 53 | ||||||||||||||||||||||||||||||||||||||||||
| 368 | # E 53 | ||||||||||||||||||||||||||||||||||||||||||
| 369 | # I 53 | ||||||||||||||||||||||||||||||||||||||||||
| 370 | # E 53 | ||||||||||||||||||||||||||||||||||||||||||
| 371 | # I 23 | ||||||||||||||||||||||||||||||||||||||||||
| 372 | # D 31 | ||||||||||||||||||||||||||||||||||||||||||
| 373 | # E 31 | ||||||||||||||||||||||||||||||||||||||||||
| 374 | # I 31 | ||||||||||||||||||||||||||||||||||||||||||
| 375 | # D 45 | ||||||||||||||||||||||||||||||||||||||||||
| 376 | # E 45 | ||||||||||||||||||||||||||||||||||||||||||
| 377 | # I 45 | ||||||||||||||||||||||||||||||||||||||||||
| 378 | # E 45 | ||||||||||||||||||||||||||||||||||||||||||
| 379 | # D 53 ---+ | ||||||||||||||||||||||||||||||||||||||||||
| 380 | # E 31 | | ||||||||||||||||||||||||||||||||||||||||||
| 381 | # E 23 | | ||||||||||||||||||||||||||||||||||||||||||
| 382 | # E 10 | | ||||||||||||||||||||||||||||||||||||||||||
| 383 | # E 9 | | ||||||||||||||||||||||||||||||||||||||||||
| 384 | # D 7 | | ||||||||||||||||||||||||||||||||||||||||||
| 385 | # E 7 | | ||||||||||||||||||||||||||||||||||||||||||
| 386 | # I 7 | | ||||||||||||||||||||||||||||||||||||||||||
| 387 | # E 53 <--+ | ||||||||||||||||||||||||||||||||||||||||||
| 388 | # I 53 | ||||||||||||||||||||||||||||||||||||||||||
| 389 | # E 53 | ||||||||||||||||||||||||||||||||||||||||||
| 390 | # D 53 | ||||||||||||||||||||||||||||||||||||||||||
| 391 | # E 53 | ||||||||||||||||||||||||||||||||||||||||||
| 392 | # I 53 | ||||||||||||||||||||||||||||||||||||||||||
| 393 | # E 53 | ||||||||||||||||||||||||||||||||||||||||||
| 394 | # E 7 | ||||||||||||||||||||||||||||||||||||||||||
| 395 | 22970 | foreach my $x (reverse 0 .. $#lvl) { | |||||||||||||||||||||||||||||||||||||||||
| 396 | 23369 | ▶ | $lvl[$x][2] == $e or next; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 397 | 22970 | splice @lvl, $x, 1; | |||||||||||||||||||||||||||||||||||||||||
| 398 | 22970 | last; | |||||||||||||||||||||||||||||||||||||||||
| 399 | } | ||||||||||||||||||||||||||||||||||||||||||
| 400 | 22970 | ▶ | $want = (grep { $_->[0] == 0 } @lvl) ? 0 : 1; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 401 | 22970 | next; | |||||||||||||||||||||||||||||||||||||||||
| 402 | } | ||||||||||||||||||||||||||||||||||||||||||
| 403 | 87275 | ▶ | if (m/^\cAI\s+(\d+)$/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 404 | 12442 | ▶ | push @lvl, [ $rseq{$1} ? 1 : 0, "I", $1 ]; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 405 | 12442 | ▶ | $want = (grep { $_->[0] == 0 } @lvl) ? 0 : 1; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 406 | 12442 | next; | |||||||||||||||||||||||||||||||||||||||||
| 407 | } | ||||||||||||||||||||||||||||||||||||||||||
| 408 | 74833 | ▶ | if (m/^\cAD\s+(\d+)$/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 409 | 10528 | ▶ | push @lvl, [ $rseq{$1} ? 0 : 1, "D", $1 ]; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 410 | 10528 | ▶ | $want = (grep { $_->[0] == 0 } @lvl) ? 0 : 1; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 411 | 10528 | next; | |||||||||||||||||||||||||||||||||||||||||
| 412 | } | ||||||||||||||||||||||||||||||||||||||||||
| 413 | 64305 | ▶ | if (m/^\cA(.*)/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 414 | 0 | carp "Unsupported SCCS control: ^A$1, line skipped"; | |||||||||||||||||||||||||||||||||||||||||
| 415 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||
| 416 | } | ||||||||||||||||||||||||||||||||||||||||||
| 417 | 64305 | ▶ | $want and push @body, $self->_tran ($_); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 418 | # printf STDERR "%2d.%04d/%s: %-29.29s |%s\n", $r, scalar @body, $want, $v->(), $_; | ||||||||||||||||||||||||||||||||||||||||||
| 419 | } | ||||||||||||||||||||||||||||||||||||||||||
| 420 | |||||||||||||||||||||||||||||||||||||||||||
| 421 | 16 | ▶ | if ($self->{flags}{e} && @body && $body[0] =~ m/^[\x20-\x60]{1,61}$/) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%4/6
$self->{"flags"}{"e"} and @body and $body[0] =~ /^[\x20-\x60]{1,61}$/
$self->{"flags"}{"e"} and @body
MC/DC33%1/3
$self->{"flags"}{"e"} and @body and $body[0] =~ /^[\x20-\x60]{1,61}$/
$self->{"flags"}{"e"}
@body
$body[0] =~ /^[\x20-\x60]{1,61}$/
Truth table50%2/4
A and B and C
A= $self->{"flags"}{"e"}B= @bodyC= $body[0] =~ /^[\x20-\x60]{1,61}$/
| |||||||||||||||||||||||||||||||||||||||||||
| 422 | 1 | my $body = unpack "u" => join "\n" => @body; | |||||||||||||||||||||||||||||||||||||||||
| 423 | 1 | ▶ | $body and @body = split m/\n/ => $body; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 424 | } | ||||||||||||||||||||||||||||||||||||||||||
| 425 | |||||||||||||||||||||||||||||||||||||||||||
| 426 | 16 | ▶ | return wantarray ? @body : join "\n", @body, ""; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 427 | } # body | ||||||||||||||||||||||||||||||||||||||||||
| 428 | |||||||||||||||||||||||||||||||||||||||||||
| 429 | 4 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 430 | |||||||||||||||||||||||||||||||||||||||||||
| 431 | __END__ | ||||||||||||||||||||||||||||||||||||||||||