line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Gnats::Command::UNLK; |
2
|
40
|
|
|
40
|
|
209
|
use parent 'Net::Gnats::Command'; |
|
40
|
|
|
|
|
59
|
|
|
40
|
|
|
|
|
198
|
|
3
|
40
|
|
|
40
|
|
2206
|
use strictures; |
|
40
|
|
|
|
|
78
|
|
|
40
|
|
|
|
|
197
|
|
4
|
|
|
|
|
|
|
BEGIN { |
5
|
40
|
|
|
40
|
|
3361
|
$Net::Gnats::Command::UNLK::VERSION = '0.21'; |
6
|
|
|
|
|
|
|
} |
7
|
40
|
|
|
40
|
|
219
|
use vars qw($VERSION); |
|
40
|
|
|
|
|
62
|
|
|
40
|
|
|
|
|
1691
|
|
8
|
|
|
|
|
|
|
|
9
|
40
|
|
|
40
|
|
229
|
use Net::Gnats::Constants qw(CODE_OK CODE_PR_NOT_LOCKED); |
|
40
|
|
|
|
|
55
|
|
|
40
|
|
|
|
|
8655
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 NAME |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Net::Gnats::Command::UNLK |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 DESCRIPTION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Unlocks PR. Any user may unlock a PR, as no checking is done to |
19
|
|
|
|
|
|
|
determine if the requesting session owns the lock. |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 PROTOCOL |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
UNLK |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 RESPONSES |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
The possible responses are: |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
440 (CODE_CMD_ERROR) |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Insufficient or too many arguments were specified to the command. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
210 (CODE_OK) |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
The PR was successfully unlocked. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
433 (CODE_PR_NOT_LOCKED) |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
The PR was not locked. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
6xx (internal error) |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
The PR could not be unlocked, usually because of permission or other |
45
|
|
|
|
|
|
|
filesystem-related problems. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
my $c = 'UNLK'; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub new { |
52
|
4
|
|
|
4
|
1
|
10
|
my ( $class, %options ) = @_; |
53
|
4
|
|
|
|
|
14
|
my $self = bless \%options, $class; |
54
|
4
|
|
|
|
|
13
|
return $self; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub as_string { |
58
|
11
|
|
|
11
|
1
|
13
|
my $self = shift; |
59
|
11
|
100
|
|
|
|
47
|
return undef if not defined $self->{pr_number}; |
60
|
10
|
|
|
|
|
39
|
return $c . ' ' . $self->{pr_number}; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub is_ok { |
64
|
6
|
|
|
6
|
0
|
12
|
my $self = shift; |
65
|
6
|
100
|
|
|
|
21
|
return 0 if not defined $self->response; |
66
|
5
|
100
|
|
|
|
18
|
return 1 if $self->response->code == CODE_OK; |
67
|
2
|
|
|
|
|
11
|
return 0; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
1; |