ADD: added close_commit support

This commit is contained in:
Dominik Meyer 2018-09-15 22:46:47 +02:00
parent 8a7ef2b33e
commit d0a8d76526
No known key found for this signature in database
GPG Key ID: B4C312B600606B64
2 changed files with 22 additions and 0 deletions

View File

@ -292,6 +292,7 @@ sub parseIssue
my $estimated = $d->find("estimated"); my $estimated = $d->find("estimated");
my $working = $d->find("working"); my $working = $d->find("working");
my $tags = $d->find("tags"); my $tags = $d->find("tags");
my $close_commit = $d->find("close_commit");
my $id = $tag . "-" . substr($subject->hash(),0,8); my $id = $tag . "-" . substr($subject->hash(),0,8);
my $cd = $d->find("creation_date"); my $cd = $d->find("creation_date");
my $ld = $d->find("last_change_date"); my $ld = $d->find("last_change_date");
@ -341,6 +342,11 @@ sub parseIssue
$issue->closed_date(DateTime->from_epoch( epoch =>$cld->content, time_zone=>$tz)); $issue->closed_date(DateTime->from_epoch( epoch =>$cld->content, time_zone=>$tz));
} }
if (defined($close_commit) && $issue->status eq "closed")
{
$issue->close_commit($close_commit->content());
}
if (defined($worker)) if (defined($worker))
{ {
$worker->content()=~/^(.*)\<(.*)\>$/; $worker->content()=~/^(.*)\<(.*)\>$/;

View File

@ -289,6 +289,14 @@ has 'working_time' => (is => 'rw', isa=>'Num', default => 0, trigger => sub {
}); });
=attr close_commit
the hash of the commit which closed this issue
=cut
has 'close_commit' => (is => 'rw', isa=>'Str', default =>"");
=method addTag =method addTag
add another tag to the issue. add another tag to the issue.
@ -529,6 +537,14 @@ sub createIssue
$issueTree->add($comment); $issueTree->add($comment);
} }
if (defined($self->close_commit) && length($self->close_commit)> 0 && $self->status eq "closed")
{
my $close_commit = $issueTree->newBlob();
$close_commit->path("close_commit");
$close_commit->_content($self->close_commit);
$issueTree->add($close_commit);
}
if (defined($self->description) && length($self->description)> 0) if (defined($self->description) && length($self->description)> 0)
{ {
my $description = $issueTree->newBlob(); my $description = $issueTree->newBlob();