Subversion Repositories DevTools

Rev

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

Rev 1329 Rev 1403
Line 214... Line 214...
214
}
214
}
215
 
215
 
216
#-------------------------------------------------------------------------------
216
#-------------------------------------------------------------------------------
217
# Function        : SvnDelete
217
# Function        : SvnDelete
218
#
218
#
219
# Description     : Delete a directory within a repostory
219
# Description     : Delete a directory within a repository
220
#                   Intended to be used to remove tags and branches
220
#                   Intended to be used to remove tags and branches
221
#
221
#
222
# Inputs          : $self       - Instance data
222
# Inputs          : $self       - Instance data
223
#                   A hash of named arguments
223
#                   A hash of named arguments
224
#                       target     - Path to remove
224
#                       target     - Path to remove
Line 526... Line 526...
526
# Description     : Determine Subversion Info for a specified target
526
# Description     : Determine Subversion Info for a specified target
527
#
527
#
528
# Inputs          : $self               - Instance Data
528
# Inputs          : $self               - Instance Data
529
#                   $url                - Path or URL to get Info on
529
#                   $url                - Path or URL to get Info on
530
#                   $tag                - Name of tag within $self to store data
530
#                   $tag                - Name of tag within $self to store data
-
 
531
#                                         Currently InfoWs and InfoRepo
531
#
532
#
532
# Returns         : Non Zero if errors detected
533
# Returns         : Non Zero if errors detected
533
#
534
#
534
sub SvnInfo
535
sub SvnInfo
535
{
536
{
Line 718... Line 719...
718
    #
719
    #
719
    my $peg = $self->{REVNO} || $self->{WSREVNO};
720
    my $peg = $self->{REVNO} || $self->{WSREVNO};
720
    $target .= '@' . $peg if $peg;
721
    $target .= '@' . $peg if $peg;
721
 
722
 
722
    #
723
    #
-
 
724
    #   Attempt to Calculate Release Manager
-
 
725
    #       SourcePath::Tag
-
 
726
    #
-
 
727
    if ( $self->{DEVBRANCH} )
-
 
728
    {
-
 
729
        my $sourcePath = $self->CalcSymbolicUrl($self->FullPath()) . '/' . $self->{DEVBRANCH};
-
 
730
        my $tag = 'Unknown';
-
 
731
        if ( $target =~ m~/tags/(.*)~ ) {
-
 
732
            $tag = $1;
-
 
733
        } else {
-
 
734
            $tag = $peg if ( $peg );
-
 
735
        }
-
 
736
        $self->{SVNTAG} = $sourcePath . '::' . $tag;
-
 
737
    }
-
 
738
 
-
 
739
    return $self->{RMREF} = $self->CalcSymbolicUrl($target);
-
 
740
}
-
 
741
 
-
 
742
#-------------------------------------------------------------------------------
-
 
743
# Function        : CalcSymbolicUrl
-
 
744
#
-
 
745
# Description     : Given a URL, return a symbolic URL
-
 
746
#
-
 
747
# Inputs          : $target                 - FULL URL
-
 
748
#
-
 
749
# Returns         : Imput string with a Symbolic URL if possible
-
 
750
#
-
 
751
sub CalcSymbolicUrl
-
 
752
{
-
 
753
    my ($self, $target) = @_;
-
 
754
 
-
 
755
    #
723
    #   Take target and remove the reference to the local repository,
756
    #   Take target and remove the reference to the local repository,
724
    #   if its present. This will provide a ref that we can use on any site
757
    #   if its present. This will provide a ref that we can use on any site
725
    #
758
    #
726
    #   Note: %SVN_URLS values will have a trailing '/'
759
    #   Note: %SVN_URLS values will have a trailing '/'
727
    #
760
    #
Line 734... Line 767...
734
        {
767
        {
735
            $target =~ s~^/~~;
768
            $target =~ s~^/~~;
736
            last;
769
            last;
737
        }
770
        }
738
    }
771
    }
739
    return $self->{RMREF} = $target;
772
    return $target;
740
}
773
}
741
 
774
 
742
#-------------------------------------------------------------------------------
775
#-------------------------------------------------------------------------------
743
# Function        : SvnComment
776
# Function        : SvnComment
744
#
777
#
Line 818... Line 851...
818
#                   Command arguments
851
#                   Command arguments
819
#                   Last argument may be a hash of options.
852
#                   Last argument may be a hash of options.
820
#                       credentials - Add credentials
853
#                       credentials - Add credentials
821
#                       nosavedata  - Don't save the data
854
#                       nosavedata  - Don't save the data
822
#                       process     - Callback function
855
#                       process     - Callback function
-
 
856
#                       printdata   - Print data
823
#                       error       - Error Message
857
#                       error       - Error Message
824
#                                     Used as first line of an Error call
858
#                                     Used as first line of an Error call
825
#
859
#
826
# Returns         : non-zero on errors detected
860
# Returns         : non-zero on errors detected
827
#
861
#
Line 836... Line 870...
836
    #
870
    #
837
    my $opt;
871
    my $opt;
838
    $opt = pop @_
872
    $opt = pop @_
839
        if (@_ > 0 and UNIVERSAL::isa($_[-1],'HASH'));
873
        if (@_ > 0 and UNIVERSAL::isa($_[-1],'HASH'));
840
 
874
 
-
 
875
    my $savedPrintData = $self->{PRINTDATA};
-
 
876
    $self->{PRINTDATA} = $opt->{'printdata'} if ( exists $opt->{'printdata'} );
-
 
877
 
841
    #
878
    #
842
    #   All commands are non-interactive, prepend argument
879
    #   All commands are non-interactive, prepend argument
843
    #   Accept serve certs. Only applies to https connections. VisualSvn
880
    #   Accept serve certs. Only applies to https connections. VisualSvn
844
    #   perfers https and it uses self-signed certificates.
881
    #   perfers https and it uses self-signed certificates.
845
    #
882
    #
Line 859... Line 896...
859
    #
896
    #
860
    #   Reset command output data
897
    #   Reset command output data
861
    #
898
    #
862
    $self->{ERROR_LIST} = [];
899
    $self->{ERROR_LIST} = [];
863
    $self->{RESULT_LIST} = [];
900
    $self->{RESULT_LIST} = [];
-
 
901
#    $self->{LAST_CMD} = \@_;
864
 
902
 
865
    #
903
    #
866
    #   Make use of a wrapper program to mux the STDERR and STDOUT into
904
    #   Make use of a wrapper program to mux the STDERR and STDOUT into
867
    #   one stream (STDOUT). #   This solves a lot of problems
905
    #   one stream (STDOUT). #   This solves a lot of problems
868
    #
906
    #
Line 968... Line 1006...
968
    #
1006
    #
969
    Debug ("Useless Exit Status: $rv");
1007
    Debug ("Useless Exit Status: $rv");
970
    my $result = @{$self->{ERROR_LIST}} ? 1 : 0;
1008
    my $result = @{$self->{ERROR_LIST}} ? 1 : 0;
971
    Verbose3 ("Exit Code: $result");
1009
    Verbose3 ("Exit Code: $result");
972
 
1010
 
-
 
1011
    $self->{PRINTDATA} = $savedPrintData;
973
    return $result;
1012
    return $result;
974
}
1013
}
975
 
1014
 
976
 
1015
 
977
#-------------------------------------------------------------------------------
1016
#-------------------------------------------------------------------------------
Line 990... Line 1029...
990
#
1029
#
991
sub SvnUserCmd
1030
sub SvnUserCmd
992
{
1031
{
993
    #
1032
    #
994
    #   Extract arguments and options
1033
    #   Extract arguments and options
995
    #   If last argument is a hesh, then its a hash of options
1034
    #   If last argument is a hash, then its a hash of options
996
    #
1035
    #
997
    my $opt;
1036
    my $opt;
998
    $opt = pop @_
1037
    $opt = pop @_
999
        if (@_ > 0 and UNIVERSAL::isa($_[-1],'HASH'));
1038
        if (@_ > 0 and UNIVERSAL::isa($_[-1],'HASH'));
1000
 
1039