Subversion Repositories DevTools

Rev

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

Rev 351 Rev 353
Line 20... Line 20...
20
#                   -infile     auto.xml/auto.pl
20
#                   -infile     auto.xml/auto.pl
21
#                   -outfile    xxxdepends.xml/build.pl
21
#                   -outfile    xxxdepends.xml/build.pl
22
#                   -pname      package_name
22
#                   -pname      package_name
23
#                   -pversion   package_version
23
#                   -pversion   package_version
24
#                   -infofile   path_to_info_file
24
#                   -infofile   path_to_info_file
25
#                   -wiplabel   Existing WIP label (optional)
25
#                   -wiplabel   Existing WIP label (deprecate)
26
#                   -baselabel  View label
26
#                   -baselabel  View label
-
 
27
#                   -isawip     Is A WIP (optional)
27
#
28
#
28
#......................................................................#
29
#......................................................................#
29
 
30
 
30
use strict;
31
use strict;
31
use warnings;
32
use warnings;
Line 51... Line 52...
51
my $opt_branch;
52
my $opt_branch;
52
my $opt_newbranch;
53
my $opt_newbranch;
53
my $opt_infofile;
54
my $opt_infofile;
54
my $opt_pname;
55
my $opt_pname;
55
my $opt_pversion;
56
my $opt_pversion;
56
my $opt_wiplabel;
57
my $opt_wiptag;
57
my $opt_baselabel;
58
my $opt_basetag;
-
 
59
my $opt_isa_wip;
58
 
60
 
59
#
61
#
60
#   Globals
62
#   Globals
61
#
63
#
62
my $root_dir;
64
my $root_dir;
Line 64... Line 66...
64
my $tag_label;
66
my $tag_label;
65
my @error_list;
67
my @error_list;
66
my $last_result;
68
my $last_result;
67
my @last_results;
69
my @last_results;
68
my $label_created;
70
my $label_created;
-
 
71
my $wip_label;
-
 
72
my $ccpath;
69
 
73
 
70
#
74
#
71
#   Configuration options
75
#   Configuration options
72
#
76
#
73
my $result = GetOptions (
77
my $result = GetOptions (
Line 81... Line 85...
81
                "newbranch"     => \$opt_newbranch,         # string
85
                "newbranch"     => \$opt_newbranch,         # string
82
 
86
 
83
                "infofile=s"    => \$opt_infofile,          # string
87
                "infofile=s"    => \$opt_infofile,          # string
84
                "pname=s"       => \$opt_pname,             # string
88
                "pname=s"       => \$opt_pname,             # string
85
                "pversion=s"    => \$opt_pversion,          # string
89
                "pversion=s"    => \$opt_pversion,          # string
86
                "wiplabel=s"    => \$opt_wiplabel,          # string
90
                "wiplabel=s"    => \$opt_wiptag,            # string
87
                "baselabel=s"   => \$opt_baselabel,         # string
91
                "baselabel=s"   => \$opt_basetag,           # string
-
 
92
                "isawip:+"      => \$opt_isa_wip,           # Flag
88
 
93
 
89
                #
94
                #
90
                #   Update documentation at the end of the file
95
                #   Update documentation at the end of the file
91
                #
96
                #
92
                );
97
                );
Line 113... Line 118...
113
 
118
 
114
$opt_branch = $opt_branch_default
119
$opt_branch = $opt_branch_default
115
    unless ( $opt_branch );
120
    unless ( $opt_branch );
116
 
121
 
117
Error ("Base Label not provided")
122
Error ("Base Label not provided")
118
    unless ( $opt_baselabel );
123
    unless ( $opt_basetag );
119
    
124
    
120
Error ("Package Name not provided")
125
Error ("Package Name not provided")
121
    unless ( $opt_pname );
126
    unless ( $opt_pname );
122
 
127
 
123
Error ("Package Version not provided")
128
Error ("Package Version not provided")
Line 142... Line 147...
142
#   Sanity check the form of the baselabel
147
#   Sanity check the form of the baselabel
143
#   It will be used to calulate a new Version Control String
148
#   It will be used to calulate a new Version Control String
144
#   Baselabel contains: PATH and a LABEL
149
#   Baselabel contains: PATH and a LABEL
145
#   Need to extract and save the path
150
#   Need to extract and save the path
146
#
151
#
147
 $opt_baselabel =~ tr~\\/~/~s;
152
$opt_basetag =~ tr~\\/~/~s;
148
 $opt_baselabel =~ m~^CC::/(.+)::~ || Error("Invalid baselabel format: $opt_baselabel");
153
$opt_basetag =~ m~^CC::/(.+)::(.+)~ || Error("Invalid baselabel format: $opt_basetag");
149
 my $ccpath = $1;
154
$ccpath = $1;
-
 
155
$wip_label = $2 if ( $opt_isa_wip || $opt_wiptag );
150
 
156
 
151
#
157
#
152
#   Determine the name of the Branch to be used
158
#   Determine the name of the Branch to be used
153
#   This is based on the branch that the file is already on as ClearCase does
159
#   This is based on the branch that the file is already on as ClearCase does
154
#   not allow multiple instances of a branch on different sub-branches
160
#   not allow multiple instances of a branch on different sub-branches
Line 467... Line 473...
467
 
473
 
468
    #
474
    #
469
    #   Free label has been found
475
    #   Free label has been found
470
    #   Create it now, unless we are processing a WIP
476
    #   Create it now, unless we are processing a WIP
471
    #
477
    #
472
    unless ( $opt_wiplabel )
478
    unless ( $wip_label )
473
    {
479
    {
474
        Verbose ("Creating new label: $tag_label");
480
        Verbose ("Creating new label: $tag_label");
475
        ClearCmd ('mklbtype', '-c', 'Autobuild Created', $tag_label );
481
        ClearCmd ('mklbtype', '-c', 'Autobuild Created', $tag_label );
476
        Error ("Cannot create new label: $tag_label" ) if ( @error_list );
482
        Error ("Cannot create new label: $tag_label" ) if ( @error_list );
477
 
483
 
Line 482... Line 488...
482
        $label_created = $tag_label;
488
        $label_created = $tag_label;
483
        $pkg_label = $tag_label;
489
        $pkg_label = $tag_label;
484
    }
490
    }
485
    else
491
    else
486
    {
492
    {
487
        $pkg_label = $opt_wiplabel;
493
        $pkg_label = $wip_label;
488
    }
494
    }
489
}
495
}
490
 
496
 
491
#-------------------------------------------------------------------------------
497
#-------------------------------------------------------------------------------
492
# Function        : label_build_view
498
# Function        : label_build_view
Line 507... Line 513...
507
#
513
#
508
# Returns         : 
514
# Returns         : 
509
#
515
#
510
sub label_build_view
516
sub label_build_view
511
{
517
{
512
    if ( $opt_wiplabel )
518
    if ( $wip_label )
513
    {
519
    {
514
        Verbose ("Rename label: From $opt_wiplabel to $tag_label");
520
        Verbose ("Rename label: From $wip_label to $tag_label");
515
        SystemConfig ( ExitOnError => 2);
521
        SystemConfig ( ExitOnError => 2);
516
        JatsCmd( 'label', '-unlock', $opt_wiplabel, '-rename', $tag_label, '-lock', '-mine' );
522
        JatsCmd( 'label', '-unlock', $wip_label, '-rename', $tag_label, '-lock', '-mine' );
517
    }
523
    }
518
    else
524
    else
519
    {
525
    {
520
        Verbose ("Apply new label to package: $tag_label");
526
        Verbose ("Apply new label to package: $tag_label");
521
 
527
 
Line 543... Line 549...
543
    {
549
    {
544
 
550
 
545
        my $data = JatsProperties::New();
551
        my $data = JatsProperties::New();
546
 
552
 
547
        $data->setProperty('Label', $tag_label);
553
        $data->setProperty('Label', $tag_label);
548
        $data->setProperty('WipLabel', $opt_wiplabel ) if $opt_wiplabel;
554
        $data->setProperty('WipLabel', $wip_label ) if $wip_label;
549
        $data->setProperty('PackageName', $opt_pname);
555
        $data->setProperty('PackageName', $opt_pname);
550
        $data->setProperty('PackageVersion', $opt_pversion);
556
        $data->setProperty('PackageVersion', $opt_pversion);
551
        $data->setProperty('clearcase.branch', $opt_branch);
557
        $data->setProperty('clearcase.branch', $opt_branch);
552
        $data->setProperty('VCS.tag', 'CC::/' . $ccpath . '::' . $tag_label);
558
        $data->setProperty('VCS.tag', 'CC::/' . $ccpath . '::' . $tag_label);
553
 
559
 
Line 645... Line 651...
645
    -branch=xxx         - Branch to create (AutoBuilder)
651
    -branch=xxx         - Branch to create (AutoBuilder)
646
    -newbranch          - Force file to be on a new (project) branch
652
    -newbranch          - Force file to be on a new (project) branch
647
    -infofile=path      - Save label information in 'path'
653
    -infofile=path      - Save label information in 'path'
648
    -pname=name         - Name of the package
654
    -pname=name         - Name of the package
649
    -pversion=text      - Package version
655
    -pversion=text      - Package version
650
    -wiplabel=text      - Current package WIP label
656
    -wiplabel=text      - Current package WIP VcsTag
651
    -baselabel=text     - Base label for sandbox
657
    -baselabel=text     - Base VcsTag for sandbox
-
 
658
    -isawip             - Current package is a WIP
652
 
659
 
653
=head1 OPTIONS
660
=head1 OPTIONS
654
 
661
 
655
=over 8
662
=over 8
656
 
663
 
Line 724... Line 731...
724
This option specifies the package version. It will be used to construct a new
731
This option specifies the package version. It will be used to construct a new
725
label for the package.
732
label for the package.
726
 
733
 
727
=item B<-wiplabel=text>
734
=item B<-wiplabel=text>
728
 
735
 
729
This option controls the manner in which this utility will label the build view.
-
 
730
 
-
 
731
If present, the label specifies a 'Work In Progress' label. The label will be
-
 
732
renamed.
-
 
733
 
-
 
734
If not present, then the view will be labeled with a new label.
736
Deprecated option. Do not use. Use -isawip instead.
735
 
737
 
736
=item B<-baselabel=text>
738
=item B<-baselabel=text>
737
 
739
 
738
This option specifies the Version Control Label that the current workspace
740
This option specifies the Version Control Label that the current workspace
739
is based on. This may be used to determine the new label for the package.
741
is based on. This may be used to determine the new label for the package.
740
 
742
 
741
This parameter is mandatory.
743
This parameter is mandatory.
742
 
744
 
-
 
745
=item B<-isawip>
-
 
746
 
-
 
747
This option controls the manner in which this utility will label the build view.
-
 
748
 
-
 
749
If present, the label specifies a 'Work In Progress' label. The label will be
-
 
750
renamed. At the end of the process the wip label will be deleted from the
-
 
751
the repository.
-
 
752
 
-
 
753
If not present, then the view will be labeled with a new label.
-
 
754
 
-
 
755
 
743
=back
756
=back
744
 
757
 
745
=head1 DESCRIPTION
758
=head1 DESCRIPTION
746
 
759
 
747
This utility is used by the automated build system to place build view under
760
This utility is used by the automated build system to place build view under