| Cvs documentation | Contained in the Cvs distribution. |
Cvs::Result::StatusItem - Result class for cvs status command
This class handle the cvs status result for one file.
Returns a boolean value regarding on the file existence.
Returns the item's filename.
Returns the item's basedir.
Returns the item's status.
Returns the revision of the item you are working on.
Returns the revision of the item in the remote repository?
Returns the sticky tag if any, undef otherwise.
Returns the sticky date if any, undef otherwise.
Returns the sticky options if any, undef otherwise.
$status->tag_type($tag);
Returns the type of supplied tag. (revision or branch)
$status->tag_type($tag);
Returns the revision of item binded with supplied tag.
Returns true if item is locally modified.
Returns true if item is up to date.
Returns true if item is locally and remotelly modified.This mean that a merge will be tried on the next update.
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
Copyright (C) 2003 - Olivier Poitrey
| Cvs documentation | Contained in the Cvs distribution. |
package Cvs::Result::StatusItem; use strict; use base qw(Cvs::Result::Base);
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]; }
sub tags { my($self) = @_; return map $_->[0], reverse @{$self->{tags}||[]}; }
sub tag_type { my($self, $tag) = @_; foreach(@{$self->{tags}}) { if($_->[0] eq $tag) { $_->[1] =~ /^\((\w+)/; return $1; } } }
sub tag_revision { my($self, $tag) = @_; foreach(@{$self->{tags}}) { if($_->[0] eq $tag) { $_->[1] =~ /^\(\w+: (.*?)\)/; return $1; } } }
sub is_modified { my($self) = @_; return defined $self->status && $self->status =~ /Locally Modified|Needs Merge/; }
sub is_up2date { my($self) = @_; return defined $self->status && $self->status =~ /Up-to-date|Locally Modified/; }
sub is_merge_needed { my($self) = @_; return defined $self->status && $self->status eq 'Needs Merge'; } 1;