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