Alien-SVN
view release on metacpan or search on metacpan
src/subversion/subversion/bindings/swig/perl/native/Client.pm view on Meta::CPAN
Else get the properties as of $revision.
If $recursive is false, or $target is a file, the returned array will only
contain a single element. Otherwise, it will contain one entry for each
versioned entry below (and including) $target.
If $target is not found, raises the $SVN::Error::ENTRY_NOT_FOUND error.
=item $client-E<gt>propset($propname, $propval, $target, $recursive, $pool);
Set $propname to $propval on $target (a working copy or URL path).
If $recursive is true, then $propname will be set recursively on $target
and all children. If $recursive is false, and $target is a directory,
$propname will be set on B<only> $target.
A $propval of undef will delete the property.
If $propname is an svn-controlled property (i.e. prefixed with svn:),
then the caller is responsible for ensuring that $propval is UTF8-encoded
and uses LF line-endings.
=item $client-E<gt>relocate($dir, $from, $to, $recursive, $pool);
Modify a working copy directory $dir, changing any repository URLs that
begin with $from to begin with $to instead, recursing into subdirectories if
$recursive is true.
Has no return.
=item $client-E<gt>resolved($path, $recursive, $pool);
Removed the 'conflicted' state on a working copy path.
This will not semantically resolve conflicts; it just allows $path to be
committed in the future. The implementation details are opaque. If
$recursive is set, recurse below $path, looking for conflicts to
resolve.
If $path is not in a state of conflict to begin with, do nothing.
If $path's conflict state is removed, call the notify callback with the
$path.
=item $client-E<gt>revert($paths, $recursive, $pool);
Restore the pristine version of a working copy $paths, effectively undoing
any local mods.
For each path in $paths, if it is a directory and $recursive
is true, this will be a recursive operation.
=item $client-E<gt>revprop_get($propname, $url, $revision, $pool);
Returns two values, the first of which is the value of $propname on revision
$revision in the repository represented by $url. The second value is the
actual revision queried.
Note that unlike its cousin $client-E<gt>propget(), this routine doesn't affect
working copy at all; it's a pure network operation that queries an
B<unversioned> property attached to a revision. This can be used to query
log messages, dates, authors, and the like.
=item $client-E<gt>revprop_list($url, $revision, $pool);
Returns two values, the first of which is a reference to a hash containing
the properties attached to $revision in the repository represented by $url.
The second value is the actual revision queried.
Note that unlike its cousin $client-E<gt>proplist(), this routine doesn't read a
working copy at all; it's a pure network operation that reads B<unversioned>
properties attached to a revision.
=item $client-E<gt>revprop_set($propname, $propval, $url, $revision, $force, $pool);
Set $propname to $propval on revision $revision in the repository represented
by $url.
Returns the actual revision affected. A $propval of undef will delete the
property.
If $force is true, allow newlines in the author property.
If $propname is an svn-controlled property (i.e. prefixed with svn:), then
the caller is responsible for ensuring that the value is UTF8-encoded and
uses LF line-endings.
Note that unlike its cousin $client-E<gt>propset(), this routine doesn't affect
the working copy at all; it's a pure network operation that changes an
B<unversioned> property attached to a revision. This can be used to tweak
log messages, dates, authors, and the like. Be careful: it's a lossy
operation, meaning that any existing value is replaced with the new value,
with no way to retrieve the prior value.
Also note that unless the administrator creates a pre-revprop-change hook
in the repository, this feature will fail.
=item $client-E<gt>status($path, $revision, \&status_func, $recursive, $get_all, $update, $no_ignore, $pool);
Similar to $client-E<gt>status2(), but with ignore_externals always set to FALSE, and with the status_func receiving a svn_wc_status2_t instead of a svn_wc_status_t object.
=item $client-E<gt>status2($path, $revision, \&status_func, $recursive, $get_all, $update, $no_ignore, $ignore_externals, $pool);
Similar to $client-E<gt>status3(), but with the changelists passed as undef, and with recursive instead of depth.
=item $client-E<gt>status3($path, $revision, \&status_func, $depth, $get_all, $update, $no_ignore, $ignore_externals, $changelists, $pool);
Similar to $client-E<gt>status4(), without the pool parameter to the callback and the return of the callback is ignored.
=item $client-E<gt>status4($path, $revision, \&status_func, $depth, $get_all, $update, $no_ignore, $ignore_externals, $changelists, $pool);
Given $path to a working copy directory (or single file), call status_func()
with a set of svn_wc_status2_t objects which describe the status of $path and
its children.
If $recursive is true, recurse fully, else do only immediate children.
If $get_all is set, retrieve all entries; otherwise, retrieve only 'interesting'
entries (local mods and/or out-of-date).
If $update is set, contact the repository and augment the status objects with
information about out-of-dateness (with respect to $revision). Also, will
return the value of the actual revision against with the working copy was
compared. (The return will be undef if $update is not set).
Unless ignore_externals is set, the function recurses into externals definitions
('svn:externals') after handling the main target, if any exist. The function
calls the notify callback with $SVN::Wc::Notify::Action::status_external action
before handling each externals definition, and with
$SVN::Wc::Notify::Action::status_completed after each.
$changelists is a reference to an array of changelist names, used as a restrictive filter on items whose statuses are reported; that is don't report status about any item unless it's a member of those changelists. If changelists is empty (or altoget...
The status_func subroutine takes the following parameters:
$path, $status, $pool
$path is the pathname of the file or directory which status is being
reported. $status is a svn_wc_status2_t object. $pool is an apr_pool_t
object which is cleaned beteween invocations to the callback.
The return of the status_func subroutine can be a svn_error_t object created by
SVN::Error::create in order to propogate an error up.
=item $client-E<gt>switch($path, $url, $revision, $recursive, $pool);
Switch working tree $path to $url at $revision.
$revision must be a number, 'HEAD', or a date, otherwise it raises the
$SVN::Error::CLIENT_BAD_REVISION error.
src/subversion/subversion/bindings/swig/perl/native/Client.pm view on Meta::CPAN
} 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
return the new value of the attribute or no parameters which returns the
current value.
=over 4
=item $client-E<gt>auth(SVN::Client::get_username_provider());
Provides access to the auth_baton in the svn_client_ctx_t attached to the
SVN::Client object.
This method will accept an array or array ref of values returned from the
authentication provider functions see L</"AUTHENTICATION PROVIDERS">, which
it will convert to an auth_baton for you. This is the preferred method of
setting the auth_baton.
It will also accept a scalar that references a _p_svn_auth_baton_t such as
those returned from SVN::Core::auth_open and SVN::Core::auth_open_helper.
=cut
sub auth
{
my $self = shift;
my $args;
if (scalar(@_) == 0)
{
return $self->{'ctx'}->auth_baton();
} elsif (scalar(@_) > 1) {
$args = \@_;
} else {
$args = shift;
if (ref($args) eq '_p_svn_auth_baton_t')
{
# 1 arg as an auth_baton so just set
# the baton.
$self->{'ctx'}->auth_baton($args);
return $self->{'ctx'}->auth_baton();
}
}
my ($auth_baton,$callbacks) = SVN::Core::auth_open_helper($args);
$self->{'auth_provider_callbacks'} = $callbacks;
$self->{'ctx'}->auth_baton($auth_baton);
return $self->{'ctx'}->auth_baton();
}
=item $client-E<gt>notify(\¬ify);
Sets the notify 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 reference will be called when a change
is made to the working copy. The return value of this function is ignored.
It's only purpose is to notify you of the change.
The subroutine will receive 6 parameters. The first parameter will be the path
of the changed file (absolute or relative to the cwd). The second is an
integer specifying the type of action taken. See L<SVN::Wc> for a list of the
possible actions values and what they mean. The 3rd is an integer specifying
the kind of node the path is, which can be: $SVN::Node::none, $SVN::Node::file,
$SVN::Node::dir, $SVN::Node::unknown. The fourth parameter is the mime-type of
the file or undef if the mime-type is unknown (it will always be undef for
directories). The 5th parameter is the state of the file, again see L<SVN::Wc>
for a list of the possible states. The 6th and final parameter is the numeric
revision number of the changed file. The revision number will be -1 except
when the action is $SVN::Wc::Notify::Action::update_completed.
=cut
( run in 1.597 second using v1.01-cache-2.11-cpan-5b529ec07f3 )