40 if($file =~ qr{([a-z]+):([a-z/.]+):(.+):([a-zA-Z0-9]+)}) { |
40 if($file =~ qr{([a-z]+):([a-z/.]+):(.+):([a-zA-Z0-9]+)}) { |
41 my ($scm, $repo, $scmpath, $rev) = ($1, $2, $3, $4); |
41 my ($scm, $repo, $scmpath, $rev) = ($1, $2, $3, $4); |
42 my $filename = File::Spec->splitpath($scmpath); |
42 my $filename = File::Spec->splitpath($scmpath); |
43 my $scmrepo = "$scm:$repo"; |
43 my $scmrepo = "$scm:$repo"; |
44 my $mt = Mojo::Template->new; |
44 my $mt = Mojo::Template->new; |
45 my $config = $self->config->{ScmLinks}; |
45 my $config = $self->config->{WebInterface}->{ScmLinks}; |
46 |
46 |
47 # and we have a browser configured for this repository |
47 # and we have a browser configured for this repository |
48 if(exists($config->{$scmrepo})) { |
48 if(exists($config->{$scmrepo})) { |
49 my $template = '% my ($repo, $scmpath, $rev, $line) = @_; ' . "\n" . $config->{$scmrepo}; |
49 my $template = '% my ($repo, $scmpath, $rev, $line) = @_; ' . "\n" . $config->{$scmrepo}; |
50 my $url = $mt->render($template, $repo, $scmpath, $rev, $line); |
50 my $url = $mt->render($template, $repo, $scmpath, $rev, $line); |