line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::bif::update::hub; |
2
|
1
|
|
|
1
|
|
5892
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
4
|
1
|
|
|
1
|
|
5
|
use Bif::Mo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.1.5_6'; |
7
|
|
|
|
|
|
|
extends 'App::bif'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub run { |
10
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
11
|
1
|
|
|
|
|
5
|
my $opts = $self->opts; |
12
|
1
|
|
|
|
|
6
|
my $dbw = $self->dbw; |
13
|
0
|
0
|
|
|
|
|
my $info = $self->get_hub( $opts->{id} ? $opts->{id} : $opts->{name} ); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
$dbw->txn( |
16
|
|
|
|
|
|
|
sub { |
17
|
|
|
|
|
|
|
$self->start_work( |
18
|
|
|
|
|
|
|
node_id => $info->{id}, |
19
|
0
|
|
|
0
|
|
|
start => time, |
20
|
|
|
|
|
|
|
start_comment => "update hub", |
21
|
|
|
|
|
|
|
billable => 1, |
22
|
|
|
|
|
|
|
save => 1, |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
0
|
0
|
|
|
|
|
if ( $opts->{reply} ) { |
26
|
|
|
|
|
|
|
my $uinfo = |
27
|
0
|
|
|
|
|
|
$self->get_change( $opts->{reply}, $info->{first_change_id} ); |
28
|
0
|
|
|
|
|
|
$opts->{parent_uid} = $uinfo->{id}; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
else { |
31
|
0
|
|
|
|
|
|
$opts->{parent_uid} = $info->{first_change_id}; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
0
|
|
|
|
$opts->{message} ||= $self->prompt_edit( opts => $self ); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
$opts->{change_id} = |
37
|
0
|
|
|
|
|
|
$self->new_change( parent_id => $opts->{parent_uid} ); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
$dbw->xdo( |
40
|
|
|
|
|
|
|
insert_into => 'func_update_hub', |
41
|
|
|
|
|
|
|
values => { |
42
|
|
|
|
|
|
|
change_id => $opts->{change_id}, |
43
|
|
|
|
|
|
|
id => $info->{id}, |
44
|
|
|
|
|
|
|
name => $opts->{name}, |
45
|
|
|
|
|
|
|
title => $opts->{title}, |
46
|
|
|
|
|
|
|
}, |
47
|
0
|
|
|
|
|
|
); |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
|
$self->stop_work( |
50
|
|
|
|
|
|
|
stop => time, |
51
|
|
|
|
|
|
|
restore => 1, |
52
|
|
|
|
|
|
|
); |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
$self->record_work( |
55
|
|
|
|
|
|
|
node_id => $info->{id}, |
56
|
|
|
|
|
|
|
change_id => $opts->{change_id} |
57
|
0
|
|
|
|
|
|
); |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
$self->end_change( |
60
|
|
|
|
|
|
|
id => $opts->{change_id}, |
61
|
|
|
|
|
|
|
action_format => "update hub $info->{path} (%s)", |
62
|
|
|
|
|
|
|
action_node_id_1 => $info->{id}, |
63
|
|
|
|
|
|
|
message => $opts->{message}, |
64
|
0
|
|
|
|
|
|
); |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
} |
67
|
0
|
|
|
|
|
|
); |
68
|
|
|
|
|
|
|
|
69
|
0
|
|
|
|
|
|
return $self->ok('ChangeHub'); |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
1; |
73
|
|
|
|
|
|
|
__END__ |