Subversion Repositories DevTools

Rev

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

Rev 2652 Rev 2757
Line 50... Line 50...
50
my $opt_help = 0;
50
my $opt_help = 0;
51
my $opt_manual = 0;
51
my $opt_manual = 0;
52
my $opt_verbose = 0;
52
my $opt_verbose = 0;
53
my $opt_repo_base = 'AUPERASVN01/';
53
my $opt_repo_base = 'AUPERASVN01/';
54
my $opt_repo = '';
54
my $opt_repo = '';
-
 
55
my $opt_repoSubdir = '';
55
my $opt_flat;
56
my $opt_flat;
56
my $opt_test;
57
my $opt_test;
57
my $opt_reuse;
58
my $opt_reuse = 0;
58
my $opt_age;
59
my $opt_age;
59
my $opt_dump = 0;
60
my $opt_dump = 0;
60
my $opt_images = 0;
61
my $opt_images = 0;
61
my $opt_retaincount = 2;
62
my $opt_retaincount = 2;
62
my $opt_pruneModeString;
63
my $opt_pruneModeString;
Line 70... Line 71...
70
my $opt_preserveProjectBase;
71
my $opt_preserveProjectBase;
71
my $opt_ignoreProjectBaseErrors;
72
my $opt_ignoreProjectBaseErrors;
72
my $opt_ignoreMakeProjectErrors;
73
my $opt_ignoreMakeProjectErrors;
73
my $opt_forceProjectBase;
74
my $opt_forceProjectBase;
74
my @opt_limitProjectBase;
75
my @opt_limitProjectBase;
-
 
76
my @opt_mergePaths;
75
my $opt_ignoreBadPaths;
77
my $opt_ignoreBadPaths;
76
my $opt_delete;
78
my $opt_delete;
77
my $opt_recentAge = 14;             # Days
79
my $opt_recentAge = 14;             # Days
78
my $opt_relabel = 0;
80
my $opt_relabel = 0;
79
my $opt_protected;
81
my $opt_protected;
80
my $opt_useSvn = 1;
82
my $opt_useSvn = 1;
81
my $opt_testRmDatabase;
83
my $opt_testRmDatabase;
82
my $opt_extractFromSvn;
84
my $opt_extractFromSvn;
83
my $opt_AllowMuliplePaths = 1;      #29-Nov-2012
85
my $opt_AllowMuliplePaths = 1;      #29-Nov-2012
84
my $opt_resume;
86
my $opt_resume;
-
 
87
my $opt_processRipples = 1;
-
 
88
my $opt_mergePackages;
85
 
89
 
86
################################################################################
90
################################################################################
87
#   List of Projects Suffixes and Branch Names to be used within SVN
91
#   List of Projects Suffixes and Branch Names to be used within SVN
88
#
92
#
89
#       Name        - Name of branch for the project
93
#       Name        - Name of branch for the project
Line 248... Line 252...
248
    'daf_br_th'                     => 'IgnoreBadPath,all,IgnoreMakeProject', # MakeProject Tested. Bad Paths not used
252
    'daf_br_th'                     => 'IgnoreBadPath,all,IgnoreMakeProject', # MakeProject Tested. Bad Paths not used
249
    'linux_kernel_bcp4600'          => 'ForceProjectBase=/LMOS/linux/kernel',
253
    'linux_kernel_bcp4600'          => 'ForceProjectBase=/LMOS/linux/kernel',
250
    'linux_kernel_viper'            => 'ForceProjectBase=/LMOS/linux/kernel',
254
    'linux_kernel_viper'            => 'ForceProjectBase=/LMOS/linux/kernel',
251
    'linux_kernel_cobra'            => 'ForceProjectBase=/LMOS/linux/kernel',
255
    'linux_kernel_cobra'            => 'ForceProjectBase=/LMOS/linux/kernel',
252
 
256
 
-
 
257
    'LinuxDrivers'                  => 'flatTime,LimitProjectBase=/LMOS/linux/drivers'.
-
 
258
                                       ',mergePaths=modules:bcp4600:cobra:eb5600:etx86:tp5600:viper',
-
 
259
 
-
 
260
    'flashCopier'                   => 'flatTime,LimitProjectBase=/LMOS/tools/flashCopier'.
-
 
261
                                       ',mergePaths=+:src:pcp5700:eb5600:tp5600',
-
 
262
 
-
 
263
    'u-boot'                        => 'flatTime,LimitProjectBase=/LMOS/linux/bootstrap/u-boot'.
-
 
264
                                       ',mergePaths=+:src:u-boot:u-boot-hk',
-
 
265
 
-
 
266
    'dams5000'                      => 'flatTime,LimitProjectBase=/LMOS/apps/dams'.
-
 
267
                                       ',mergePaths=+:tp5600:eb5600:pcp5700:core:doc'.
-
 
268
                                       ',processRipples',
-
 
269
 
-
 
270
    'linux_day0fs_5000'            => 'flatTime,LimitProjectBase=/LMOS/linux/filesystems/day0-fs'.
-
 
271
                                       ',mergePaths=+:tp5600:eb5600:pcp5700:etx86:common'.
-
 
272
                                       ',processRipples',
-
 
273
 
-
 
274
    'linux_kernel_gen1'               => 'flatTime,mergePaths=,processRipples,LimitProjectBase=/LMOS/linux/kernel',
-
 
275
    'rt3070'                          => 'flatVersion',
-
 
276
 
253
 
277
 
254
    'icl'                   => 'IgnoreProjectBase,',
278
    'icl'                   => 'IgnoreProjectBase,',
255
    'itso'                  => 'IgnoreProjectBase,',
279
    'itso'                  => 'IgnoreProjectBase,',
256
#    'daf_osa_mos'           => 'IgnoreProjectBase,',
280
#    'daf_osa_mos'           => 'IgnoreProjectBase,',
257
    'daf_utils_mos'         => 'IgnoreProjectBase,',
281
    'daf_utils_mos'         => 'IgnoreProjectBase,',
Line 260... Line 284...
260
#    'mos_fonts'             => 'IgnoreProjectBase,',
284
#    'mos_fonts'             => 'IgnoreProjectBase,',
261
#    'sntp'                  => 'IgnoreProjectBase,',
285
#    'sntp'                  => 'IgnoreProjectBase,',
262
#    'time_it'               => 'IgnoreProjectBase,',
286
#    'time_it'               => 'IgnoreProjectBase,',
263
);
287
);
264
 
288
 
-
 
289
 
-
 
290
my %mergePathExtended = (
-
 
291
 
-
 
292
    'linux_kernel_gen1' => {
-
 
293
            'linux_kernel_eb5600_2.6.21.1.0.cots' => '+:TP5600:EB5600:ETX86:common:packager.sflash:www.kernel.org:packager.grub',
-
 
294
            'linux_kernel_tp5600_2.6.21.1.0.cots' => '+:tp5600:eb5600:etx86:bcp4600:common:packager.sflash:www.kernel.org:packager.grub',
-
 
295
            },
-
 
296
 
-
 
297
);
-
 
298
 
-
 
299
 
265
my %notCots = (
300
my %notCots = (
266
    'isl'       => 1,
301
    'isl'       => 1,
267
);
302
);
268
 
303
 
269
my $ukHopsMode = 0;
304
my $ukHopsMode = 0;
Line 315... Line 350...
315
my $globalError;
350
my $globalError;
316
my @unknownProjects;
351
my @unknownProjects;
317
my %knownProjects;
352
my %knownProjects;
318
my $badSingletonCount = 0;
353
my $badSingletonCount = 0;
319
my @flatOrder;
354
my @flatOrder;
-
 
355
my $flatMode = 0;
320
my $pruneMode;
356
my $pruneMode;
321
my $pruneModeString;
357
my $pruneModeString;
322
my $threadId = 0;
358
my $threadId = 0;
323
my $threadCount;
359
my $threadCount;
324
my %tipVersions;
360
my %tipVersions;
Line 348... Line 384...
348
 
384
 
349
our $GBE_RM_URL;
385
our $GBE_RM_URL;
350
my $UNIX = $ENV{'GBE_UNIX'};
386
my $UNIX = $ENV{'GBE_UNIX'};
351
 
387
 
352
my $result = GetOptions (
388
my $result = GetOptions (
353
                "help+"             => \$opt_help,          # flag, multiple use allowed
389
                'help+'             => \$opt_help,          # flag, multiple use allowed
354
                "manual:3"          => \$opt_help,
390
                'manual:3'          => \$opt_help,
355
                "verbose:+"         => \$opt_verbose,       # Versose
391
                'verbose:+'         => \$opt_verbose,       # Versose
356
                "repository:s"      => \$opt_repo,          # Name of repository
392
                'repository:s'      => \$opt_repo,          # Name of repository
357
                'rbase:s'           => \$opt_repo_base,     # Base of the repo
393
                'rbase:s'           => \$opt_repo_base,     # Base of the repo
358
                "flat!"             => \$opt_flat,          # Flat structure
394
                'flat!'             => \$opt_flat,          # Flat structure
359
                "test!"             => \$opt_test,          # Test operations
395
                'test!'             => \$opt_test,          # Test operations
360
                "reuse!"            => \$opt_reuse,         # Reuse ClearCase views
396
                'reuse:1'           => \$opt_reuse,         # Reuse ClearCase views 0:None, 1=Retain, 2=Use+Delete
361
                "age:i"             => \$opt_age,           # Only recent versions
397
                'age:i'             => \$opt_age,           # Only recent versions
362
                "dump:1"            => \$opt_dump,          # Dump Data
398
                'dump:1'            => \$opt_dump,          # Dump Data
363
                "images:1"          => \$opt_images,        # Create DOT images
399
                'images:1'          => \$opt_images,        # Create DOT images
364
                "retain:i"          => \$opt_retaincount,   # Retain N packages
400
                'retain:i'          => \$opt_retaincount,   # Retain N packages
365
                "pruneMode:s"       => \$opt_pruneModeString,
401
                'pruneMode:s'       => \$opt_pruneModeString,
366
                "listtags:i"        => \$opt_listTags,
402
                'listtags:i'        => \$opt_listTags,
367
                "name:s"            => \$opt_name,          # Alternate output
403
                'name:s'            => \$opt_name,          # Alternate output
368
                "tip:s"             => \@opt_tip,           # Force tip version(s)
404
                'tip:s'             => \@opt_tip,           # Force tip version(s)
369
                "log!"              => \$opt_log,
405
                'log!'              => \$opt_log,
370
                "delete!"           => \$opt_delete,
406
                'delete!'           => \$opt_delete,
371
                "postimage!"        => \$opt_postimage,
407
                'postimage!'        => \$opt_postimage,
372
                'workdir:s'         => \$opt_workDir,
408
                'workdir:s'         => \$opt_workDir,
373
                'relabel!'          => \$opt_relabel,
409
                'relabel!'          => \$opt_relabel,
374
                'svn!'              => \$opt_useSvn,
410
                'svn!'              => \$opt_useSvn,
375
                'testRmDatabase'    => \$opt_testRmDatabase,
411
                'testRmDatabase'    => \$opt_testRmDatabase,
376
                'fromSvn!'          => \$opt_extractFromSvn,
412
                'fromSvn!'          => \$opt_extractFromSvn,
377
                'resume'            => \$opt_resume,
413
                'resume'            => \$opt_resume,
-
 
414
                'mergePackages:s'   => \$opt_mergePackages,
-
 
415
                'subdir:s'          => \$opt_repoSubdir,    # Subdir within repo
-
 
416
                
378
                );
417
                );
379
 
418
 
380
#
419
#
381
#   Process help and manual options
420
#   Process help and manual options
382
#
421
#
Line 414... Line 453...
414
#   Init the pruning mode
453
#   Init the pruning mode
415
#
454
#
416
setPruneMode( $opt_pruneModeString || 'ripple');
455
setPruneMode( $opt_pruneModeString || 'ripple');
417
 
456
 
418
#
457
#
-
 
458
#   Detect Merge Package Request
-
 
459
#   These use pre-configured bits
-
 
460
#
-
 
461
if ( $opt_mergePackages )
-
 
462
{
-
 
463
    if ( $opt_mergePackages eq 'LinuxDrivers' )
-
 
464
    {
-
 
465
        $opt_name = $opt_mergePackages;
-
 
466
        @ARGV = qw (linux_drivers_eb5600
-
 
467
                    linux_drivers_viper
-
 
468
                    linux_drivers_cobra
-
 
469
                    linux_drivers_etx86
-
 
470
                    linux_drivers_tp5600);
-
 
471
#                    linux_drivers_bcp4600
-
 
472
                    
-
 
473
 
-
 
474
    } elsif ( $opt_mergePackages eq 'flashCopier' ) {
-
 
475
        $opt_name = $opt_mergePackages;
-
 
476
        @ARGV = qw (
-
 
477
                flash_copier_eb5600
-
 
478
                flash_copier_pcp5700
-
 
479
                flash_copier_tp5600
-
 
480
                );
-
 
481
 
-
 
482
    } elsif ( $opt_mergePackages eq 'u-boot' ) {
-
 
483
        $opt_name = $opt_mergePackages;
-
 
484
        @ARGV = qw (
-
 
485
                u-boot
-
 
486
                u-boot-hk
-
 
487
                );
-
 
488
 
-
 
489
    } elsif ( $opt_mergePackages eq 'dams5000' ) {
-
 
490
        $opt_name = $opt_mergePackages;
-
 
491
        @ARGV = qw (
-
 
492
                    dams_eb5600
-
 
493
                    dams_pcp5700
-
 
494
                    dams_tp5600
-
 
495
                );
-
 
496
 
-
 
497
    } elsif ( $opt_mergePackages eq 'linux_day0fs_5000' ) {
-
 
498
        $opt_name = $opt_mergePackages;
-
 
499
        @ARGV = qw (
-
 
500
                    linux_day0fs_eb5600
-
 
501
                    linux_day0fs_tp5600
-
 
502
                    linux_day0fs_etx86
-
 
503
                );
-
 
504
 
-
 
505
    } elsif ( $opt_mergePackages eq 'linux_kernel_gen1' ) {
-
 
506
        $opt_name = $opt_mergePackages;
-
 
507
        @ARGV = qw (
-
 
508
                    linux_kernel_etx86
-
 
509
                    linux_kernel_tp5600
-
 
510
                    linux_kernel_eb5600
-
 
511
                    linux_kernel_bcp4600
-
 
512
                );
-
 
513
 
-
 
514
    } else
-
 
515
    {
-
 
516
        Error ("Unknown Merge Package Name: $opt_mergePackages");
-
 
517
    }
-
 
518
}
419
#   Get data for all packages
519
#   Get data for all packages
420
#
520
#
421
foreach my $packageName ( @ARGV )
521
foreach my $packageName ( @ARGV )
422
{
522
{
423
    next unless ( $packageName );
523
    next unless ( $packageName );
Line 483... Line 583...
483
 
583
 
484
if ( $opt_flat )
584
if ( $opt_flat )
485
{
585
{
486
#    @flatOrder = sort {$versions{$a}{version} cmp $versions{$b}{version}} keys(%versions);
586
#    @flatOrder = sort {$versions{$a}{version} cmp $versions{$b}{version}} keys(%versions);
487
#    @flatOrder = sort {$versions{$a}{created} cmp $versions{$b}{created}} keys(%versions);
587
#    @flatOrder = sort {$versions{$a}{created} cmp $versions{$b}{created}} keys(%versions);
-
 
588
 
-
 
589
    if ( $flatMode == 1 ) {
-
 
590
        Message ("Flat import. Sorted by TimeStamp");
-
 
591
        @flatOrder = sort {$versions{$a}{TimeStamp} cmp $versions{$b}{TimeStamp}} keys(%versions);
-
 
592
    } elsif ( $flatMode == 2 ) {
-
 
593
        Message ("Flat import. Sorted by Version");
-
 
594
 
-
 
595
        # Only iff all the bits are numeric
-
 
596
        sub sortCotsVersion
-
 
597
        {
-
 
598
            my @va = split '\.', $versions{$a}{vname};
-
 
599
            my @vb = split '\.', $versions{$b}{vname};
-
 
600
 
-
 
601
            my $rv = scalar @va <=> scalar @vb;
-
 
602
            return $rv if ( $rv );
-
 
603
 
-
 
604
            foreach my $ii ( 0 .. scalar @va )
-
 
605
            {
-
 
606
                $rv = $va[$ii] <=> $vb[$ii];
-
 
607
                return $rv if ( $rv );
-
 
608
            }
-
 
609
            return $rv;
-
 
610
        }
-
 
611
 
-
 
612
        @flatOrder = sort sortCotsVersion keys(%versions);
-
 
613
#        @flatOrder = sort {$versions{$a}{vname} cmp $versions{$b}{vname}} keys(%versions);
-
 
614
    } else {
488
    @flatOrder = sort {$a <=> $b} keys(%versions);
615
        @flatOrder = sort {$a <=> $b} keys(%versions);
-
 
616
    }
489
    my $tip = $flatOrder[-1];
617
    my $tip = $flatOrder[-1];
490
    $versions{$tip}{Tip} = 1 if $tip;
618
    $versions{$tip}{Tip} = 1 if $tip;
491
}
619
}
492
 
620
 
493
#
621
#
Line 546... Line 674...
546
    #   Going to do serious work
674
    #   Going to do serious work
547
    #   Need to ensure we have more arguments
675
    #   Need to ensure we have more arguments
548
    #
676
    #
549
    if ( $opt_protected )
677
    if ( $opt_protected )
550
    {
678
    {
551
        Warning("Protected Package not transferred: $packageNames[0] - $opt_protected",
679
        Warning("Protected Package not transferred: $packageNames - $opt_protected",
552
                "See cc2svn_protected.txt for details");
680
                "See cc2svn_protected.txt for details");
553
        exit 0;
681
        exit 0;
554
    }
682
    }
555
 
683
 
556
    if ( $noTransfer )
684
    if ( $noTransfer )
557
    {
685
    {
558
        Warning("Protected Package not transferred: $packageNames[0]",
686
        Warning("Protected Package not transferred: $packageNames",
559
                "Configured within this program");
687
                "Configured within this program");
560
        exit 0;
688
        exit 0;
561
    }
689
    }
562
 
690
 
563
    #
691
    #
Line 713... Line 841...
713
        $opt_flat = 1;
841
        $opt_flat = 1;
714
        setPruneMode('none') unless (defined $opt_pruneModeString);
842
        setPruneMode('none') unless (defined $opt_pruneModeString);
715
    }
843
    }
716
 
844
 
717
 
845
 
718
    if ( $packageNames[0] =~ m'^br_applet_' )
846
    if ( $packageNames =~ m'^br_applet_' )
719
    {
847
    {
720
      $opt_flat = 1 unless defined $opt_flat;
848
      $opt_flat = 1 unless defined $opt_flat;
721
    }
849
    }
722
 
850
 
723
    if ( exists $specialPackages{$packageNames[0]} )
851
    if ( exists $specialPackages{$packageNames} )
724
    {
852
    {
725
        my $data = ',' . $specialPackages{$packageNames[0]} . ',';
853
        my $data = ',' . $specialPackages{$packageNames} . ',';
726
 
854
 
727
        if ( index( $data, ',all' ) >= 0) {
855
        if ( index( $data, ',all' ) >= 0) {
728
            setPruneMode('none') unless (defined $opt_pruneModeString);
856
            setPruneMode('none') unless (defined $opt_pruneModeString);
729
        }
857
        }
730
        
858
        
731
        if ( index( $data, 'protected,' ) >= 0) {
859
        if ( index( $data, ',protected,' ) >= 0) {
732
            $noTransfer = 1;
860
            $noTransfer = 1;
733
        }
861
        }
734
 
862
 
735
        if ( index( $data, 'flat,' ) >= 0) {
863
        if ( index( $data, ',flat,' ) >= 0) {
-
 
864
            $opt_flat = 1;
-
 
865
        }
-
 
866
 
-
 
867
        if ( index( $data, ',flatTime,' ) >= 0) {
-
 
868
            Message ("Flatten import tree. Sort by Time");
736
            $opt_flat = 1;
869
            $opt_flat = 1;
-
 
870
            $flatMode = 1;          # By Time
-
 
871
            $opt_processRipples = 0;
-
 
872
        }
-
 
873
 
-
 
874
        if ( index( $data, ',flatVersion,' ) >= 0) {
-
 
875
            Message ("Flatten import tree. Sort by Version");
-
 
876
            $opt_flat = 1;
-
 
877
            $flatMode = 2;          # By Version
-
 
878
            $opt_processRipples = 0;
-
 
879
        }
-
 
880
        
-
 
881
 
-
 
882
        if ( index( $data, ',processRipples,' ) >= 0) {
-
 
883
            $opt_processRipples = 1;
737
        }
884
        }
738
 
885
 
739
        if ( index( $data, 'SetProjectBase,' ) >= 0) {
886
        if ( index( $data, ',SetProjectBase,' ) >= 0) {
740
            $opt_preserveProjectBase = 1;
887
            $opt_preserveProjectBase = 1;
741
            $opt_ignoreProjectBaseErrors = 1;
888
            $opt_ignoreProjectBaseErrors = 1;
742
            Message ("Preserving ProjectBase");
889
            Message ("Preserving ProjectBase");
743
        }
890
        }
744
 
891
 
745
        if ( index( $data, 'AllowMultiPath,' ) >= 0) {
892
        if ( index( $data, ',AllowMultiPath,' ) >= 0) {
746
            $opt_AllowMuliplePaths = 1;
893
            $opt_AllowMuliplePaths = 1;
747
            Message ("Allowing Multiple Paths");
894
            Message ("Allowing Multiple Paths");
748
        }
895
        }
749
 
896
 
750
        if ( $data =~ m~,ForceProjectBase=(.*?),~ ) {
897
        if ( $data =~ m~,ForceProjectBase=(.*?),~ ) {
751
            $opt_forceProjectBase = $1;
898
            $opt_forceProjectBase = $1;
752
            $opt_AllowMuliplePaths = 1;
899
            $opt_AllowMuliplePaths = 1;
753
            Message ("Force Project Base: $opt_forceProjectBase");
900
            Message ("Force Project Base: $opt_forceProjectBase");
754
        }
901
        }
755
 
902
 
756
        if ( $data =~ m~,LimitProjectBase=(.*),~ ) {
903
        if ( $data =~ m~,LimitProjectBase=(.*?),~ ) {
757
            $opt_AllowMuliplePaths = 1;
904
            $opt_AllowMuliplePaths = 1;
758
            @opt_limitProjectBase = split(':', $1);
905
            @opt_limitProjectBase = split(':', $1);
759
            Message ("Limit Project Base: @opt_limitProjectBase");
906
            Message ("Limit Project Base: @opt_limitProjectBase");
760
        }
907
        }
761
        
-
 
762
 
908
 
-
 
909
        if ( $data =~ m~,mergePaths=(.*?),~ ) {
-
 
910
            @opt_mergePaths = split(':', $1);
-
 
911
            Message ("Merge Paths: @opt_mergePaths");
-
 
912
        }
-
 
913
 
763
        if ( index( $data, 'IgnoreProjectBase,' ) >= 0) {
914
        if ( index( $data, ',IgnoreProjectBase,' ) >= 0) {
764
            $opt_ignoreProjectBaseErrors = 1;
915
            $opt_ignoreProjectBaseErrors = 1;
765
            Message ("Ignore ProjectBase Errors");
916
            Message ("Ignore ProjectBase Errors");
766
        }
917
        }
767
 
918
 
768
        if ( index( $data, 'IgnoreMakeProject,' ) >= 0) {
919
        if ( index( $data, ',IgnoreMakeProject,' ) >= 0) {
769
            $opt_ignoreMakeProjectErrors = 1;
920
            $opt_ignoreMakeProjectErrors = 1;
770
            Message ("Ignore MakeProject Usage");
921
            Message ("Ignore MakeProject Usage");
771
        }
922
        }
772
 
923
 
773
        if ( index( $data, 'IgnoreBadPath,' ) >= 0) {
924
        if ( index( $data, ',IgnoreBadPath,' ) >= 0) {
774
            $opt_ignoreBadPaths = 1;
925
            $opt_ignoreBadPaths = 1;
775
            Message ("Ignore Bad Paths in makefile Usage");
926
            Message ("Ignore Bad Paths in makefile Usage");
776
        }
927
        }
777
        
928
        
778
        if ( index( $data, 'utf8,' ) >= 0) {
929
        if ( index( $data, ',utf8,' ) >= 0) {
779
            $mustConvertFileNames = 1;
930
            $mustConvertFileNames = 1;
780
            Message ("Convert filenames to UTF8");
931
            Message ("Convert filenames to UTF8");
781
        }
932
        }
782
    }
933
    }
783
 
934
 
Line 1652... Line 1803...
1652
        {
1803
        {
1653
            newProject();
1804
            newProject();
1654
            $createBranch = 1;
1805
            $createBranch = 1;
1655
            $createSuffix = 1 if $versions{$entry}{newSuffix};
1806
            $createSuffix = 1 if $versions{$entry}{newSuffix};
1656
        }
1807
        }
1657
 
-
 
1658
        newPackageVersion( $entry );
1808
        newPackageVersion( $entry );
-
 
1809
 
1659
no warnings "recursion";
1810
no warnings "recursion";
1660
        processBranch (@{$versions{$entry}{next}});
1811
        processBranch (@{$versions{$entry}{next}});
1661
    }
1812
    }
1662
}
1813
}
1663
 
1814
 
Line 1773... Line 1924...
1773
    #   Delete the created view
1924
    #   Delete the created view
1774
    #   Its just a directory, so delete it
1925
    #   Its just a directory, so delete it
1775
    #
1926
    #
1776
    if ( $data{ViewRoot} && -d $data{ViewRoot})
1927
    if ( $data{ViewRoot} && -d $data{ViewRoot})
1777
    {
1928
    {
1778
        if ( !$opt_reuse || ($rv && ($rv != 4 && $rv != 12 && $rv != 5 )) )
1929
        if ( $opt_reuse == 0 || $opt_reuse == 2 || ($rv && ($rv != 4 && $rv != 12 && $rv != 5 )) )
1779
        {
1930
        {
1780
            Message ("Delete View: $data{ViewRoot}");
1931
            Message ("Delete View: $data{ViewRoot}");
1781
            RmDirTree ($data{ViewRoot} );
1932
            RmDirTree ($data{ViewRoot} );
1782
        }
1933
        }
1783
        else
1934
        else
Line 1789... Line 1940...
1789
    else
1940
    else
1790
    {
1941
    {
1791
        Message ("No view to delete");
1942
        Message ("No view to delete");
1792
    }
1943
    }
1793
 
1944
 
1794
 
-
 
1795
    #
1945
    #
1796
    #   If this version has any 'ripples' then process them while we have the
-
 
1797
    #   main view. Note the ripple list may contain entries that do not
-
 
1798
    #   exist - they will have been pruned.
1946
    #   Create pretty pictures
1799
    #
1947
    #
1800
if(1) {
1948
    unless ( $rv )
1801
    foreach my $rentry ( @{$versions{$entry}{rippleList}} )
-
 
1802
    {
1949
    {
1803
        next unless( exists $versions{$rentry} );
1950
        getSvnData();
-
 
1951
        createImages();
-
 
1952
    }
1804
 
1953
 
-
 
1954
 
-
 
1955
    if($opt_processRipples)
-
 
1956
    {
-
 
1957
        #
-
 
1958
        #   If this version has any 'ripples' then process them while we have the
-
 
1959
        #   main view. Note the ripple list may contain entries that do not
-
 
1960
        #   exist - they will have been pruned.
-
 
1961
        #
1805
        if ($versions{$rentry}{Processed})
1962
        foreach my $rentry ( @{$versions{$entry}{rippleList}} )
1806
        {
1963
        {
-
 
1964
            next unless( exists $versions{$rentry} );
-
 
1965
 
-
 
1966
            if ($versions{$rentry}{Processed})
-
 
1967
            {
1807
            Warning ("Ripple Processed before main entry");
1968
                Warning ("Ripple Processed before main entry");
1808
            $versions{$rentry}{rippleProcessed} = 1;
1969
                $versions{$rentry}{rippleProcessed} = 1;
1809
        }
1970
            }
1810
 
1971
 
1811
        Message ("Proccessing associated Ripple: " . GetVname($rentry));
1972
            Message ("Proccessing associated Ripple: " . GetVname($rentry));
1812
        newPackageVersion($rentry);
1973
            newPackageVersion($rentry);
-
 
1974
        }
1813
    }
1975
    }
1814
}
1976
 
1815
}
1977
}
1816
 
1978
 
1817
#-------------------------------------------------------------------------------
1979
#-------------------------------------------------------------------------------
1818
# Function        : newPackageVersionBody
1980
# Function        : newPackageVersionBody
1819
#
1981
#
Line 2229... Line 2391...
2229
    }
2391
    }
2230
 
2392
 
2231
    push @args, "-branch=$currentBranchName" if ( defined $currentBranchName );
2393
    push @args, "-branch=$currentBranchName" if ( defined $currentBranchName );
2232
    my $datafile = "importdata.$import_label.properties";
2394
    my $datafile = "importdata.$import_label.properties";
2233
 
2395
 
-
 
2396
    my @mergeArg;
-
 
2397
    push (@mergeArg, "-mergePaths", join(',', @opt_mergePaths) ) if ( @opt_mergePaths );
-
 
2398
 
-
 
2399
    if ( exists $mergePathExtended{$packageNames}  )
-
 
2400
    {
-
 
2401
        my $eentry = $mergePathExtended{$packageNames};
-
 
2402
        if ( exists $eentry->{$import_label} )
-
 
2403
        {
-
 
2404
            @opt_mergePaths = split(':', $eentry->{$import_label});
-
 
2405
            Message("New MergePath Info: @opt_mergePaths");
-
 
2406
 
-
 
2407
            #
-
 
2408
            #   Args take effect next version
-
 
2409
            #   In this version have no merging - reset the image
-
 
2410
            #
-
 
2411
            @mergeArg = ();
-
 
2412
        }
-
 
2413
    }
-
 
2414
 
2234
    $rv = JatsToolPrint ( 'jats_svn', 'import', '-reuse' ,
2415
    $rv = JatsToolPrint ( 'jats_svn', 'import', '-reuse' ,
2235
                    "-package=$svnRepo/$packageNames",
2416
                    "-package=$svnRepo/$packageNames",
2236
                    "-dir=$data->{ViewPath}",
2417
                    "-dir=$data->{ViewPath}",
2237
                    "-label=$import_label",
2418
                    "-label=$import_label",
2238
                    "-datafile=$datafile",
2419
                    "-datafile=$datafile",
2239
                    @args,
2420
                    @args,
-
 
2421
                    @mergeArg,
2240
                     );
2422
                     );
2241
 
2423
 
2242
    if ( $rv )
2424
    if ( $rv )
2243
    {
2425
    {
2244
        $data->{errStr} = 'Failed to import to SVN';
2426
        $data->{errStr} = 'Failed to import to SVN';
Line 2709... Line 2891...
2709
{
2891
{
2710
    my ($data, $cc_path, $cc_label) = @_;
2892
    my ($data, $cc_path, $cc_label) = @_;
2711
    my $tryCount = 0;
2893
    my $tryCount = 0;
2712
    my $rv = 99;
2894
    my $rv = 99;
2713
 
2895
 
2714
    $data->{ViewRoot} = $opt_name ? $opt_name : "$cc_label";
2896
    $data->{ViewRoot} = ( defined $opt_name && ! defined $opt_mergePackages )? $opt_name : "$cc_label";
2715
    $data->{ViewPath} =  $data->{ViewRoot} . $cc_path;
2897
    $data->{ViewPath} =  $data->{ViewRoot} . $cc_path;
2716
    
2898
    
2717
    if ( $opt_preserveProjectBase && !$opt_forceProjectBase )
2899
    if ( $opt_preserveProjectBase && !$opt_forceProjectBase )
2718
    {
2900
    {
2719
        my $cc_vob = $cc_path;
2901
        my $cc_vob = $cc_path;
Line 2730... Line 2912...
2730
        return 0;
2912
        return 0;
2731
    }
2913
    }
2732
 
2914
 
2733
    while ( $rv == 99 ) {
2915
    while ( $rv == 99 ) {
2734
        my @args;
2916
        my @args;
2735
        push (@args, '-view', $opt_name ) if ( defined $opt_name );
2917
        push (@args, '-view', $opt_name ) if ( defined $opt_name && ! defined $opt_mergePackages );
2736
        $rv = JatsToolPrint ( 'jats_ccrelease', '-extractfiles', '-root=.' , '-noprefix',
2918
        $rv = JatsToolPrint ( 'jats_ccrelease', '-extractfiles', '-root=.' , '-noprefix',
2737
                    "-label=$cc_label" ,
2919
                    "-label=$cc_label" ,
2738
                    "-path=$cc_path",
2920
                    "-path=$cc_path",
2739
                    @args
2921
                    @args
2740
                    );
2922
                    );
Line 3694... Line 3876...
3694
                    $versions{$pv_id}{version} = $version;
3876
                    $versions{$pv_id}{version} = $version;
3695
                    $versions{$pv_id}{buildVersion} = $buildVersion;
3877
                    $versions{$pv_id}{buildVersion} = $buildVersion;
3696
                    $versions{$pv_id}{isaWip} = 1 if ( $isaWip );
3878
                    $versions{$pv_id}{isaWip} = 1 if ( $isaWip );
3697
 
3879
 
3698
                    #
3880
                    #
3699
                    #   New methof for detecting a ripple
3881
                    #   New method for detecting a ripple
3700
                    #       Don't look at the version number
3882
                    #       Don't look at the version number
3701
                    #       Use RM data
3883
                    #       Use RM data
3702
                    #       Inlude the comment - there are some cases where the comment
3884
                    #       Inlude the comment - there are some cases where the comment
3703
                    #       appears to have been user modified.
3885
                    #       appears to have been user modified.
3704
                    #
3886
                    #
Line 4479... Line 4661...
4479
    $opt_vobMap = $ScmRepoMap{$packageNames}{repo}
4661
    $opt_vobMap = $ScmRepoMap{$packageNames}{repo}
4480
        if (exists $ScmRepoMap{$packageNames});
4662
        if (exists $ScmRepoMap{$packageNames});
4481
 
4663
 
4482
    $opt_protected = $ScmRepoMap{$packageNames}{protected}
4664
    $opt_protected = $ScmRepoMap{$packageNames}{protected}
4483
        if (exists $ScmRepoMap{$packageNames}{protected});
4665
        if (exists $ScmRepoMap{$packageNames}{protected});
4484
 
-
 
4485
    #
4666
    #
4486
    #   Free the memory
4667
    #   Free the memory
4487
    #
4668
    #
4488
    %ScmRepoMap = ();
4669
    %ScmRepoMap = ();
4489
 
4670
 
Line 4492... Line 4673...
4492
    #
4673
    #
4493
    Warning ("No VOB Mapping found")
4674
    Warning ("No VOB Mapping found")
4494
        unless ($opt_vobMap);
4675
        unless ($opt_vobMap);
4495
    Error("No repository specified. ie -repo=DevTools or -repo=COTS")
4676
    Error("No repository specified. ie -repo=DevTools or -repo=COTS")
4496
        unless ( $opt_repo || $opt_vobMap );
4677
        unless ( $opt_repo || $opt_vobMap );
4497
 
-
 
4498
    my $r1 = ($opt_repo || '') . '/' . ($opt_vobMap || '');
4678
    my $r1 = ($opt_repo || '') . '/' . ($opt_vobMap || '') . '/' . ($opt_repoSubdir || '') ;
-
 
4679
    $r1 =~ s~//~/~g;
4499
    $r1 =~ s~^/~~;
4680
    $r1 =~ s~^/~~;
4500
    $r1 =~ s~/$~~;
4681
    $r1 =~ s~/$~~;
4501
    $svnRepo = $opt_repo_base . $r1;
4682
    $svnRepo = $opt_repo_base . $r1;
4502
 
4683
 
4503
    Verbose( "Repo URL: $svnRepo");
4684
    Verbose( "Repo URL: $svnRepo");