Subversion Repositories DevTools

Rev

Rev 321 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 321 Rev 331
Line 258... Line 258...
258
    #
258
    #
259
    #   Need to create the initial branch point, but only if one does not already
259
    #   Need to create the initial branch point, but only if one does not already
260
    #   exists
260
    #   exists
261
    #
261
    #
262
    Verbose ("Check for existing branch: $opt_branch" );
262
    Verbose ("Check for existing branch: $opt_branch" );
263
    if ( ClearCmd( 'find', $opt_ofile, '-version', "brtype($opt_branch)", '-print' ) )
263
    if ( ClearCmd( 'find', $opt_ofile, '-branch', "brtype($opt_branch)", '-print' ) )
264
    {
264
    {
265
        Error ("Internal error. Cleartool find should not fail");
265
        Error ("Internal error. Cleartool find should not fail");
266
    }
266
    }
267
    if ( $last_result )
267
    if ( $last_result )
268
    {
268
    {
269
        #
269
        #
270
        #   A branch already exists - and there can only be one
270
        #   A branch already exists - and there can only be one
271
        #
271
        #
272
        $last_result =~ m~@@(.*)/([^/]+)~;
272
        $last_result =~ m~@@(.*)~;
273
        $target_branch = $1;
273
        $target_branch = $1;
274
        Error ("Cannot determine full branch path: $last_result") unless ( $target_branch );
274
        Error ("Cannot determine full branch path: $last_result") unless ( $target_branch );
275
        Verbose2 ("Target Branch: $target_branch" );
275
        Verbose2 ("Target Branch: $target_branch" );
276
    }
276
    }
277
    else
277
    else
Line 555... Line 555...
555
# Description     : Label the view
555
# Description     : Label the view
556
#
556
#
557
#                   Either:
557
#                   Either:
558
#                       Rename the WIP label to required name
558
#                       Rename the WIP label to required name
559
#                       Label all files in the view
559
#                       Label all files in the view
-
 
560
#
560
#                   
561
#                   Always make the lable 'mine'
-
 
562
#                   This will prevent the old owner from unlocking the label.
-
 
563
#
561
#                   Use JATS to do the hard work
564
#                   Use JATS to do the hard work
562
#
565
#
563
#
566
#
564
# Inputs          : Globals
567
# Inputs          : Globals
565
#
568
#
Line 569... Line 572...
569
{
572
{
570
    if ( $opt_wiplabel )
573
    if ( $opt_wiplabel )
571
    {
574
    {
572
        Verbose ("Rename label: From $opt_wiplabel to $tag_label");
575
        Verbose ("Rename label: From $opt_wiplabel to $tag_label");
573
        SystemConfig ( ExitOnError => 2);
576
        SystemConfig ( ExitOnError => 2);
574
        JatsCmd( 'label', '-unlock', $opt_wiplabel, '-rename', $tag_label, '-lock' );
577
        JatsCmd( 'label', '-unlock', $opt_wiplabel, '-rename', $tag_label, '-lock', '-mine' );
575
    }
578
    }
576
    else
579
    else
577
    {
580
    {
578
        Verbose ("Apply new label to package: $tag_label");
581
        Verbose ("Apply new label to package: $tag_label");
579
 
582
 
580
        #
583
        #
581
        #   Need to determine the root of the VOB
-
 
582
        #   Currently within the VOB.
-
 
583
        #   Get the "versioned object base" from clearcase
-
 
584
        #   Change to that directory and label the entire subtree
-
 
585
        #
-
 
586
        ClearCmd('describe', '-fmt', '%Ln', 'vob:.');
-
 
587
        Error ("Program Terminated") if ( @error_list );
-
 
588
        Error ("Cannot determine current VOB base" ) unless ( $last_result );
-
 
589
        my $vob_base = quotemeta($last_result);
-
 
590
        Verbose ("VOB Base: $last_result");
-
 
591
 
-
 
592
        my $here =  getcwd();
-
 
593
        Verbose ("Current dir: $here");
-
 
594
 
-
 
595
        $here =~ m~^(.*$vob_base)~;
-
 
596
        my $base_dir = $1;
-
 
597
        Verbose ("Path of base: $base_dir");
-
 
598
 
-
 
599
        chdir ( $base_dir ) || Error ("Cannot chdir to vob base", $base_dir);
-
 
600
 
-
 
601
        #
-
 
602
        #   Label the entire (static) view
584
        #   Label the entire (static) view
-
 
585
        #   Use special form of the labeling process that is geared
-
 
586
        #   to label the entire view.
-
 
587
        #
603
        #       This will work because this should only be done within a
588
        #       This will work because this should only be done within a
604
        #       static view based on a single label. Thus the view should
589
        #       static view based on a single label. Thus the view should
605
        #       contain ony the files that form the current package.
590
        #       contain ony the files that form the current package.
-
 
591
        #
606
        #   Handle errors as error exit will clean up
592
        #   Handle errors as error exit will clean up
607
        #
593
        #
608
        my $rv = JatsCmd( 'label', '-label', $tag_label, '-replace', '-lock' );
594
        my $rv = JatsCmd( 'label', '-entireview', $tag_label, '-replace', '-lock', , '-mine' );
609
        Error ("Failed to label all files in view")
595
        Error ("Failed to label all files in view")
610
            if ( $rv );
596
            if ( $rv );
611
    }
597
    }
612
 
598
 
613
    #
599
    #