| 1 | package ShipIt::VC::SVK; | ||||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 2 | ▶ | use base 'ShipIt::VC::SVN'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 2 | ▶ | use File::Temp (); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | |||||||||||||
| 6 | 0 | ▶ | sub command { 'svk' } | ||||||||||
|
Subroutine
command: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 7 | |||||||||||||
| 8 | 0 | ▶ | sub find_url { | ||||||||||
|
Subroutine
find_url: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 9 | 0 | my $self = shift; | |||||||||||
| 10 | 0 | my $info = `svk info`; | |||||||||||
| 11 | 0 | ($info =~ /^Depot Path: (.+)/m)[0]; | |||||||||||
| 12 | } | ||||||||||||
| 13 | |||||||||||||
| 14 | 2 | ▶ | sub _tag_url_of_version { | ||||||||||
|
Subroutine
_tag_url_of_version: called CC=4 SCAR=14.0
| |||||||||||||
| 15 | 2 | my ($self, $ver) = @_; | |||||||||||
| 16 | 2 | ▶ | my $url = $self->{tagpattern} || ''; | ||||||||||
|
Condition50%1/2
$self->{'tagpattern'} || ''
MC/DC0%0/1
$self->{'tagpattern'} || ''
$self->{'tagpattern'}
Truth table50%1/2
A
A= $self->{'tagpattern'}
| |||||||||||||
| 17 | 2 | ▶ | unless ($url =~ m!^/!) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 18 | 1 | $url = $self->_tag_base . $url; | |||||||||||
| 19 | } | ||||||||||||
| 20 | 2 | ▶ | $url .= "%v" unless $url =~ /\%v/i; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 21 | 2 | $url =~ s/\%v/$ver/ig; | |||||||||||
| 22 | 2 | $url =~ s!/+$!!; | |||||||||||
| 23 | 2 | return $url; | |||||||||||
| 24 | } | ||||||||||||
| 25 | |||||||||||||
| 26 | =head1 NAME | ||||||||||||
| 27 | |||||||||||||
| 28 | ShipIt::VC::SVK -- ShipIt's SVK support | ||||||||||||
| 29 | |||||||||||||
| 30 | =head1 CONFIGURATION | ||||||||||||
| 31 | |||||||||||||
| 32 | In your .shipit configuration file, the following options are recognized: | ||||||||||||
| 33 | |||||||||||||
| 34 | =over | ||||||||||||
| 35 | |||||||||||||
| 36 | =item B<svk.tagpattern> | ||||||||||||
| 37 | |||||||||||||
| 38 | A pattern which ultimately expands into the absolute subversion URL for a tagged version. If the pattern isn't already absolute, the conventional "tags" directory is used as a base. The pattern has one magic variable, %v, which expands to the version number being tagged. If no %v is found, it's placed at the end. | ||||||||||||
| 39 | |||||||||||||
| 40 | Example legit values: | ||||||||||||
| 41 | |||||||||||||
| 42 | =over 8 | ||||||||||||
| 43 | |||||||||||||
| 44 | =item //example/tags/MyProject-%v | ||||||||||||
| 45 | |||||||||||||
| 46 | =item MyProject-%v | ||||||||||||
| 47 | |||||||||||||
| 48 | Both the above are equivalent. | ||||||||||||
| 49 | |||||||||||||
| 50 | =item (nothing) | ||||||||||||
| 51 | |||||||||||||
| 52 | Will automatically add %v to the end (of nothing), then auto-find your | ||||||||||||
| 53 | 'tags' URL, resulting in a final URL of: | ||||||||||||
| 54 | |||||||||||||
| 55 | //example/tags/%v | ||||||||||||
| 56 | |||||||||||||
| 57 | If your svk depot hosts more than one project, this default URL could | ||||||||||||
| 58 | be bad, as the tagged directory has no project name in it. | ||||||||||||
| 59 | |||||||||||||
| 60 | =back | ||||||||||||
| 61 | |||||||||||||
| 62 | =back | ||||||||||||
| 63 | |||||||||||||
| 64 | =cut | ||||||||||||
| 65 | |||||||||||||
| 66 | 2 | 1; | |||||||||||
| 67 | |||||||||||||
| 68 | |||||||||||||