Subversion Repositories DevTools

Rev

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

Rev 2489 Rev 2652
Line 15... Line 15...
15
#                   Install packages
15
#                   Install packages
16
#                   Remove the view
16
#                   Remove the view
17
#
17
#
18
#               The script can do a lot of other things too.
18
#               The script can do a lot of other things too.
19
#
19
#
-
 
20
#               Defined exit code for automation
-
 
21
#                   10 - No files in extracted view
-
 
22
#                        Root directory not found
-
 
23
#                   11 - Label not found
-
 
24
#                   1  - Everything else
-
 
25
#
20
# Notes         : A lot of this code is common to jats_ccrelease.pl
26
# Notes         : A lot of this code is common to jats_ccrelease.pl
21
#                 Will need to refactor if both are to be used
27
#                 Will need to refactor if both are to be used
22
#
28
#
23
#......................................................................#
29
#......................................................................#
24
 
30
 
Line 103... Line 109...
103
my $checkDelta = 1;                         # Check Diffs between Tag and Head
109
my $checkDelta = 1;                         # Check Diffs between Tag and Head
104
                                            #   0 - Don't do anything
110
                                            #   0 - Don't do anything
105
                                            #   1 - Warn about diffs
111
                                            #   1 - Warn about diffs
106
                                            #   2 - Error if diffs
112
                                            #   2 - Error if diffs
107
my $traceBack = 2;                          # Trace Back error control. As above
113
my $traceBack = 2;                          # Trace Back error control. As above
-
 
114
my $needDevBranch = 1;                      # DevBranch error control. As above
108
 
115
 
109
#
116
#
110
#   Data about the package-version
117
#   Data about the package-version
111
#
118
#
112
my $srcPathPkg;                             # Root of the package
119
my $srcPathPkg;                             # Root of the package
Line 239... Line 246...
239
{
246
{
240
    if ( $opt_devModeStr =~ m/^(Tip)|(BranchTip)$/i) {
247
    if ( $opt_devModeStr =~ m/^(Tip)|(BranchTip)$/i) {
241
        $opt_devMode = 'tip';
248
        $opt_devMode = 'tip';
242
        $checkDelta = 1;
249
        $checkDelta = 1;
243
        $noReleaseWs = 1;
250
        $noReleaseWs = 1;
-
 
251
        $needDevBranch = 2;
244
    } elsif ( $opt_devModeStr =~ m/^(Tag)|(TagPoint)$/i) {
252
    } elsif ( $opt_devModeStr =~ m/^(Tag)|(TagPoint)$/i) {
245
        $opt_devMode = 'tag';
253
        $opt_devMode = 'tag';
246
        $checkDelta = 2;
254
        $checkDelta = 2;
247
        $checkDelta = 1 if ( $opt_branch );
255
        $checkDelta = 1 if ( $opt_branch );
248
        $noReleaseWs = 0;
256
        $noReleaseWs = 0;
-
 
257
        $needDevBranch = 2 unless ( $opt_branch );;
249
    } elsif ( $opt_devModeStr =~ m/^(Work)|(Working)$/i) {
258
    } elsif ( $opt_devModeStr =~ m/^(Work)|(Working)$/i) {
250
        $opt_devMode = '';
259
        $opt_devMode = '';
251
        $checkDelta = 1;
260
        $checkDelta = 1;
252
        $noReleaseWs = 0;
261
        $noReleaseWs = 0;
253
    } elsif ( $opt_devModeStr =~ m/^Exact$/i) {
262
    } elsif ( $opt_devModeStr =~ m/^Exact$/i) {
Line 420... Line 429...
420
#
429
#
421
Verbose("Ensure Labels can be found in a Repository");
430
Verbose("Ensure Labels can be found in a Repository");
422
Verbose ("Testing label: ". $svnSession->Full );
431
Verbose ("Testing label: ". $svnSession->Full );
423
$label_count++;
432
$label_count++;
424
 
433
 
425
$svnSession->SvnValidateTarget (
434
unless ( $svnSession->SvnValidateTarget (
426
                    'cmd'    => 'SvnRelease',
435
                    'cmd'    => 'SvnRelease',
427
                    'target' => $svnSession->Full,
436
                    'target' => $svnSession->Full,
428
                    'require' => 1,
437
                    'test' => 1,
429
                    );
438
                    )
-
 
439
        )
-
 
440
{
-
 
441
    Error ('ExitCode=11', "SvnRelease: Tag/Reference not found in repository", "Reference: " . $svnSession->Full)
-
 
442
}
430
 
443
 
431
#
444
#
432
#   If the user did not provide a peg then examine
445
#   If the user did not provide a peg then examine
433
#   the 'tag' in the repo and determine when it was created
446
#   the 'tag' in the repo and determine when it was created
434
#   This will not work to well if the user is allowed to move the tag
447
#   This will not work to well if the user is allowed to move the tag
Line 461... Line 474...
461
                          , 'onlysimple' => 0,
474
                          , 'onlysimple' => 0,
462
                          , 'printdata' => 0 );
475
                          , 'printdata' => 0 );
463
    $svnSession->{SavedBackTrack} = $btData;
476
    $svnSession->{SavedBackTrack} = $btData;
464
    unless ( $btData->{isaBranch} )
477
    unless ( $btData->{isaBranch} )
465
    {
478
    {
466
        Warning("Cannot trace package label back to a development branch");
479
        my $text = "Cannot trace package label back to a development branch";
-
 
480
        Error ($text) if ( $needDevBranch == 2 );
-
 
481
        Warning ($text);
467
    }
482
    }
468
    else
483
    else
469
    {
484
    {
470
        Error ("INTERNAL: Cannot parse result of backTrackSvnLabel: $labelBranch")
485
        Error ("INTERNAL: Cannot parse result of backTrackSvnLabel: $labelBranch")
471
            unless ($btData->{devBranch} =~ m~^(.*)@(\d+)$~);
486
            unless ($btData->{devBranch} =~ m~^(.*)@(\d+)$~);
Line 1134... Line 1149...
1134
    #   Count this files in the view
1149
    #   Count this files in the view
1135
    #   Done so that its clear when we have a empty workspace in escrow extractions
1150
    #   Done so that its clear when we have a empty workspace in escrow extractions
1136
    #
1151
    #
1137
    Verbose ("Examine View contents");
1152
    Verbose ("Examine View contents");
1138
    count_files ( $VIEWDIR );
1153
    count_files ( $VIEWDIR );
-
 
1154
    Error ('ExitCode=10', DisplayPath("View files in: $VIEWDIR, but no files were extracted"))
-
 
1155
        unless ($copy_count);
1139
    Message ("View files in: $VIEWDIR, Files: $copy_count" );
1156
    Message ("View files in: $VIEWDIR, Files: $copy_count" );
1140
}
1157
}
1141
 
1158
 
1142
#-------------------------------------------------------------------------------
1159
#-------------------------------------------------------------------------------
1143
# Function        : importTagChanges
1160
# Function        : importTagChanges
Line 1240... Line 1257...
1240
    #
1257
    #
1241
    #   No checking required
1258
    #   No checking required
1242
    #   Skip the hard bit if running on a build machine
1259
    #   Skip the hard bit if running on a build machine
1243
    #
1260
    #
1244
    return unless ( $checkDelta );
1261
    return unless ( $checkDelta );
-
 
1262
    return if ( $onlyWarn && ! $devBranch && ! $tagLabelBranch );
1245
 
1263
 
1246
    Debug ('determineChangedFiles');
1264
    Debug ('determineChangedFiles');
1247
#debugDumpRefInfo('determineChangedFiles');
1265
#debugDumpRefInfo('determineChangedFiles');
1248
 
1266
 
1249
    #
1267
    #