Subversion Repositories DevTools

Rev

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

Rev 1270 Rev 1272
Line 121... Line 121...
121
    '.u244.syd'     => '.syd',
121
    '.u244.syd'     => '.syd',
122
    '.pxxx.sea'     => '.sea',
122
    '.pxxx.sea'     => '.sea',
123
    '.pxxx.syd'     => '.syd',
123
    '.pxxx.syd'     => '.syd',
124
    '.pxxx.sydddd'  => '.syd',
124
    '.pxxx.sydddd'  => '.syd',
125
    '.oslo'         => '.oso',
125
    '.oslo'         => '.oso',
-
 
126
    '.osl'          => '.oso',
126
);
127
);
127
 
128
 
128
my %specialPackages = (
129
my %specialPackages = (
129
    'core_devl' =>  ',all,protected,',
130
    'core_devl' =>  ',all,protected,',
130
#    'core_devl' =>  ',all,',
131
#    'core_devl' =>  ',all,',
Line 852... Line 853...
852
                $entry = $versions{$entry}{last}
853
                $entry = $versions{$entry}{last}
853
            }
854
            }
854
        }
855
        }
855
 
856
 
856
        #
857
        #
-
 
858
        #   Keep recent versions
-
 
859
        #
-
 
860
        if ( $pruneMode == 1 )
-
 
861
        {
-
 
862
            foreach my $entry ( keys(%versions) )
-
 
863
            {
-
 
864
                next if ( $versions{$entry}{Age} > 10  );
-
 
865
                 $versions{$entry}{keepRecent} = 1;
-
 
866
print "--- Recent version $versions{$entry}{vname}\n";
-
 
867
            }
-
 
868
 
-
 
869
        }
-
 
870
        
-
 
871
 
-
 
872
        #
857
        #   Keep versions that are common parents to Essential Versions
873
        #   Keep versions that are common parents to Essential Versions
858
        #       Mark paths through the tree to essential versions
874
        #       Mark paths through the tree to essential versions
859
        #       Mark nodes with the number of essential versions that they sprout
875
        #       Mark nodes with the number of essential versions that they sprout
860
        #   Don't do it if we are ripple pruning
876
        #   Don't do it if we are ripple pruning
861
        #
877
        #
Line 919... Line 935...
919
            return 0 if ( $versions{$entry}{newSuffix} && (exists $versions{$entry}{EssentialPath}) );
935
            return 0 if ( $versions{$entry}{newSuffix} && (exists $versions{$entry}{EssentialPath}) );
920
#            return 1 if ( exists $versions{$entry}{DeadWood} );
936
#            return 1 if ( exists $versions{$entry}{DeadWood} );
921
            return 0 if ( exists $versions{$entry}{EssentialSplitPoint} && $versions{$entry}{EssentialSplitPoint} > 1 );
937
            return 0 if ( exists $versions{$entry}{EssentialSplitPoint} && $versions{$entry}{EssentialSplitPoint} > 1 );
922
            return 0 if ( exists $versions{$entry}{keepLowestRipple} &&  $versions{$entry}{keepLowestRipple} );
938
            return 0 if ( exists $versions{$entry}{keepLowestRipple} &&  $versions{$entry}{keepLowestRipple} );
923
            return 0 if ( ($pruneMode == 1) && ! $versions{$entry}{isaRipple} );
939
            return 0 if ( ($pruneMode == 1) && ! $versions{$entry}{isaRipple} );
-
 
940
            return 0 if ( exists $versions{$entry}{keepRecent} && $versions{$entry}{keepRecent} );
924
            return 1;
941
            return 1;
925
        }
942
        }
926
 
943
 
927
        foreach my $entry ( keys(%versions) )
944
        foreach my $entry ( keys(%versions) )
928
        {
945
        {
Line 1210... Line 1227...
1210
 
1227
 
1211
#-------------------------------------------------------------------------------
1228
#-------------------------------------------------------------------------------
1212
# Function        : calcRippleGroups
1229
# Function        : calcRippleGroups
1213
#
1230
#
1214
# Description     : Locate and mark ripple groups
1231
# Description     : Locate and mark ripple groups
1215
#                   packages that are ripples fo each other
1232
#                   packages that are ripples of each other
1216
#                       Keep first version of each ripple. Must keep first
1233
#                       Keep first version of each ripple. Must keep first
1217
#                       Group ripples together so that they can be
1234
#                       Group ripples together so that they can be
1218
#                       proccessed at the same time
1235
#                       proccessed at the same time
1219
#
1236
#
1220
# Inputs          : 
1237
# Inputs          : 
Line 1389... Line 1406...
1389
    logToFile( $cwd . '/importsummary.txt', ";$line;");
1406
    logToFile( $cwd . '/importsummary.txt', ";$line;");
1390
 
1407
 
1391
    #
1408
    #
1392
    #   Sava data
1409
    #   Sava data
1393
    #
1410
    #
-
 
1411
    $data{errFlags} = $flags;
-
 
1412
    $data{duration} = $duration;
1394
    $versions{$entry}{rmRef} = $data{rmRef};
1413
    $versions{$entry}{rmRef} = $data{rmRef};
1395
    $versions{$entry}{errStr} = $data{errStr};
1414
    delete $data{rmRef};
-
 
1415
    delete $data{tag};
1396
    $versions{$entry}{errFlags} = $flags;
1416
    delete $data{ViewRoot};
1397
    $versions{$entry}{BadProjectBase} = $data{BadProjectBase};
1417
    $versions{$entry}{data} = \%data;
1398
    
1418
 
1399
    #
1419
    #
1400
    #   Delete the created view
1420
    #   Delete the created view
1401
    #   Its just a directory, so delete it
1421
    #   Its just a directory, so delete it
1402
    #
1422
    #
1403
    if ( $data{ViewRoot} && -d $data{ViewRoot})
1423
    if ( $data{ViewRoot} && -d $data{ViewRoot})
Line 1436... Line 1456...
1436
# Inputs          : $data               - Shared data
1456
# Inputs          : $data               - Shared data
1437
#                   $entry              - Package entry to process
1457
#                   $entry              - Package entry to process
1438
#
1458
#
1439
# Returns         : Error Code
1459
# Returns         : Error Code
1440
#                         0 - All is well
1460
#                         0 - All is well
1441
#                       <10 - Recoveralble error
1461
#                       <10 - Recoverable error
1442
#                       >10 - Fatal error
1462
#                       >10 - Fatal error
1443
#
1463
#
1444
sub newPackageVersionBody
1464
sub newPackageVersionBody
1445
{
1465
{
1446
    my ($data, $entry) = @_;
1466
    my ($data, $entry) = @_;
Line 1453... Line 1473...
1453
    #
1473
    #
1454
    $data->{rmRef} = 'ERROR';
1474
    $data->{rmRef} = 'ERROR';
1455
    $data->{tag} = '';
1475
    $data->{tag} = '';
1456
    $data->{ViewRoot} = undef;
1476
    $data->{ViewRoot} = undef;
1457
    $data->{ViewPath} = undef;
1477
    $data->{ViewPath} = undef;
1458
    $data->{flags} = undef;
-
 
1459
    $data->{errStr} = '';
1478
    $data->{errStr} = '';
1460
    $versions{$entry}{Processed} = 1;
1479
    $versions{$entry}{Processed} = 1;
1461
    
1480
    
1462
    
1481
    
1463
    SystemConfig ('ExitOnError' => 0);
1482
    SystemConfig ('ExitOnError' => 0);
Line 1555... Line 1574...
1555
            $data->{errStr} = 'Bad usage of ProjectBase detected';
1574
            $data->{errStr} = 'Bad usage of ProjectBase detected';
1556
            return 14;
1575
            return 14;
1557
        }
1576
        }
1558
    }
1577
    }
1559
 
1578
 
-
 
1579
 
-
 
1580
    #
-
 
1581
    #   Developers have been slack
-
 
1582
    #       Sometime the mark the source path as 'GMTPE2005'
-
 
1583
    #       Sometimes as 'GMTPE2005/Package/Fred/Jill/Harry'
-
 
1584
    #
-
 
1585
    #   Attempt to suck up empty directories below the specified
-
 
1586
    #   source path
-
 
1587
    #
-
 
1588
    unless ( $opt_preserveProjectBase )
-
 
1589
    {
-
 
1590
        #
-
 
1591
        #   Look in ViewPath
-
 
1592
        #   If it contains only ONE directory then we can suck it up
-
 
1593
        #
-
 
1594
        my $testDir = findDirWithStuff( $data->{ViewPath} );
-
 
1595
        unless ( $data->{ViewPath} eq $testDir  )
-
 
1596
        {
-
 
1597
            Message ("Adjust Base Dir: $testDir");
-
 
1598
            $data->{adjustedPath} = $data->{ViewPath};
-
 
1599
            $data->{ViewPath} = $testDir;
-
 
1600
        }
-
 
1601
    }
-
 
1602
    
-
 
1603
 
1560
    #
1604
    #
1561
    #   Have a CC view
1605
    #   Have a CC view
1562
    #   Now we can create the SVN package and branching point before we
1606
    #   Now we can create the SVN package and branching point before we
1563
    #   import the CC data into SVN
1607
    #   import the CC data into SVN
1564
    #
1608
    #
Line 1649... Line 1693...
1649
        $data->{rmRef} = 'SVN::' . $rmData->getProperty('subversion.tag');
1693
        $data->{rmRef} = 'SVN::' . $rmData->getProperty('subversion.tag');
1650
    }
1694
    }
1651
 
1695
 
1652
    unless ( $data->{rmRef}  )
1696
    unless ( $data->{rmRef}  )
1653
    {
1697
    {
1654
        $data->{errStr} = 'Failed to determin Rm Reference';
1698
        $data->{errStr} = 'Failed to determine Rm Reference';
1655
        return 13;
1699
        return 13;
1656
    }
1700
    }
1657
 
1701
 
1658
    Message ("RM Ref: $data->{rmRef}");
1702
    Message ("RM Ref: $data->{rmRef}");
1659
    unlink $datafile;
1703
    unlink $datafile;
Line 2119... Line 2163...
2119
        $retval = 1;
2163
        $retval = 1;
2120
    }
2164
    }
2121
    return $retval;
2165
    return $retval;
2122
}
2166
}
2123
 
2167
 
-
 
2168
#-------------------------------------------------------------------------------
-
 
2169
# Function        : findDirWithStuff
-
 
2170
#
-
 
2171
# Description     : Find a directory that contains more than just another subdir
-
 
2172
#
-
 
2173
# Inputs          : $base               - Start of the scan
-
 
2174
#
-
 
2175
# Returns         : Path to dir with more than just a single dir in it
-
 
2176
#
-
 
2177
sub findDirWithStuff
-
 
2178
{
-
 
2179
    my ($base) = @_;
-
 
2180
 
-
 
2181
    while ( $base )
-
 
2182
    {
-
 
2183
    my $fileCount = 0;
-
 
2184
    my $dirCount = 0;
-
 
2185
 
-
 
2186
    my @list = glob( $base . '/*');
-
 
2187
    foreach ( @list )
-
 
2188
    {
-
 
2189
        next if ( $_ eq '.' );
-
 
2190
        next if ( $_ eq '..' );
-
 
2191
        if ( -d $_ )
-
 
2192
        {
-
 
2193
            $dirCount++;
-
 
2194
            return $base if ( $dirCount > 1  );
-
 
2195
        }
-
 
2196
        else
-
 
2197
        {
-
 
2198
            return $base;
-
 
2199
        }
-
 
2200
    }
-
 
2201
    return $base unless ( $dirCount == 1  );
-
 
2202
    $base = $list[0];
-
 
2203
    }
-
 
2204
}
-
 
2205
 
2124
 
2206
 
2125
#-------------------------------------------------------------------------------
2207
#-------------------------------------------------------------------------------
2126
# Function        : JatsToolPrint
2208
# Function        : JatsToolPrint
2127
#
2209
#
2128
# Description     : Print and Execuate a JatsTool command
2210
# Description     : Print and Execuate a JatsTool command
Line 2154... Line 2236...
2154
}
2236
}
2155
 
2237
 
2156
sub saneLabel
2238
sub saneLabel
2157
{
2239
{
2158
    my ($entry, $pkgname) = @_;
2240
    my ($entry, $pkgname) = @_;
-
 
2241
    my $me;
2159
    my $me = $versions{$entry}{vname};
2242
    $me = $versions{$entry}{vname};
2160
    $pkgname = $versions{$entry}{name} unless ( defined $pkgname );
2243
    $pkgname = $versions{$entry}{name} unless ( defined $pkgname );
2161
 
2244
 
2162
    Error ("Package does have a version string: pvid: $entry")
2245
    Error ("Package does have a version string: pvid: $entry")
2163
        unless ( defined $me );
2246
        unless ( defined $me );
2164
 
2247
 
Line 2781... Line 2864...
2781
 
2864
 
2782
        my @attributes;
2865
        my @attributes;
2783
        push @attributes, "shape=record";
2866
        push @attributes, "shape=record";
2784
        push @attributes, "label=\"{$text}\"";
2867
        push @attributes, "label=\"{$text}\"";
2785
        push @attributes, "tooltip=\"$packageNames\"";
2868
        push @attributes, "tooltip=\"$packageNames\"";
2786
        push @attributes, "URL=\"" . $GBE_RM_URL . "/view_by_version.asp?pkg_id=$first_pkg_id" . "\"";
2869
        push (@attributes, "URL=\"" . $GBE_RM_URL . "/view_by_version.asp?pkg_id=$first_pkg_id" . "\"" )if $first_pkg_id;
2787
        push @attributes, "color=red";
2870
        push @attributes, "color=red";
2788
        my $attr = join( ' ', @attributes);
2871
        my $attr = join( ' ', @attributes);
2789
 
2872
 
2790
        my $tld_done = 'TitleBlock';
2873
        my $tld_done = 'TitleBlock';
2791
        print FH "$tld_done [$attr]\n";
2874
        print FH "$tld_done [$attr]\n";
Line 2806... Line 2889...
2806
        push @text, '|{Code';
2889
        push @text, '|{Code';
2807
        push @text, '|{N: Not Locked';
2890
        push @text, '|{N: Not Locked';
2808
        push @text, 'b: Bad Singleton';
2891
        push @text, 'b: Bad Singleton';
2809
        push @text, 'B: Bad VCS Tag';
2892
        push @text, 'B: Bad VCS Tag';
2810
        push @text, 'D: DeadWood';
2893
        push @text, 'D: DeadWood';
2811
        push @text, 'E: Essential Version';
2894
        push @text, 'E: Essential Release Version';
2812
        push @text, 'G: Glued into Version Tree';
2895
        push @text, 'G: Glued into Version Tree';
-
 
2896
        push @text, 'r: Recent version';
2813
        push @text, 'S: Splitpoint';
2897
        push @text, 'S: Splitpoint';
2814
        push @text, 't: Glued into Project Tree';
2898
        push @text, 't: Glued into Project Tree';
2815
        push @text, 'T: Tip version';
2899
        push @text, 'T: Tip version';
2816
        push @text, 'V: In SVN';
2900
        push @text, 'V: In SVN';
2817
        push @text, '+: In Subversion';
2901
        push @text, '+: In Subversion';
Line 2879... Line 2963...
2879
        $stateText .= 'B' if (exists $versions{$entry}{badVcsTag});
2963
        $stateText .= 'B' if (exists $versions{$entry}{badVcsTag});
2880
        $stateText .= 'G' if (exists $versions{$entry}{GluedIn});
2964
        $stateText .= 'G' if (exists $versions{$entry}{GluedIn});
2881
        $stateText .= 't' if (exists $versions{$entry}{MakeTree});
2965
        $stateText .= 't' if (exists $versions{$entry}{MakeTree});
2882
        $stateText .= 'E' if (exists $versions{$entry}{Essential});
2966
        $stateText .= 'E' if (exists $versions{$entry}{Essential});
2883
        $stateText .= 'D' if (exists $versions{$entry}{DeadWood});
2967
        $stateText .= 'D' if (exists $versions{$entry}{DeadWood});
-
 
2968
        $stateText .= 'r' if (exists $versions{$entry}{keepRecent} && $versions{$entry}{keepRecent} );
2884
        $stateText .= 'S' if (exists $versions{$entry}{EssentialSplitPoint} && $versions{$entry}{EssentialSplitPoint} > 1 );
2969
        $stateText .= 'S' if (exists $versions{$entry}{EssentialSplitPoint} && $versions{$entry}{EssentialSplitPoint} > 1 );
2885
        $stateText .= 'T' if (exists $versions{$entry}{Tip} );
2970
        $stateText .= 'T' if (exists $versions{$entry}{Tip} );
2886
        $stateText .= 'V' if (exists $versions{$entry}{isSvn} );
2971
        $stateText .= 'V' if (exists $versions{$entry}{isSvn} );
2887
        $stateText .= '+' if (exists $versions{$entry}{svnVersion} );
2972
        $stateText .= '+' if (exists $versions{$entry}{svnVersion} );
2888
#        $stateText .= 's' if (exists $versions{$entry}{branchPoint} );
2973
#        $stateText .= 's' if (exists $versions{$entry}{branchPoint} );