[Bps-public-commit] r15007 - in Shipwright/branches/2.0: lib/Shipwright/Backend
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Mon Aug 11 12:23:30 EDT 2008
Author: sunnavy
Date: Mon Aug 11 12:23:27 2008
New Revision: 15007
Modified:
Shipwright/branches/2.0/ (props changed)
Shipwright/branches/2.0/lib/Shipwright/Backend/Base.pm
Log:
r15556 at sunnavys-mb: sunnavy | 2008-08-12 00:20:37 +0800
updated import method
Modified: Shipwright/branches/2.0/lib/Shipwright/Backend/Base.pm
==============================================================================
--- Shipwright/branches/2.0/lib/Shipwright/Backend/Base.pm (original)
+++ Shipwright/branches/2.0/lib/Shipwright/Backend/Base.pm Mon Aug 11 12:23:27 2008
@@ -83,7 +83,13 @@
my %args = @_;
my $name = $args{source};
$name =~ s{.*/}{};
- $args{as} ||= 'vendor';
+
+ if ( $args{branches} ) {
+ $args{as} = '';
+ }
+ else {
+ $args{as} ||= 'vendor';
+ }
unless ( $args{_initialize} || $args{_extra_tests} ) {
if ( $args{_extra_tests} ) {
@@ -132,11 +138,20 @@
$self->version($version);
my $branches = $self->branches;
- unless ( $branches->{$name} && grep { $args{as} eq $_ }
- @{ $branches->{$name} } )
+ if ( $args{branches} ) {
+ # mostly this happens when import from another shipwright repo
+ $branches->{$name} = $args{branches};
+ $self->branches($branches);
+ }
+ elsif (
+ !(
+ $branches->{$name} && grep { $args{as} eq $_ }
+ @{ $branches->{$name} }
+ )
+ )
{
$branches->{$name} =
- [ @{$branches->{$name} || [] }, $args{as} ];
+ [ @{ $branches->{$name} || [] }, $args{as} ];
$self->branches($branches);
}
More information about the Bps-public-commit
mailing list