line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Trac::LinkResolver::Changeset; |
2
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
49
|
use strict; |
|
8
|
|
|
|
|
16
|
|
|
8
|
|
|
|
|
208
|
|
4
|
8
|
|
|
8
|
|
34
|
use warnings; |
|
8
|
|
|
|
|
16
|
|
|
8
|
|
|
|
|
251
|
|
5
|
8
|
|
|
8
|
|
35
|
use base qw( Text::Trac::LinkResolver ); |
|
8
|
|
|
|
|
14
|
|
|
8
|
|
|
|
|
47
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.24'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub init { |
10
|
1607
|
|
|
1607
|
0
|
2063
|
my $self = shift; |
11
|
1607
|
|
|
|
|
3098
|
$self->{pattern} = '!?\[\d+\]|(?:\b|!)r\d+\b(?!:\d)'; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub format_link { |
15
|
6
|
|
|
6
|
0
|
17
|
my ( $self, $match, $target, $label ) = @_; |
16
|
6
|
50
|
|
|
|
29
|
return $match if $self->_is_disabled; |
17
|
|
|
|
|
|
|
|
18
|
6
|
|
|
|
|
28
|
my $c = $self->{context}; |
19
|
6
|
|
66
|
|
|
24
|
$label ||= $match; |
20
|
6
|
|
|
|
|
23
|
my ($rev) = ( $match =~ m/(\d+)/ ); |
21
|
|
|
|
|
|
|
|
22
|
6
|
|
66
|
|
|
113
|
my $url = $c->{trac_changeset_url} || $c->trac_url . 'changeset/'; |
23
|
6
|
|
|
|
|
41
|
$url .= $rev; |
24
|
6
|
50
|
|
|
|
79
|
return sprintf '%s', ( $c->{class} ? q{class="changeset"} : '' ), $url, $label; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |