Subversion Repositories DevTools

Rev

Rev 391 | Rev 1328 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 391 Rev 1270
Line 77... Line 77...
77
# Inputs          : $self               - Instance data
77
# Inputs          : $self               - Instance data
78
#                   $RepoPath           - Within the repository
78
#                   $RepoPath           - Within the repository
79
#                   $Path               - Local path
79
#                   $Path               - Local path
80
#                   Options             - Options
80
#                   Options             - Options
81
#                           --Export    - Export Only
81
#                           --Export    - Export Only
-
 
82
#                           --NoPrint   - Don't print files exported
82
#
83
#
83
# Returns         : Nothing
84
# Returns         : Nothing
84
#
85
#
85
sub SvnCo
86
sub SvnCo
86
{
87
{
87
    my ($self, $RepoPath, $path, @opts) = @_;
88
    my ($self, $RepoPath, $path, @opts) = @_;
88
    my $export = grep (/^--Export/, @opts );
89
    my $export = grep (/^--Export/, @opts );
-
 
90
    $self->{PRINTDATA} = ! grep (/^--NoPrint/, @opts );
89
    Debug ("SvnCo", $RepoPath, $path);
91
    Debug ("SvnCo", $RepoPath, $path);
90
 
92
 
91
    #
93
    #
92
    #   Ensure that the output path does not exist
94
    #   Ensure that the output path does not exist
93
    #   Do not allow the user to create a local work space
95
    #   Do not allow the user to create a local work space
Line 101... Line 103...
101
    #
103
    #
102
    my @args = $export ? 'export' : 'checkout';
104
    my @args = $export ? 'export' : 'checkout';
103
    push @args, qw( --ignore-externals );
105
    push @args, qw( --ignore-externals );
104
    push @args, $RepoPath, $path;
106
    push @args, $RepoPath, $path;
105
 
107
 
-
 
108
 
106
    my @co_list;
109
    my @co_list;
107
    if ( $self->SvnCmd ( @args,
110
    if ( $self->SvnCmd ( @args,
108
                            {
111
                            {
109
                                'process' => \&ProcessCo,
112
                                'process' => \&ProcessCo,
110
                                'data' => \@co_list,
113
                                'data' => \@co_list,
Line 123... Line 126...
123
        Verbose2 ("Remove WorkSpace: $path");
126
        Verbose2 ("Remove WorkSpace: $path");
124
        rmtree( $path, IsVerbose(3) );
127
        rmtree( $path, IsVerbose(3) );
125
        rmtree( $path, IsVerbose(3) );
128
        rmtree( $path, IsVerbose(3) );
126
        Error ("Checking out Workspace", @{$self->{ERROR_LIST}}, @co_list );
129
        Error ("Checking out Workspace", @{$self->{ERROR_LIST}}, @co_list );
127
    }
130
    }
-
 
131
    $self->{PRINTDATA} = 0;
128
    return;
132
    return;
129
 
133
 
130
    #
134
    #
131
    #   Internal routine to scan each the checkout
135
    #   Internal routine to scan each the checkout
132
    #
136
    #
Line 141... Line 145...
141
    #
145
    #
142
    #
146
    #
143
    sub ProcessCo
147
    sub ProcessCo
144
    {
148
    {
145
        my $self = shift;
149
        my $self = shift;
-
 
150
        my $data = shift;
-
 
151
 
-
 
152
        if ( $self->{PRINTDATA} )
-
 
153
        {
-
 
154
            #
-
 
155
            #   Pretty display for user
-
 
156
            #
-
 
157
            Information1 ("Extracting: $data");
-
 
158
        }
-
 
159
 
146
        if (  m~((/)(tags|branches|trunk)(/|$))~ )
160
        if (  $data =~ m~((/)(tags|branches|trunk)(/|$))~ )
147
        {
161
        {
148
            my $bad_dir = $1;
162
            my $bad_dir = $1;
149
            push @{$self->{ERROR_LIST}}, "Checkout does not describe the root of a package. Contains: $bad_dir";
163
            push @{$self->{ERROR_LIST}}, "Checkout does not describe the root of a package. Contains: $bad_dir";
150
            return 1;
164
            return 1;
151
        }
165
        }
Line 1411... Line 1425...
1411
            $url = $1;
1425
            $url = $1;
1412
            $pkgroot = $4;
1426
            $pkgroot = $4;
1413
        }
1427
        }
1414
        elsif ($SVN_URLS{''} )
1428
        elsif ($SVN_URLS{''} )
1415
        {
1429
        {
-
 
1430
            if ( exists $ENV{'GBE_ABT'} && $ENV{'GBE_ABT'})
-
 
1431
            {
-
 
1432
                Error ("Attempt to use default repository within automated build", "Path: " . $rpath);
-
 
1433
            }
1416
            $url = $SVN_URLS{''};
1434
            $url = $SVN_URLS{''};
1417
            $pkgroot = $rpath;
1435
            $pkgroot = $rpath;
1418
        }
1436
        }
1419
        else
1437
        else
1420
        {
1438
        {