diff options
author | Francois Marier <francois@debian.org> | 2010-08-05 20:52:16 -0400 |
---|---|---|
committer | Francois Marier <francois@debian.org> | 2010-08-05 20:52:16 -0400 |
commit | 9fcb3bc29dfd429f521c4e40452197dc364310c3 (patch) | |
tree | d343c4aeb67a1cc4b00dfebf873937aa9cccf12a /lib/CIL/Issue.pm | |
parent | 1515145646c5aa80eb4c298607ea33da731ab586 (diff) |
Imported Upstream version 0.07.00upstream/0.07.00
Diffstat (limited to 'lib/CIL/Issue.pm')
-rw-r--r-- | lib/CIL/Issue.pm | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/lib/CIL/Issue.pm b/lib/CIL/Issue.pm index eff317f..c1360d0 100644 --- a/lib/CIL/Issue.pm +++ b/lib/CIL/Issue.pm @@ -82,6 +82,10 @@ sub prefix { return 'i'; } +sub type { + return 'Issue'; +} + sub fields { return \@FIELDS; } @@ -131,8 +135,22 @@ sub add_label { croak 'provide a label when adding one' unless defined $label; + # return if we already have this label + return if grep { $_ eq $label } @{$self->{data}{Label}}; + push @{$self->{data}{Label}}, $label; - $self->flag_as_updated(); + $self->set_updated_now(); +} + +sub remove_label { + my ($self, $label) = @_; + + croak 'provide a label when removing one' + unless defined $label; + + # remove this label + @{$self->{data}{Label}} = grep { $_ ne $label } @{$self->{data}{Label}}; + $self->set_updated_now(); } sub add_comment { @@ -165,8 +183,11 @@ sub add_depends_on { croak 'provide an issue name when adding a depends' unless defined $depends; + # return if we already have this depends + return if grep { $_ eq $depends } @{$self->{data}{DependsOn}}; + push @{$self->{data}{DependsOn}}, $depends; - $self->flag_as_updated(); + $self->set_updated_now(); } sub add_precedes { @@ -175,8 +196,11 @@ sub add_precedes { croak 'provide an issue name when adding a precedes' unless defined $precedes; + # return if we already have this precedes + return if grep { $_ eq $precedes } @{$self->{data}{Precedes}}; + push @{$self->{data}{Precedes}}, $precedes; - $self->flag_as_updated(); + $self->set_updated_now(); } sub LabelList { |