/usr/share/perl5/Cvs/Result/StatusItem.pm is in libcvs-perl 0.07-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | package Cvs::Result::StatusItem;
use strict;
use base qw(Cvs::Result::Base);
=pod
=head1 NAME
Cvs::Result::StatusItem - Result class for cvs status command
=head1 DESCRIPTION
This class handle the cvs status result for one file.
=head1 FIELDS
=head2 exists
Returns a boolean value regarding on the file existence.
=head2 filename
Returns the item's filename.
=head2 basedir
Returns the item's basedir.
=head2 status
Returns the item's status.
=head2 working_revision
Returns the revision of the item you are working on.
=head2 repository_revision
Returns the revision of the item in the remote repository?
=head2 sticky_tag
Returns the sticky tag if any, undef otherwise.
=head2 sticky_date
Returns the sticky date if any, undef otherwise.
=head2 sticky_options
Returns the sticky options if any, undef otherwise.
=cut
Cvs::Result::StatusItem->mk_accessors
(qw(
exists
filename
basedir
status
working_revision
repository_revision
sticky_tag
sticky_date
sticky_options
));
sub push_tag
{
my($self, $tag, $type) = @_;
push @{$self->{tags}}, [$tag, $type];
}
=pod
=head2 tags
Returns the list of tags on item.
=cut
sub tags
{
my($self) = @_;
return map $_->[0], reverse @{$self->{tags}||[]};
}
=pod
=head2 tag_type
$status->tag_type($tag);
Returns the type of supplied tag. (revision or branch)
=cut
sub tag_type
{
my($self, $tag) = @_;
foreach(@{$self->{tags}})
{
if($_->[0] eq $tag)
{
$_->[1] =~ /^\((\w+)/;
return $1;
}
}
}
=pod
=head2 tag_revision
$status->tag_type($tag);
Returns the revision of item binded with supplied tag.
=cut
sub tag_revision
{
my($self, $tag) = @_;
foreach(@{$self->{tags}})
{
if($_->[0] eq $tag)
{
$_->[1] =~ /^\(\w+: (.*?)\)/;
return $1;
}
}
}
=pod
=head1 METHODS
=head2 is_modified
Returns true if item is locally modified.
=cut
sub is_modified
{
my($self) = @_;
return defined $self->status &&
$self->status =~ /Locally Modified|Needs Merge/;
}
=pod
=head2 is_up2date
Returns true if item is up to date.
=cut
sub is_up2date
{
my($self) = @_;
return defined $self->status &&
$self->status =~ /Up-to-date|Locally Modified/;
}
=pod
=head2 is_merge_needed
Returns true if item is locally and remotelly modified.This mean that
a merge will be tried on the next update.
=cut
sub is_merge_needed
{
my($self) = @_;
return defined $self->status &&
$self->status eq 'Needs Merge';
}
1;
=pod
=head1 LICENCE
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
=head1 COPYRIGHT
Copyright (C) 2003 - Olivier Poitrey
|