Subversion Repositories DevTools

Rev

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

Rev 1343 Rev 1344
Line 1826... Line 1826...
1826
#
1826
#
1827
sub backTrackSvnLabel
1827
sub backTrackSvnLabel
1828
{
1828
{
1829
    my ($self, $src_label, $refData) = @_;
1829
    my ($self, $src_label, $refData) = @_;
1830
 
1830
 
1831
    if ( $refData && ref($refData) ne 'SCALAR' )
-
 
1832
    {
-
 
1833
        Error ('Internal: backTrackSvnLabel. 3rd arg must be ref to a scalar');
1831
    Error ('Internal: backTrackSvnLabel. 3rd arg must be ref to a scalar')
1834
    }
1832
        if ( $refData && ref($refData) ne 'SCALAR' );
1835
 
1833
 
1836
    #
1834
    #
1837
    #   Init stored data
1835
    #   Init stored data
1838
    #
1836
    #
1839
    $self->{btData} = ();
1837
    $self->{btData} = ();
Line 1841... Line 1839...
1841
    #
1839
    #
1842
    #   extract data
1840
    #   extract data
1843
    #
1841
    #
1844
#DebugDumpData("SVN", $svn );
1842
#DebugDumpData("SVN", $svn );
1845
#$self->{PRINTDATA} = 1;
1843
#$self->{PRINTDATA} = 1;
1846
    $src_label =~ s~^tags/~~;
-
 
1847
    $self->SvnCmd ( 'log', '-v', '--xml', '-q', '--stop-on-copy', $self->FullPath() . '/tags/' . $src_label
1844
    $self->SvnCmd ( 'log', '-v', '--xml', '-q', '--stop-on-copy', $self->FullPath() . '/' . $src_label
1848
                    , { 'credentials' => 1,
1845
                    , { 'credentials' => 1,
1849
                        'process' => \&ProcessBackTrack,
1846
                        'process' => \&ProcessBackTrack,
1850
                         }
1847
                         }
1851
                        );
1848
                        );
1852
 
1849
 
Line 1865... Line 1862...
1865
    {
1862
    {
1866
        my $name;
1863
        my $name;
1867
        my $isaBranch;
1864
        my $isaBranch;
1868
        my $target = $entry->{target};
1865
        my $target = $entry->{target};
1869
 
1866
 
1870
        if ( $target =~ m~/tags/$peglessLabel$~ )
1867
        if ( $target =~ m~/$peglessLabel$~ )
1871
        {
1868
        {
1872
            my $parent = $entry->{fromPath};
1869
            my $parent = $entry->{fromPath};
1873
            if ( $parent =~ m~(.+)/((tags|branches|trunk)(/|$).*)~ )
1870
            if ( $parent =~ m~(.+)/((tags|branches|trunk)(/|$).*)~ )
1874
            {
1871
            {
1875
                $branch = $2 . '@' . $entry->{fromRev};
1872
                $branch = $2 . '@' . $entry->{fromRev};
1876
                last;
1873
                last;
1877
            }
1874
            }
1878
        }
1875
        }
1879
    }
1876
    }
1880
 
1877
 
1881
    $$refData = $self->{btData}{data}
-
 
1882
        if ( $refData );
-
 
1883
    delete $self->{btData};
-
 
1884
 
-
 
1885
    #
1878
    #
1886
    #   Return nice value or original value
1879
    #   Return nice value or original value
1887
    #
1880
    #
1888
    unless ( $branch )
1881
    unless ( $branch )
1889
    {
1882
    {
1890
        $branch = 'tags/' . $src_label;
1883
        $branch = 'tags/' . $src_label;
-
 
1884
        $self->{btData}{entryCount} = 0;
1891
    }
1885
    }
1892
 
1886
 
-
 
1887
    #
-
 
1888
    #   Pass data back to the user
-
 
1889
    #   Clean up data in the class
-
 
1890
    #
-
 
1891
    $$refData = $self->{btData}
-
 
1892
        if ( $refData );
-
 
1893
    delete $self->{btData};
-
 
1894
 
1893
    Verbose( "backTrackSvnLabel: $src_label -> $branch");
1895
    Verbose( "backTrackSvnLabel: $src_label -> $branch");
1894
    return $branch;
1896
    return $branch;
1895
}
1897
}
1896
 
1898
 
1897
#-------------------------------------------------------------------------------
1899
#-------------------------------------------------------------------------------
Line 1926... Line 1928...
1926
sub  ProcessBackTrack
1928
sub  ProcessBackTrack
1927
{
1929
{
1928
    my ($self, $line ) = @_;
1930
    my ($self, $line ) = @_;
1929
    Message ( $line ) if $self->{PRINTDATA};
1931
    Message ( $line ) if $self->{PRINTDATA};
1930
 
1932
 
-
 
1933
    if ( $line =~ m~^<logentry$~ ) {
-
 
1934
        $self->{btData}{entryCount} ++;
-
 
1935
    }
-
 
1936
 
1931
    if ( $line =~ m~^<path$~ ) {
1937
    if ( $line =~ m~^<path$~ ) {
1932
        delete $self->{btData}{entry};
1938
        delete $self->{btData}{entry};
1933
    } elsif ( $line =~ m~^\s*kind="(.+)"~ ) {
1939
    } elsif ( $line =~ m~^\s*kind="(.+)"~ ) {
1934
        $self->{btData}{entry}{kind} = $1;
1940
        $self->{btData}{entry}{kind} = $1;
1935
    } elsif ( $line =~ m~^\s+revision="(\d+)"~ ) {
1941
    } elsif ( $line =~ m~^\s+revision="(\d+)"~ ) {