Alien-SVN
view release on metacpan or search on metacpan
src/subversion/subversion/bindings/swig/perl/native/Client.pm view on Meta::CPAN
If $depth_is_sticky is set and $depth is not $SVN::Depth::unknown, then in
addition to update paths, also set their sticky ambient depth value to $depth.
If $allow_unver_obstructions is TRUE then the update tolerates existing
unversioned items that obstruct added paths. Only obstructions of the same
type (file or dir) as the added item are tolerated. The text of obstructing
files is left as-is, effectively treating it as a user modification after the
update. Working properties of obstructing items are set equal to the base
properties. If $allow_unver_obstructions is FALSE then the update will abort
if there are any unversioned obstructing items.
If $adds_as_modification is TRUE, a local addition at the same path as an
incoming addition of the same node kind results in a normal node with a
possible local modification, instead of a tree conflict.
If $make_parents is TRUE, create any non-existent parent directories also by
checking them out at depth=empty.
Calls the notify callback for each item handled by the update, and
also for files restored from the text-base.
Returns an array reference to an array of revision numbers with each element
set to the revision to which $revision was resolved for the corresponding
element of $paths.
=item $client-E<gt>url_from_path($target, $pool); or SVN::Client::url_from_path($target, $pool);
Returns the URL for $target.
If $target is already a URL it returns $target.
If $target is a versioned item, it returns $target's entry URL.
If $target is unversioned (has no entry), returns undef.
=item $client-E<gt>uuid_from_path($path, $adm_access, $pool);
Return the repository uuid for working-copy $path, allocated in $pool.
Use $adm_access to retrieve the uuid from $path's entry; if not present in the
entry, then call $client-E<gt>uuid_from_url() to retrieve, using the entry's URL.
Note: The only reason this function falls back on $client-E<gt>uuid_from_url is for
compatibility purposes. Old working copies may not have uuids in the entries
files.
Note: This method probably doesn't work right now without a lot of pain,
because SVN::Wc is incomplete and it requires an adm_access object from it.
=item $client-E<gt>uuid_from_url($url, $pool);
Return repository uuid for url.
=back
=cut
# import methods into our name space and wrap them in a closure
# to support method calling style $client->log()
foreach my $function (@_all_fns)
{
no strict 'refs';
my $real_function = \&{"SVN::_Client::svn_client_$function"};
*{"SVN::Client::$function"} = sub
{
my ($self, $ctx);
my @args;
# Don't shift the first param if it isn't a SVN::Client
# object. This lets the old style interface still work.
# And is useful for functions like url_from_path which
# don't take a ctx param, but might be called in method
# invocation style or as a normal function.
for (my $index = $[; $index <= $#_; $index++)
{
if (ref($_[$index]) eq 'SVN::Client')
{
($self) = splice(@_,$index,1);
$ctx = $self->{'ctx'};
last;
} elsif (ref($_[$index]) eq '_p_svn_client_ctx_t') {
$self = undef;
($ctx) = splice(@_,$index,1);
last;
}
}
if (!defined($ctx))
{
# Allows import to work while not breaking use SVN::Client.
if ($function eq 'import')
{
return;
}
}
if (ref($_[$#_]) eq '_p_apr_pool_t' ||
ref($_[$#_]) eq 'SVN::Pool')
{
# if we got a pool passed to us we need to
# leave it off until we add the ctx first
# so we push only the first arg to the next
# to last arg.
push @args, @_[$[ .. ($#_ - 1)];
unless ($function =~ /^(?:propset|url_from_path)$/)
{
# propset and url_from_path don't take a ctx argument
push @args, $ctx;
}
push @args, $_[$#_];
} else {
push @args, @_;
unless ($function =~ /^(?:propset|url_from_path)$/)
{
push @args,$ctx;
}
if (defined($self->{'pool'}) &&
(ref($self->{'pool'}) eq '_p_apr_pool_t' ||
ref($self->{'pool'}) eq 'SVN::Pool'))
{
# allow the pool entry in the SVN::Client
# object to override the default pool.
push @args, $self->{'pool'};
}
}
return $real_function->(@args);
}
}
=head1 ATTRIBUTE METHODS
The following attribute methods are provided that allow you to set various
configuration or retrieve it. They all take value(s) to set the attribute and
src/subversion/subversion/bindings/swig/perl/native/Client.pm view on Meta::CPAN
return ${$self->{'cancel_callback'}};
}
=item $client-E<gt>pool(new SVN::Pool);
Method that sets or gets the default pool that is passed to method calls
requiring a pool, but which were not explicitly passed one.
See L<SVN::Core> for more information about how pools are managed
in this interface.
=cut
sub pool
{
my $self = shift;
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
( run in 2.169 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )