Subversion Repositories DevTools

Rev

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

Rev 3967 Rev 4077
Line 96... Line 96...
96
my $opt_deleteLinks;
96
my $opt_deleteLinks;
97
my $count_BadPaths = 0;
97
my $count_BadPaths = 0;
98
my $opt_IgnoreBadSourcePath;
98
my $opt_IgnoreBadSourcePath;
99
my $opt_forceSuck;
99
my $opt_forceSuck;
100
my $opt_noVCS;
100
my $opt_noVCS;
-
 
101
my $opt_onlyOneBranch;
101
 
102
 
102
################################################################################
103
################################################################################
103
#   List of Projects Suffixes and Branch Names to be used within SVN
104
#   List of Projects Suffixes and Branch Names to be used within SVN
104
#
105
#
105
#       Name        - Name of branch for the project
106
#       Name        - Name of branch for the project
Line 384... Line 385...
384
    'oracs'                 => 'ForceSuck,ForceProjectBase=/MASS_Dev_Bus,IgnoreBadSourcePath,NoProcessRipples,SelectProjectBase=MASS_Dev_Bus/web/patches/oracs:MASS_Dev_Bus/web/patches:MASS_Dev_Bus/web',
385
    'oracs'                 => 'ForceSuck,ForceProjectBase=/MASS_Dev_Bus,IgnoreBadSourcePath,NoProcessRipples,SelectProjectBase=MASS_Dev_Bus/web/patches/oracs:MASS_Dev_Bus/web/patches:MASS_Dev_Bus/web',
385
    'oradacw'               => 'ForceSuck,ForceProjectBase=/MASS_Dev_Bus,IgnoreBadSourcePath,NoProcessRipples,SelectProjectBase=MASS_Dev_Bus/web/patches/oradacw:MASS_Dev_Bus/web/patches:MASS_Dev_Bus/web',
386
    'oradacw'               => 'ForceSuck,ForceProjectBase=/MASS_Dev_Bus,IgnoreBadSourcePath,NoProcessRipples,SelectProjectBase=MASS_Dev_Bus/web/patches/oradacw:MASS_Dev_Bus/web/patches:MASS_Dev_Bus/web',
386
    'orabocw'               => 'ForceSuck,ForceProjectBase=/MASS_Dev_Bus,IgnoreBadSourcePath,NoProcessRipples,SelectProjectBase=MASS_Dev_Bus/web/patches/orabocw:MASS_Dev_Bus/web/patches:MASS_Dev_Bus/web',
387
    'orabocw'               => 'ForceSuck,ForceProjectBase=/MASS_Dev_Bus,IgnoreBadSourcePath,NoProcessRipples,SelectProjectBase=MASS_Dev_Bus/web/patches/orabocw:MASS_Dev_Bus/web/patches:MASS_Dev_Bus/web',
387
 
388
 
388
 
389
 
-
 
390
    'boi-issuer'            => 'OnlyOneBranch=.vtk,noVCS',
-
 
391
 
389
    'icl'                   => 'IgnoreProjectBase,',
392
    'icl'                   => 'IgnoreProjectBase,',
390
    'itso'                  => 'IgnoreProjectBase,',
393
    'itso'                  => 'IgnoreProjectBase,',
391
#    'daf_osa_mos'           => 'IgnoreProjectBase,',
394
#    'daf_osa_mos'           => 'IgnoreProjectBase,',
392
    'daf_utils_mos'         => 'IgnoreProjectBase,',
395
    'daf_utils_mos'         => 'IgnoreProjectBase,',
393
    'itso_ud'               => 'IgnoreProjectBase,',
396
    'itso_ud'               => 'IgnoreProjectBase,',
Line 1082... Line 1085...
1082
        if ( index( $data, ',NoProcessRipples,' ) >= 0) {
1085
        if ( index( $data, ',NoProcessRipples,' ) >= 0) {
1083
            $opt_processRipples = 0;
1086
            $opt_processRipples = 0;
1084
            Message ("Disable Processing of ripples");
1087
            Message ("Disable Processing of ripples");
1085
        }
1088
        }
1086
 
1089
 
-
 
1090
        #
-
 
1091
        #   This is a real kludge. The user MUST make sure that the branch AND all related
-
 
1092
        #   branches ( xxx_for_yyy.zzz ) have been deleted from the repository.
-
 
1093
        #
-
 
1094
        if ( $data =~ m~,OnlyOneBranch=(.*?),~ ) {
-
 
1095
            $opt_onlyOneBranch = $1;
-
 
1096
            Message ("Limiting the import to one branch: $opt_onlyOneBranch");
-
 
1097
            unless (exists $Projects{$opt_onlyOneBranch})
-
 
1098
            {
-
 
1099
                Error("The specified branch does not map to a configured project");
-
 
1100
            }
-
 
1101
        }
-
 
1102
 
1087
        if ( index( $data, ',noVCS,' ) >= 0) {
1103
        if ( index( $data, ',noVCS,' ) >= 0) {
1088
            $opt_noVCS = 1;
1104
            $opt_noVCS = 1;
1089
            Message ("Use of ClearCase disabled.");
1105
            Message ("Use of ClearCase disabled.");
1090
        }
1106
        }
1091
 
1107
 
Line 2251... Line 2267...
2251
    #   If we have a global error,then we pretend to process, but we
2267
    #   If we have a global error,then we pretend to process, but we
2252
    #   report errors for the logging system
2268
    #   report errors for the logging system
2253
    #
2269
    #
2254
    if ( $globalError )
2270
    if ( $globalError )
2255
    {
2271
    {
2256
        Message ("Global error prevents futher importation");
2272
        Message ("Global error prevents futher importation. ($globalError)");
2257
    }
2273
    }
2258
    else
2274
    else
2259
    {
2275
    {
2260
        #
2276
        #
2261
        #   Call worker function
2277
        #   Call worker function
2262
        #   It will exit on any error so that it can be logged
2278
        #   It will exit on any error so that it can be logged
2263
        #
2279
        #
2264
        $rv = newPackageVersionBody( \%data, @_ );
2280
        $rv = newPackageVersionBody( \%data, @_ );
2265
        $globalError = 1 if ( $rv >= 10 );
2281
        if ( $rv >= 10 )
-
 
2282
        {
-
 
2283
            $globalError = 2; 
-
 
2284
            Message("Global errror: ", $data{errStr});
-
 
2285
        }
2266
    }
2286
    }
2267
 
2287
 
2268
    #
2288
    #
2269
    #   Highlight essential packages that failed to transfer
2289
    #   Highlight essential packages that failed to transfer
2270
    #
2290
    #
Line 2410... Line 2430...
2410
#                               3 - Deadwood
2430
#                               3 - Deadwood
2411
#                               4 - Bad usage of ProjectBase detected
2431
#                               4 - Bad usage of ProjectBase detected
2412
#                                   Use of MakeProject detected
2432
#                                   Use of MakeProject detected
2413
#                               5  - Subversion Import disabled
2433
#                               5  - Subversion Import disabled
2414
#                               6  - Restored via resume
2434
#                               6  - Restored via resume
-
 
2435
#                               7  - Not imported. not on Onle One Branch
2415
#                       >10 - Fatal error
2436
#                       >10 - Fatal error
2416
#
2437
#
2417
sub newPackageVersionBody
2438
sub newPackageVersionBody
2418
{
2439
{
2419
    my ($data, $entry) = @_;
2440
    my ($data, $entry) = @_;
Line 2467... Line 2488...
2467
            Message("SvnVersion check: $isInSvn");
2488
            Message("SvnVersion check: $isInSvn");
2468
 
2489
 
2469
            $rv = testSvnLabel( "$svnRepo/$packageNames", $import_label );
2490
            $rv = testSvnLabel( "$svnRepo/$packageNames", $import_label );
2470
            unless ( $rv )
2491
            unless ( $rv )
2471
            {
2492
            {
2472
                Message ("Skip import - resume detected presense");
2493
                Message ("Skip import - resume detected presence");
2473
                $firstVersionCreated = $entry unless ( $firstVersionCreated );
2494
                $firstVersionCreated = $entry unless ( $firstVersionCreated );
2474
                $versions{$entry}{TagCreated} = 2;
2495
                $versions{$entry}{TagCreated} = 2;
2475
                foreach  ( keys %{$restoreData{$entry}} )
2496
                foreach  ( keys %{$restoreData{$entry}} )
2476
                {
2497
                {
2477
                    $data->{$_} = $restoreData{$entry}{$_};
2498
                    $data->{$_} = $restoreData{$entry}{$_};
Line 2484... Line 2505...
2484
        else
2505
        else
2485
        {
2506
        {
2486
            Warning ("Resume data missing");
2507
            Warning ("Resume data missing");
2487
        }
2508
        }
2488
    }
2509
    }
-
 
2510
 
-
 
2511
    #
-
 
2512
    #   If we are only processing Only One Branch then skip versions that are not a part of that branch
-
 
2513
    #
-
 
2514
    if ($opt_onlyOneBranch)
-
 
2515
    {
-
 
2516
        if ($versions{$entry}{'suffix'} eq $opt_onlyOneBranch)
-
 
2517
        {
-
 
2518
            Message("Version on selected branch");
-
 
2519
        }
-
 
2520
        else
-
 
2521
        {
-
 
2522
            Message("Skip import. Version NOT on selected branch");
-
 
2523
            return 7;
-
 
2524
        }
-
 
2525
    }
2489
    
2526
    
2490
#   Keep DeadWood. May be a WIP
2527
#   Keep DeadWood. May be a WIP
2491
#    if ( exists $versions{$entry}{DeadWood} && $versions{$entry}{DeadWood} )
2528
#    if ( exists $versions{$entry}{DeadWood} && $versions{$entry}{DeadWood} )
2492
#    {
2529
#    {
2493
#        $data->{errStr} = 'Package is DeadWood';
2530
#        $data->{errStr} = 'Package is DeadWood';
Line 2901... Line 2938...
2901
        $forceImportFlush = 0;
2938
        $forceImportFlush = 0;
2902
        RmDirTree ('SvnImportDir');
2939
        RmDirTree ('SvnImportDir');
2903
    }
2940
    }
2904
 
2941
 
2905
    push @args, "-branch=$currentBranchName" if ( defined $currentBranchName );
2942
    push @args, "-branch=$currentBranchName" if ( defined $currentBranchName );
-
 
2943
    push @args, "-replace" if ( defined $opt_onlyOneBranch );
2906
    my $datafile = "importdata.$import_label.properties";
2944
    my $datafile = "importdata.$import_label.properties";
2907
 
2945
 
2908
    my @mergeArg;
2946
    my @mergeArg;
2909
    push (@mergeArg, "-mergePaths", join(',', @opt_mergePaths) ) if ( @opt_mergePaths );
2947
    push (@mergeArg, "-mergePaths", join(',', @opt_mergePaths) ) if ( @opt_mergePaths );
2910
 
2948
 
Line 3126... Line 3164...
3126
    #   Only do once
3164
    #   Only do once
3127
    #
3165
    #
3128
    return unless ( $createPackageDone );
3166
    return unless ( $createPackageDone );
3129
    return if ( $opt_resume );
3167
    return if ( $opt_resume );
3130
    $createPackageDone = 0;
3168
    $createPackageDone = 0;
-
 
3169
    if ( $opt_onlyOneBranch )
-
 
3170
    {
-
 
3171
        JatsToolPrint ( 'jats_svn', 'create', "$svnRepo/$packageNames", @opts );
-
 
3172
        return;
-
 
3173
    }
3131
 
3174
 
3132
    #
3175
    #
3133
    #   Real import
3176
    #   Real import
3134
    #       Do not Delete package if it exists
3177
    #       Do not Delete package if it exists
3135
    #       Package must NOT exist
3178
    #       Package must NOT exist
Line 3315... Line 3358...
3315
        #   tree much prettier
3358
        #   tree much prettier
3316
        #
3359
        #
3317
        my @opts;
3360
        my @opts;
3318
        push (@opts, '-date', $date) if ( $date );
3361
        push (@opts, '-date', $date) if ( $date );
3319
        push (@opts, '-author', $author) if ( $author );
3362
        push (@opts, '-author', $author) if ( $author );
-
 
3363
        push (@opts, '-replace') if ( $opt_onlyOneBranch );
3320
        
3364
        
3321
        JatsToolPrint ( 'jats_svnlabel',
3365
        JatsToolPrint ( 'jats_svnlabel',
3322
                        '-packagebase', "$svnRepo/$packageNames",
3366
                        '-packagebase', "$svnRepo/$packageNames",
3323
                        'tags/' . $src_label,
3367
                        'tags/' . $src_label,
3324
                        '-branch',
3368
                        '-branch',
Line 3645... Line 3689...
3645
    #
3689
    #
3646
    #   Only allow import from SVN if asked nicely
3690
    #   Only allow import from SVN if asked nicely
3647
    #   May be used if we are correcting a package - and some have been
3691
    #   May be used if we are correcting a package - and some have been
3648
    #   placed in SVN
3692
    #   placed in SVN
3649
    #
3693
    #
3650
    unless ( $opt_extractFromSvn )
3694
    unless ( $opt_extractFromSvn || $opt_onlyOneBranch )
3651
    {
3695
    {
3652
        $data->{errStr} = 'Some Packages are in SVN';
3696
        $data->{errStr} = 'Some Packages are in SVN';
3653
        return 15;
3697
        return 15;
3654
    }
3698
    }
3655
    
3699