Subversion Repositories DevTools

Rev

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

Rev 399 Rev 1329
Line 519... Line 519...
519
    }
519
    }
520
    return 0;
520
    return 0;
521
}
521
}
522
 
522
 
523
#-------------------------------------------------------------------------------
523
#-------------------------------------------------------------------------------
-
 
524
# Function        : SvnInfo
-
 
525
#
-
 
526
# Description     : Determine Subversion Info for a specified target
-
 
527
#
-
 
528
# Inputs          : $self               - Instance Data
-
 
529
#                   $url                - Path or URL to get Info on
-
 
530
#                   $tag                - Name of tag within $self to store data
-
 
531
#
-
 
532
# Returns         : Non Zero if errors detected
-
 
533
#
-
 
534
sub SvnInfo
-
 
535
{
-
 
536
    my ($self, $url, $tag) = @_;
-
 
537
    Error ("Internal: SvnInfo. No Tag provided") unless ( defined $tag );
-
 
538
    Error ("Internal: SvnInfo. No URL provided") unless ( defined $url );
-
 
539
 
-
 
540
    #
-
 
541
    #   Only call  once
-
 
542
    #       Must simulate a good call
-
 
543
    #
-
 
544
    if ( exists $self->{$tag} )
-
 
545
    {
-
 
546
#DebugDumpData("MeCache: $tag", $self );
-
 
547
        $self->{ERROR_LIST} = [];
-
 
548
        return 0;
-
 
549
    }
-
 
550
 
-
 
551
    #
-
 
552
    #   Get basic information on the target
-
 
553
    #
-
 
554
    $self->{'infoTag'} = $tag;
-
 
555
    $self->{$tag}{SvnInfoPath} = $url;
-
 
556
    my $rv = $self->SvnCmd ('info', $url, '--depth', 'empty'
-
 
557
                    , { 'credentials' => 1,
-
 
558
                        'nosavedata' => 1,
-
 
559
                        'process' => \&ProcessInfo
-
 
560
                    }
-
 
561
     );
-
 
562
 
-
 
563
    delete $self->{$tag} if ( @{$self->{ERROR_LIST}} );
-
 
564
    delete $self->{'infoTag'};
-
 
565
#DebugDumpData("Me: $tag", $self );
-
 
566
    return $rv;
-
 
567
}
-
 
568
 
-
 
569
#-------------------------------------------------------------------------------
-
 
570
# Function        : ProcessInfo
-
 
571
#
-
 
572
# Description     : Process info for SvnInfo
-
 
573
#
-
 
574
# Inputs          : $self           - Instance data
-
 
575
#                   $line           - Command output
-
 
576
#
-
 
577
# Returns         : zero - we don't want to kill the command
-
 
578
#
-
 
579
sub ProcessInfo
-
 
580
{
-
 
581
    my ($self, $line ) = @_;
-
 
582
 
-
 
583
    Message ( $line ) if $self->{PRINTDATA};
-
 
584
    $line =~ m~(.*?):\s+(.*)~;
-
 
585
    $self->{$self->{'infoTag'}}{$1} = $2;
-
 
586
    return 0;
-
 
587
}
-
 
588
 
-
 
589
#-------------------------------------------------------------------------------
524
# Function        : SvnScanPath
590
# Function        : SvnScanPath
525
#
591
#
526
# Description     : Internal helper function
592
# Description     : Internal helper function
527
#                   Scan a directory and split contents into three groups
593
#                   Scan a directory and split contents into three groups
528
#
594
#