Subversion Repositories DevTools

Rev

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

Rev 3044 Rev 3856
Line 1521... Line 1521...
1521
 
1521
 
1522
#-------------------------------------------------------------------------------
1522
#-------------------------------------------------------------------------------
1523
# Function        : calcViewName
1523
# Function        : calcViewName
1524
#
1524
#
1525
# Description     : Calculate a nice name for the view
1525
# Description     : Calculate a nice name for the view
-
 
1526
#                   Try to keep short and informative
-
 
1527
#                       Some legacy tools hate long paths.
-
 
1528
#                       See Jira issue: JATS-274
1526
#                   Try to base the name on the tag
1529
#                   Try to base the name on the tag
1527
#
1530
#
1528
#                   If the URL looks like a TTB then we can make some guesses
1531
#                   If the URL looks like a TTB then we can make some guesses
1529
#                   as to the package name and version.
1532
#                   as to the package name and version.
1530
#
1533
#
Line 1532... Line 1535...
1532
#                   Add indication for a branch
1535
#                   Add indication for a branch
1533
 
1536
 
1534
#
1537
#
1535
# Inputs          : Nothing
1538
# Inputs          : Nothing
1536
#
1539
#
1537
# Returns         : A nice View name
1540
# Returns         : A 'nice' ViewName
1538
#                   Will not retirn on error
1541
#                   Will not return on error
1539
#
1542
#
1540
sub calcViewName
1543
sub calcViewName
1541
{
1544
{
1542
    #
1545
    #
1543
    #   Use the user provided view name if its valid
1546
    #   Use the user provided view name if its valid
Line 1552... Line 1555...
1552
    #
1555
    #
1553
    #   Create a view name based on the provide URL or SVN Reference
1556
    #   Create a view name based on the provide URL or SVN Reference
1554
    #
1557
    #
1555
    my $version;
1558
    my $version;
1556
    my $name = $srcPathPkg;
1559
    my $name = $srcPathPkg;
-
 
1560
    my $isaWIP;
-
 
1561
 
1557
    $name =~ s~.*/~~;
1562
    $name =~ s~.*/~~;
1558
 
1563
 
1559
    if ( $tagLabel )
1564
    if ( $tagLabel )
1560
    {
1565
    {
1561
        $version = $tagLabel;
1566
        $version = $tagLabel;
1562
        $version =~ s~.*/~~;
1567
        $version =~ s~.*/~~;
-
 
1568
        $isaWIP = $version =~ m~\.WIP$~;
-
 
1569
 
-
 
1570
        # Remove package name from the tag
-
 
1571
        # Allow for WIPs too
-
 
1572
        #       XXXX_nnnn.ppp.WIP   WIP: Name is upper case. Join is.
-
 
1573
        #       xxxx_nn.nn.nn.ppp   TAG: Name is same case. Join is _
1563
        $version = $1 if ( $version =~ m~^${name}_(.*)~ );
1574
        $version = $1 if ( $version =~ m~^${name}[_.](.*)~i );
1564
    }
1575
    }
1565
    elsif ( $devBranch )
1576
    elsif ( $devBranch )
1566
    {
1577
    {
1567
        $version = $devBranch;
1578
        $version = $devBranch;
1568
        $version =~ s~.*/~~;
1579
        $version =~ s~.*/~~;
Line 1594... Line 1605...
1594
        $bad_label_name = 1;
1605
        $bad_label_name = 1;
1595
    }
1606
    }
1596
 
1607
 
1597
    #
1608
    #
1598
    #   Append the peg if provided
1609
    #   Append the peg if provided
1599
    #   Not if creating a 'tip' as its a bit meaningless
1610
    #       Not if creating a 'tip' as its a bit meaningless
-
 
1611
    #       Not if a WIP as it should have been provided and is not noise
1600
    #
1612
    #
1601
    if ( my $peg = $tagPeg || $devBranchPeg )
1613
    if ( my $peg = $tagPeg || $devBranchPeg )
1602
    {
1614
    {
1603
        unless( $opt_devMode eq 'tip' )
1615
        unless( $opt_devMode eq 'tip' || $isaWIP)
1604
        {
1616
        {
1605
            $opt_viewname .= '_' . $peg;
1617
            $opt_viewname .= '_' . $peg;
1606
        }
1618
        }
1607
    }
1619
    }
1608
 
1620