Subversion Repositories DevTools

Rev

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

Rev 267 Rev 297
Line 170... Line 170...
170
# Function        : CreatePackage
170
# Function        : CreatePackage
171
#
171
#
172
# Description     : Create a Package structure within a Repository
172
# Description     : Create a Package structure within a Repository
173
#                   Optionally Import Data
173
#                   Optionally Import Data
174
#                   Optionally Tag the import
174
#                   Optionally Tag the import
175
#                   Optionall Tag the import on a branch
175
#                   Optionally Tag the import on a branch
176
#
176
#
177
# Inputs          : URL                 - Url to Repo + Package Base
177
# Inputs          : URL                 - Url to Repo + Package Base
178
#                   Options             - Command modifiers
178
#                   Options             - Command modifiers
179
#                       -import=path    - Import named directory
179
#                       -import=path    - Import named directory
180
#                       -label=name     - Label the result
180
#                       -label=name     - Label the result
-
 
181
#                       -tag=name       - Import to Tag Only
-
 
182
#                       -branch=name    - Import to Branch only
181
#                       -new            - Must be new package
183
#                       -new            - Must be new package
-
 
184
#                       -replace        - Replace existing
182
#
185
#
183
# Returns         : 
186
# Returns         : 
184
#
187
#
185
sub CreatePackage
188
sub CreatePackage
186
{
189
{
Line 282... Line 285...
282
    my $opt_package;
285
    my $opt_package;
283
    my $opt_dir;
286
    my $opt_dir;
284
    my $opt_label;
287
    my $opt_label;
285
    my $opt_replace = 0;
288
    my $opt_replace = 0;
286
    my $opt_reuse;
289
    my $opt_reuse;
287
    my $opt_workdir = "ImportDir";
290
    my $opt_workdir = "SvnImportDir";
288
 
291
 
289
    #
292
    #
290
    #   Other globals
293
    #   Other globals
291
    #
294
    #
292
    my $url_label;
295
    my $url_label;
Line 450... Line 453...
450
            }
453
            }
451
        }
454
        }
452
 
455
 
453
        #
456
        #
454
        #   Inform Subversion about the added files
457
        #   Inform Subversion about the added files
-
 
458
        #   The command line does have a finite length, so add them 200 at a
-
 
459
        #   time.
455
        #
460
        #
-
 
461
 
-
 
462
        my $base = 0;
-
 
463
        my $num = $#added;
456
        Message ("Update the workspace: Added files");
464
        Message ("Update the workspace: Added $num files");
-
 
465
 
-
 
466
        while ( $base <= $num )
-
 
467
        {
-
 
468
            my $end = $base + 200;
-
 
469
            $end = $num if ( $end > $num );
-
 
470
 
457
        $svn->SvnCmd ( 'add'
471
            $svn->SvnCmd ( 'add'
458
                        , '--depth=empty'
472
                            , '--depth=empty'
459
                        , '--parents'
473
                            , '--parents'
460
                        , map ("$opt_workdir/$_", @added),
474
                            , map ("$opt_workdir/$_", @added[$base .. $end] ),
461
                        { 'error' => 'Adding files to workspace' } );
475
                            { 'error' => 'Adding files to workspace' } );
-
 
476
 
-
 
477
            $base = $end + 1;
-
 
478
        }
462
    }
479
    }
463
 
480
 
464
    #
481
    #
465
    #   Remove files
482
    #   Remove files
466
    #   Don't really need to delete the files as the svn delete
483
    #   Don't really need to delete the files as the svn delete
Line 476... Line 493...
476
        }
493
        }
477
 
494
 
478
        #
495
        #
479
        #   Inform Subversion about the removed files
496
        #   Inform Subversion about the removed files
480
        #
497
        #
-
 
498
        my $base = 0;
-
 
499
        my $num = $#rm_files;
481
        Message ("Update the workspace: Removed Files");
500
        Message ("Update the workspace: Removed $num Files");
-
 
501
 
-
 
502
        while ( $base <= $num )
-
 
503
        {
-
 
504
            my $end = $base + 200;
-
 
505
            $end = $num if ( $end > $num );
-
 
506
 
482
        $svn->SvnCmd ( 'delete', map ("$opt_workdir/$_", @rm_files ),
507
            $svn->SvnCmd ( 'delete', map ("$opt_workdir/$_", @rm_files[$base .. $end] ),
483
                        { 'error' => 'Deleting files from workspace' } );
508
                            { 'error' => 'Deleting files from workspace' } );
-
 
509
            
-
 
510
 
-
 
511
            $base = $end + 1;
-
 
512
        }
484
    }
513
    }
485
 
514
 
486
    #
515
    #
487
    #   The common files may have changed
516
    #   The common files may have changed
488
    #   Simply copy them all in and let subversion figure it out
517
    #   Simply copy them all in and let subversion figure it out
Line 910... Line 939...
910
environment. The option allows the utility to reuse the workspace if it exists
939
environment. The option allows the utility to reuse the workspace if it exists
911
 
940
 
912
=item -workpspace=path
941
=item -workpspace=path
913
 
942
 
914
This option specifies an alternate workspace directory to create and use. The
943
This option specifies an alternate workspace directory to create and use. The
915
default directory is "ImportDir" within the users current directory.
944
default directory is "SvnImportDir" within the users current directory.
916
 
945
 
917
=back
946
=back
918
 
947
 
919
=head2 DESCRIPTION
948
=head2 DESCRIPTION
920
 
949