blib/lib/VCS/LibCVS/Branch.pm

filter: Statementstmt 55.5% 10 / 18 Branchbran n/a Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 50.0% 3 / 6 Podpod 100% 3 / 3 totaltotal 50.0% 16 / 32 CC 2 SCAR 10.0
CC
2
Cov
48%
equals
6.0
new
2.0
get_name
2.0
CRAP 2.7
« blib/lib/VCS/LibCVS/Client/Connection/Local.pm ↑ Summary blib/lib/VCS/LibCVS/Datum/LogMessage.pm »
1 #
2 # Copyright (c) 2004,2005 Alexander Taler (dissent@0--0.org)
3 #
4 # All rights reserved. This program is free software; you can redistribute it
5 # and/or modify it under the same terms as Perl itself.
6 #
7  
8 package VCS::LibCVS::Branch;
9  
10 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 =head1 NAME
14  
15 VCS::LibCVS::Branch - A named branch in the repository.
16  
17 =head1 SYNOPSIS
18  
19 =head1 DESCRIPTION
20  
21 Represents a named branch in the repository.
22  
23 This branch may exist on any number of files. This class is not much more than
24 a wrapper around a branch name.
25  
26 The main branch (usually branch number 1) is named using the special name
27 .TRUNK.
28  
29 =cut
30  
31 ###############################################################################
32 # Class constants
33 ###############################################################################
34  
35 1 ▶use constant REVISION => '$Header: /cvsroot/libcvs-perl/libcvs-perl/VCS/LibCVS/Branch.pm,v 1.4 2005/10/10 12:52:11 dissent Exp $ ';
Subroutine BEGIN: called CC=1 SCAR=0.0
36  
37 ###############################################################################
38 # Class variables
39 ###############################################################################
40  
41 ###############################################################################
42 # Private variables
43 ###############################################################################
44  
45 # $self->{Repository} The VCS::LibCVS::Repository in which the branch lives.
46 #
47 # $self->{Name} scalar string which is the name of the branch.
48  
49 ###############################################################################
50 # Class routines
51 ###############################################################################
52  
53 =head1 CLASS ROUTINES
54  
55 =head2 B<new()>
56  
57 $branch = VCS::LibCVS::Branch->new($repo, $name)
58  
59 =over 4
60  
61 =item return type: VCS::LibCVS::Branch
62  
63 =item argument 1 type: VCS::LibCVS::Repository
64  
65 =item argument 2 type: scalar string
66  
67 =back
68  
69 =cut
70  
71 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
72 0 my $class = shift;
73 0 my $that = bless {}, $class;
74  
75 0 ($that->{Repository}, $that->{Name}) = @_;
76  
77 0 return $that;
78 }
79  
80 ###############################################################################
81 # Instance routines
82 ###############################################################################
83  
84 =head1 INSTANCE ROUTINES
85  
86 =head2 B<get_name()>
87  
88 $b_name = $branch->get_name()
89  
90 =over 4
91  
92 =item return type: scalar string
93  
94 =back
95  
96 =cut
97  
98 0 ▶sub get_name() {
Subroutine get_name: not called CC=1 SCAR=6.9
Pod documented
99 0 return shift->{Name};
100 }
101  
102 =head2 B<equals()>
103  
104 if ($branch->equals($other_branch)) { . . .
105  
106 =over 4
107  
108 =item return type: scalar boolean
109  
110 =back
111  
112 =cut
113  
114 0 ▶sub equals() {
Subroutine equals: not called CC=2 SCAR=17.9
Pod documented
115 0 my $self = shift;
116 0 my $other = shift;
117 return (($self->{Repository}->equals($other->{Repository}))
118 0 ▶ && ($self->{Name} eq $other->{Name}));
Condition0%0/3
$self->{'Repository'}->equals($other->{'Repository'}) && $self->{'Name'} eq $other->{'Name'}
!ll&&!rl&&r
000
MC/DC0%0/2
$self->{'Repository'}->equals($other->{'Repository'}) && $self->{'Name'} eq $other->{'Name'}
$self->{'Repository'}->equals($other->{'Repository'}) $self->{'Name'} eq $other->{'Name'}
Truth table0%0/3
A && B
A= $self->{'Repository'}->equals($other->{'Repository'})B= $self->{'Name'} eq $other->{'Name'}
ABresult
0X0
100
111
119 }
120  
121 ###############################################################################
122 # Private routines
123 ###############################################################################
124  
125  
126 =head1 SEE ALSO
127  
128 VCS::LibCVS
129  
130 =cut
131  
132 1 1;
« blib/lib/VCS/LibCVS/Client/Connection/Local.pm ↑ Summary blib/lib/VCS/LibCVS/Datum/LogMessage.pm »