#! /usr/intel/pkgs/perl/5.12.2/bin/perl
use strict;
use warnings;
package Sub;
use SVN::Client;
our @ISA = ('SVN::Client');
sub ls {
my $self = shift;
print "Sub ls function called with arguments:\n".join("\n", @_)."\n";
$self->SUPER::ls(@_);
}
package main;
use Data::Dumper;
my $obj = Sub->new(
auth => [
SVN::Client::get_simple_provider(),
SVN::Client::get_ssl_server_trust_file_provider(),
SVN::Client::get_simple_prompt_provider( sub {&_set_credentials(@_)}, 2 )
]
);
my @args = (
'https://svn.repo.url',
'HEAD',
1
);
print "Calling main ls with arguments:\n".join("\n", @args)."\n\n";
my $ref = $obj->ls(@args);
print STDERR Dumper($ref);
#############################################################################
sub _set_credentials {
my $cred = shift;
$cred->username( 'username' );
$cred->password( 'password' );
}
####
plxc16479> $h2/scripts/super_test.pl
Calling main ls with arguments:
https://svn.repo.url
HEAD
1
Sub ls function called with arguments:
https://svn.repo.url
HEAD
1
TypeError in method 'svn_client_ls', argument 2 of type 'char const *'
####
plxc16479> $h2/scripts/super_test.pl
Calling main ls with arguments:
https://svn.repo.url
HEAD
1
$VAR1 = {
'revision' => bless( do{\(my $o = 10904232)}, '_p_svn_dirent_t' ),
'all.plist' => bless( do{\(my $o = 10904112)}, '_p_svn_dirent_t' )
};
####
sub ls {
my $self = shift;
print "Sub ls function called with arguments:\n".join("\n", @_)."\n";
bless $self, 'SVN::Client';
$self->SUPER::ls(@_);
}