Subversion Repositories DevTools

Rev

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

Rev 2053 Rev 2354
Line 1347... Line 1347...
1347
# Description     : Check a label
1347
# Description     : Check a label
1348
#                       Must not contain a PEG
1348
#                       Must not contain a PEG
1349
#                       Must not contain invalid characters (@ or /)
1349
#                       Must not contain invalid characters (@ or /)
1350
#                       Must not contain a :: sequence (will confuse other tools)
1350
#                       Must not contain a :: sequence (will confuse other tools)
1351
#                       Handle special label of TIMESTAMP
1351
#                       Handle special label of TIMESTAMP
-
 
1352
#                           Create a .WIP so that it can be deleted
1352
#
1353
#
1353
# Inputs          : $label          - to test
1354
# Inputs          : $label          - to test
1354
#
1355
#
1355
# Returns         : Will not return on error
1356
# Returns         : Will not return on error
1356
#                   Returns label on success
1357
#                   Returns label on success
Line 1374... Line 1375...
1374
    #
1375
    #
1375
    if ( $label eq 'TIMESTAMP' )
1376
    if ( $label eq 'TIMESTAMP' )
1376
    {
1377
    {
1377
        ::EnvImport ('USER' );
1378
        ::EnvImport ('USER' );
1378
        my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
1379
        my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
1379
        $label = sprintf("%s_%4.4u.%2.2u.%2.2u.%2.2u%2.2u%2.2u",
1380
        $label = sprintf("%s_%4.4u.%2.2u.%2.2u.%2.2u%2.2u%2.2u.WIP",
1380
            $::USER, $year+1900, $mon+1, $mday, $hour, $min, $sec );
1381
            $::USER, $year+1900, $mon+1, $mday, $hour, $min, $sec );
1381
    }
1382
    }
1382
    return $label;
1383
    return $label;
1383
}
1384
}
1384
 
1385
 
Line 1845... Line 1846...
1845
#-------------------------------------------------------------------------------
1846
#-------------------------------------------------------------------------------
1846
# Function        : setRepoProperty
1847
# Function        : setRepoProperty
1847
#
1848
#
1848
# Description     : Sets a Repository property
1849
# Description     : Sets a Repository property
1849
#                   This may well fail unless the Repo is setup to allow such
1850
#                   This may well fail unless the Repo is setup to allow such
1850
#                   chnages and the user is allowed to make such changes
1851
#                   changes and the user is allowed to make such changes
1851
#
1852
#
1852
# Inputs          : $name
1853
# Inputs          : $name
1853
#                   $value
1854
#                   $value
1854
#                   $allowError     - Support for bad repositories
1855
#                   $allowError     - Support for bad repositories
1855
#
1856
#
Line 1858... Line 1859...
1858
#
1859
#
1859
sub setRepoProperty
1860
sub setRepoProperty
1860
{
1861
{
1861
    my ($self, $name, $value, $allowError ) = @_;
1862
    my ($self, $name, $value, $allowError ) = @_;
1862
    my $retval = 0;
1863
    my $retval = 0;
-
 
1864
    my $rv;
1863
 
1865
 
1864
    Debug ( "setRepoProperty", $name, $value );
1866
    Debug ( "setRepoProperty", $name, $value );
1865
    #
1867
    #
1866
    #   Ensure that the Repo version is known
1868
    #   Ensure that the Repo version is known
1867
    #   This should be set by a previous operation
1869
    #   This should be set by a previous operation
Line 1869... Line 1871...
1869
    unless ( defined $self->{REVNO} )
1871
    unless ( defined $self->{REVNO} )
1870
    {
1872
    {
1871
        Error ("setRepoProperty. Release Revision Number not known");
1873
        Error ("setRepoProperty. Release Revision Number not known");
1872
    }
1874
    }
1873
 
1875
 
-
 
1876
 
-
 
1877
 
1874
    #
1878
    #
1875
    #   Execute the command
1879
    #   Execute the command
-
 
1880
    #   Appears tp fail random;y - so try a few times
1876
    #
1881
    #
-
 
1882
    for (my $ii = 0; $ii < 3; $ii++ )
-
 
1883
    {
1877
    if ( $self->SvnCmd ( 'propset' , $name, '--revprop', '-r',  $self->{REVNO}, $value, $self->Full,
1884
    $rv = $self->SvnCmd ( 'propset' , $name, '--revprop', '-r',  $self->{REVNO}, $value, $self->Full,
1878
                            {
1885
                            {
1879
                                'credentials' => 1,
1886
                                'credentials' => 1,
1880
                                'nosavedata' => 1,
1887
                                'nosavedata' => 1,
1881
                            }
1888
                            }
1882
                       ) )
1889
                       );
-
 
1890
        last unless ( $rv );
-
 
1891
        Warning("setRepoProperty: Failure attempt: $ii");
-
 
1892
DebugDumpData('setRepoProperty Failure', $self );
-
 
1893
        sleep (1);
-
 
1894
    }
-
 
1895
 
-
 
1896
    if ($rv)
1883
    {
1897
    {
1884
        #
1898
        #
1885
        #   Property NOT set
1899
        #   Property NOT set
1886
        #
1900
        #
1887
        if ( $allowError )
1901
        if ( $allowError )