Alien-SVN
view release on metacpan or search on metacpan
src/subversion/subversion/bindings/swig/perl/native/Client.pm view on Meta::CPAN
A boolean parameter that specifies if the action should follow directories. It
should only be 1 or 0. $recursive means, 1 means to descend into directories,
0 means not to. $nonrecursive has the inverse meaning.
=item $pool
Pool is always an option parameter. If you wish to pass a pool parameter it
should be a SVN::Pool or an apr_pool_t object.
=back
=head1 METHODS
The following methods are available:
=over 4
=item $client = SVN::Client-E<gt>new( %options );
This class method constructs a new C<SVN::Client> object and returns
a reference to it.
Key/value pair arguments may be provided to set up the initial state
of the user agent. The following methods correspond to attribute
methods described below:
KEY DEFAULT
---------- ----------------------------------------
auth auth_baton initiated with providers that
read cached authentication options from
the subversion config only.
cancel undef
config Hash containing the config from the
default subversion config file location.
log_msg undef
notify undef
pool A new pool is created for the context.
=cut
sub new
{
my $class = shift;
my $self = bless {}, $class;
my %args = @_;
$self->{'ctx'} = SVN::_Client::svn_client_create_context();
if (defined($args{'auth'}))
{
$self->auth($args{'auth'});
} else {
$self->auth([SVN::Client::get_username_provider(),
SVN::Client::get_simple_provider(),
SVN::Client::get_ssl_server_trust_file_provider(),
SVN::Client::get_ssl_client_cert_file_provider(),
SVN::Client::get_ssl_client_cert_pw_file_provider(),
]);
}
{
my $pool_type = ref($args{'pool'});
if ($pool_type eq 'SVN::Pool' ||
$pool_type eq '_p_apr_pool_t')
{
$self->{'pool'} = $args{'pool'};
} else {
$self->{'pool'} = new SVN::Pool();
}
}
# If we're passed a config use it, otherwise get the default
# config.
if (defined($args{'config'}))
{
if (ref($args{'config'}) eq 'HASH')
{
$self->config($args{'config'});
}
} else {
$self->config(SVN::Core::config_get_config(undef));
}
if (defined($args{'notify'}))
{
$self->notify($args{'notify'});
}
if (defined($args{'log_msg'}))
{
$self->log_msg($args{'log_msg'});
}
if (defined($args{'cancel'}))
{
$self->cancel($args{'cancel'});
}
return $self;
}
=item $client-E<gt>add($path, $recursive, $pool);
Similar to $client-E<gt>add2(), but with $force always set to FALSE.
=item $client-E<gt>add2($path, $recursive, $force, $pool);
Similar to $client-E<gt>add3(), but with $no_ignore always set to FALSE.
=item $client-E<gt>add3($path, $recursive, $force, $no_ignore, $pool);
Similar to $client-E<gt>add4(), but with $add_parents always set to FALSE and
$depth set according to $recursive; if TRUE, then depth is
$SVN::Depth::infinity, if FALSE, then $SVN::Depth::empty.
=item $client-E<gt>add4($path, $depth, $force, $no_ignore, $add_parents, $pool);
src/subversion/subversion/bindings/swig/perl/native/Client.pm view on Meta::CPAN
if (scalar(@_) == 0)
{
$self->{'pool'};
} else {
return $self->{'pool'} = shift;
}
}
=item $client-E<gt>config(SVN::Core::config_get_config(undef));
Method that allows access to the config member of the svn_client_ctx_t.
Accepts a Perl hash to set, which is what functions like
SVN::Core:config_get_config() will return.
It will return a _p_arp_hash_t scalar. This is a temporary
situation. The return value is not particular useful. In
the future, this value will be tied to the actual hash used
by the C API.
=back
=cut
sub config
{
my $self = shift;
if (scalar(@_) == 0) {
return $self->{'ctx'}->config();
} else {
$self->{'ctx'}->config(shift);
return $self->{'ctx'}->config();
}
}
=head1 AUTHENTICATION PROVIDERS
The following functions get authentication providers for you.
They come in two forms. Standard or File versions, which look
for authentication information in the subversion configuration
directory that was previously cached, or Prompt versions which
call a subroutine to allow you to prompt the user for the
information.
The functions that return the svn_auth_provider_object_t for prompt style
providers take a reference to a Perl subroutine to use for the callback. The
first parameter each of these subroutines receive is a credential object. The
subroutines return the response by setting members of that object. Members may
be set like so: $cred-E<gt>username("breser"); These functions and credential
objects always have a may_save member which specifies if the authentication
data will be cached.
The providers are as follows:
NAME WHAT IT HANDLES
---------------- ----------------------------------------
simple username and password pairs
username username only
ssl_server_trust server certificates and failures
authenticating them
ssl_client_cert client side certificate files
ssl_client_cert_pw password for a client side certificate file.
=over 4
=item SVN::Client::get_simple_provider
Returns a simple provider that returns information from previously cached
sessions. Takes no parameters or one pool parameter.
=item SVN::Client::get_simple_prompt_provider
Returns a simple provider that prompts the user via a callback. Takes two or
three parameters, the first is the callback subroutine, the 2nd is the number
of retries to allow, the 3rd is optionally a pool. The subroutine gets called
with the following parameters: a svn_auth_cred_simple_t object, a realm string,
a default username, may_save, and a pool. The svn_auth_cred_simple has the
following members: username, password, and may_save.
=item SVN::Client::get_username_provider
Returns a username provider that returns information from a previously cached
sessions. Takes no parameters or one pool parameter.
=item SVN::Client::get_username_prompt_provider
Returns a username provider that prompts the user via a callback. Takes two or
three parameters, the first is the callback subroutine, the 2nd is the number
of retries to allow, the 3rd is optionally a pool. The subroutine gets called
with the following parameters: a svn_auth_cred_username_t object, a realm
string, a default username, may_save, and a pool. The svn_auth_cred_username
has the following members: username and may_save.
=item SVN::Client::get_ssl_server_trust_file_provider
Returns a server trust provider that returns information from previously
cached sessions. Takes no parameters or optionally a pool parameter.
=item SVN::Client::get_ssl_server_trust_prompt_provider
Returns a server trust provider that prompts the user via a callback. Takes
one or two parameters the callback subroutine and optionally a pool parameter.
The subroutine gets called with the following parameters. A
svn_auth_cred_ssl_server_trust_t object, a realm string, an integer specifying
how the certificate failed authentication, a svn_auth_ssl_server_cert_info_t
object, may_save, and a pool. The svn_auth_cred_ssl_server_trust_t object has
the following members: may_save and accepted_failures. The
svn_auth_ssl_server_cert_info_t object has the following members (and behaves
just like cred objects though you can't modify it): hostname, fingerprint,
valid_from, valid_until, issuer_dname, ascii_cert.
The masks used for determining the failures are in SVN::Auth::SSL and are named:
$SVN::Auth::SSL::NOTYETVALID
$SVN::Auth::SSL::EXPIRED
$SVN::Auth::SSL::CNMISMATCH
$SVN::Auth::SSL::UNKNOWNCA
$SVN::Auth::SSL::OTHER
You reply by setting the accepted_failures of the cred object with an integer
of the values for what you want to accept bitwise AND'd together.
=item SVN::Client::get_ssl_client_cert_file_provider
Returns a client certificate provider that returns information from previously
cached sessions. Takes no parameters or optionally a pool parameter.
=item SVN::Client::get_ssl_client_cert_prompt_provider
Returns a client certificate provider that prompts the user via a callback.
Takes two or three parameters: the first is the callback subroutine, the 2nd is
the number of retries to allow, the 3rd is optionally a pool parameter. The
subroutine gets called with the following parameters. A
svn_auth_cred_ssl_client_cert object, a realm string, may_save, and a pool.
The svn_auth_cred_ssl_client_cert the following members: cert_file and
may_save.
=item SVN::Client::get_ssl_client_cert_pw_file_provider
Returns a client certificate password provider that returns information from
previously cached sessions. Takes no parameters or optionally a pool
parameter.
=item SVN::Client::get_ssl_client_cert_pw_prompt_provider
Returns a client certificate password provider that prompts the user via a
callback. Takes two or three parameters, the first is the callback subroutine,
the 2nd is the number of retries to allow, the 3rd is optionally a pool
parameter. The subroutine gets called with the following parameters. A
svn_auth_cred_ssl_client_cert_pw object, a realm string, may_save, and a pool.
The svn_auth_cred_ssl_client_cert_pw has the following members: password and
may_save.
=back
=head1 OBJECTS
These are some of the object types that are returned from the methods
and functions. Others are documented in L<SVN::Core> and L<SVN::Wc>.
If an object is not documented, it is more than likely opaque and
not something you can do anything with, except pass to other functions
that require such objects.
=cut
package _p_svn_info_t;
use SVN::Base qw(Client svn_info_t_);
=head2 svn_info_t
=over 8
=item $info-E<gt>URL()
Where the item lives in the repository.
=item $info-E<gt>rev()
The revision of the object. If path_or_url is a working-copy
path, then this is its current working revnum. If path_or_url
is a URL, then this is the repos revision that path_or_url lives in.
=item $info-E<gt>kind()
The node's kind.
=item $info-E<gt>repos_root_URL()
The root URL of the repository.
=item $info-E<gt>repos_UUID()
The repository's UUID.
=item $info-E<gt>last_changed_rev()
The last revision in which this object changed.
=item $info-E<gt>last_changed_date()
The date of the last_changed_rev.
=item $info-E<gt>last_changed_author()
The author of the last_changed_rev.
=item $info-E<gt>lock()
An exclusive lock, if present. Could be either local or remote.
=back
( run in 0.621 second using v1.01-cache-2.11-cpan-acf6aa7dc9e )