ADD: method to delete an issue from the issue list
This commit is contained in:
parent
221512e419
commit
5a3e0dcfcc
@ -285,16 +285,43 @@ sub list
|
|||||||
return @issues;
|
return @issues;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
=method delete
|
||||||
|
|
||||||
|
delete an issue from the issue list
|
||||||
|
|
||||||
|
=cut
|
||||||
sub delete
|
sub delete
|
||||||
{
|
{
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $id = shift;
|
my $id = shift;
|
||||||
|
my @statusse = ("open","closed","assigned","inprogress");
|
||||||
|
|
||||||
die("IssueManager not initialized") unless $self->ready();
|
die("IssueManager not initialized") unless $self->ready();
|
||||||
my $ref = $self->repository->getReference('refs/heads/issues');
|
my $ref = $self->repository->getReference('refs/heads/issues');
|
||||||
|
my $tag = $ref->find(".tag")->content();
|
||||||
my $root = $ref->getTree();
|
my $root = $ref->getTree();
|
||||||
|
|
||||||
|
|
||||||
|
for my $s (@statusse)
|
||||||
|
{
|
||||||
|
for my $status ($root->find("open"))
|
||||||
|
{
|
||||||
|
for my $i ($status->get())
|
||||||
|
{
|
||||||
|
if (ref($i) eq "Git::LowLevel::Tree")
|
||||||
|
{
|
||||||
|
my $mytag = $tag . "-" . substr($i->hash(),0,8);
|
||||||
|
if ($id eq $mytag)
|
||||||
|
{
|
||||||
|
$status->del($i);
|
||||||
|
$ref->commit("removed issue " . $i->mypath);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
die("issue " . $id . " not found\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
Loading…
Reference in New Issue
Block a user