Alien-SVN
view release on metacpan or search on metacpan
src/subversion/subversion/bindings/swig/perl/native/Client.pm view on Meta::CPAN
my $self = shift;
if (scalar(@_) == 1) {
$self->{'notify_callback'} = $self->{'ctx'}->notify_baton(shift);
}
return ${$self->{'notify_callback'}};
}
=item $client-E<gt>log_msg(\&log_msg)
Sets the log_msg callback for the client context to a code reference that you
pass. It always returns the current codereference set.
The subroutine pointed to by this coderef will be called to get the log
message for any operation that will commit a revision to the repo.
It receives 4 parameters. The first parameter is a reference to a scalar
value in which the callback should place the log_msg. If you wish to cancel
the commit you can set this scalar to undef. The 2nd value is a path to any
temporary file which might be holding that log message, or undef if no such
file exists (though, if log_msg is undef, this value is undefined). The
log message B<MUST> be a UTF8 string with LF line separators. The 3rd parameter
is a reference to an array of svn_client_commit_item3_t objects, which may
be fully or only partially filled-in, depending on the type of commit
operation. The 4th and last parameter will be a pool.
If the function wishes to return an error it should return a svn_error_t
object made with SVN::Error::create. Any other return value will be
interpreted as SVN_NO_ERROR.
=cut
sub log_msg {
my $self = shift;
if (scalar(@_) == 1) {
$self->{'log_msg_callback'} = $self->{'ctx'}->log_msg_baton3(shift);
}
return ${$self->{'log_msg_callback'}};
}
=item $client-E<gt>cancel(\&cancel)
Sets the cancellation callback for the client context to a code reference that you
pass. It always returns the current codereference set.
The subroutine pointed to by this value will be called to see if the operation
should be canceled. If the operation should be canceled, the function may
return one of the following values:
An svn_error_t object made with SVN::Error::create.
Any true value, in which case the bindings will generate an svn_error_t object
for you with the error code of SVN_ERR_CANCELLED and the string set to "By
cancel callback".
A string, in which case the bindings will generate an svn_error_t object for you
with the error code of SVN_ERR_CANCELLED and the string set to the string you
returned.
Any other value will be interpreted as wanting to continue the operation.
Generally, it's best to return 0 to continue the operation.
=cut
sub cancel {
my $self = shift;
if (scalar(@_) == 1) {
$self->{'cancel_callback'} = $self->{'ctx'}->cancel_baton(shift);
}
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();
}
}
( run in 1.410 second using v1.01-cache-2.11-cpan-524268b4103 )