Alien-SVN
view release on metacpan or search on metacpan
src/subversion/subversion/bindings/swig/perl/native/Client.pm view on Meta::CPAN
} 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);
Schedule a working copy $path for addition to the repository.
If $depth is $SVN::Depth::empty, add just $path and nothing below it. If
$SVN::Depth::files, add $path and any file children of $path. If
$SVN::Depth::immediates, add $path, any file children, and any immediate
subdirectories (but nothing underneath those subdirectories). If
$SVN::Depth::infinity, add $path and everything under it fully recursively.
$path's parent must be under revision control already (unless $add_parents is
TRUE), but $path is not.
Unless $force is TRUE and $path is already under version control, returns an
$SVN::Error::ENTRY_EXISTS object. If $force is set, do not error on
already-versioned items. When used with $depth set to $SVN::Depth::infinity
it will enter versioned directories; scheduling unversioned children.
Calls the notify callback for each added item.
If $no_ignore is FALSE, don't add any file or directory (or recurse into any
directory) that is unversioned and found by recursion (as opposed to being the
explicit target $path) and whose name matches the svn:ignore property on its
parent directory or the global-ignores list in $client->config. If $no_ignore is
TRUE, do include such files and directories. (Note that an svn:ignore property
can influence this behaviour only when recursing into an already versioned
directory with $force).
If $add_parents is TRUE, recurse up $path's directory and look for a versioned
directory. If found, add all intermediate paths between it and $path. If not
found return $SVN::Error::NO_VERSIONED_PARENT.
Important: this is a B<scheduling> operation. No changes will happen
to the repository until a commit occurs. This scheduling can be
removed with $client-E<gt>revert().
No return.
=item $client-E<gt>blame($target, $start, $end, \&receiver, $pool);
Invoke \&receiver subroutine on each line-blame item associated with revision
$end of $target, using $start as the default source of all blame.
An Error will be raised if either $start or $end is undef.
No return.
The blame receiver subroutine receives the following arguments:
$line_no, $revision, $author, $date, $line, $pool
$line_no is the line number of the file (starting with 0).
The line was last changed in revision number $revision
by $author on $date and the contents were $line.
The blame receiver subroutine can return an svn_error_t object
to return an error. All other returns will be ignored.
You can create an svn_error_t object with SVN::Error::create().
=item $client-E<gt>cat(\*FILEHANDLE, $target, $revision, $pool);
Outputs the content of the file identified by $target and $revision to the
FILEHANDLE. FILEHANDLE is a reference to a filehandle.
If $target is not a local path and if $revision is 'PREV' (or some
other kind that requires a local path), then an error will be raised,
because the desired revision can not be determined.
=item $client-E<gt>checkout($url, $path, $revision, $recursive, $pool);
Similar to $client-E<gt>checkout2(), but with $peg_revision always set to undef (unspecified) and $ignore_externals always set to FALSE.
=item $client-E<gt>checkout2($url, $path, $peg_revision, $revision, $recursive, $ignore_externals, $pool);
Similar to $client-E<gt>checkout3(), but with $allow_unver_obstructions always set
to FALSE, and $depth set according to $recurse: if $recurse is TRUE, $depth is
$SVN::Depth::infinity, if $recurse is FALSE, set $depth to $SVN::Depth::files.
=item $client-E<gt>checkout3($url, $path, $preg_revision, $revision, $depth, $ignore_externals, $allow_unver_obstructions, $pool);
Checkout a working copy of $url at $revision using $path as the root directory
of the newly checked out working copy.
The $peg_revision sets the revision at which the path in the $url is treated as representing.
$revision must be a number, 'HEAD', or a date. If $revision does not
meet these requirements the $SVN::Error::CLIENT_BAD_REVISION is raised.
$depth is one of the constants in SVN::Depth and specifies the depth of the
operation. If set to $SVN::Depth::unknown, then behave as if for
src/subversion/subversion/bindings/swig/perl/native/Client.pm view on Meta::CPAN
Recursively cleanup a working copy directory, $dir, finishing any incomplete
operations, removing lockfiles, etc.
=item $client-E<gt>commit($targets, $nonrecursive, $pool);
Commit files or directories referenced by target. Will use the log_msg
callback to obtain the log message for the commit.
If $targets contains no paths (zero elements), then does nothing and
immediately returns without error.
Calls the notify callback as the commit progresses with any of the following
actions: $SVN::Wc::Notify::Action::commit_modified,
$SVN::Wc::Notify::Action::commit_added,
$SVN::Wc::Notify::Action::commit_deleted,
$SVN::Wc::Notify::Action::commit_replaced,
$SVN::Wc::Notify::Action::commit_postfix_txdelta.
Use $nonrecursive to indicate that subdirectories of directory targets
should be ignored.
Returns a svn_client_commit_info_t object. If the revision member of the
commit information object is $SVN::Core::INVALID_REVNUM and no error was
raised, then the commit was a no-op; nothing needed to be committed.
=item $client-E<gt>copy($src_target, $src_revision, $dst_target, $pool);
Copies $src_target to $dst_target.
$src_target must be a file or directory under version control, or the URL
of a versioned item in the repository. If $src_target is a URL,
$src_revision is used to choose the revision from which to copy the
$src_target. $dst_path must be a file or directory under version control,
or a repository URL, existing or not.
If $dst_target is a URL, immediately attempt to commit the copy action
to the repository. The log_msg callback will be called to query for a commit
log message. If the commit succeeds, return a svn_client_commit_info_t
object.
If $dst_target is not a URL, then this is just a variant of $client-E<gt>add(),
where the $dst_path items are scheduled for addition as copies. No changes
will happen to the repository until a commit occurs. This scheduling can be
removed with $client-E<gt>revert(). undef will be returned in this case.
Calls the notify callback for each item added at the new location, passing
the new, relative path of the added item.
=item $client-E<gt>delete($targets, $force, $pool);
Delete items from a repository or working copy.
If the paths in $targets are URLs, immediately attempt to commit a deletion
of the URLs from the repository. The log_msg callback will be called to
query for a commit log message. If the commit succeeds, return a
svn_client_commit_info_t object. Every path must belong to the same
repository.
Else, schedule the working copy paths in $targets for removal from the
repository. Each path's parent must be under revision control. This is
just a B<scheduling> operation. No changes will happen to the repository
until a commit occurs. This scheduling can be removed with $client-E<gt>revert().
If a path is a file it is immediately removed from the working copy. If
the path is a directory it will remain in the working copy but all the files,
and all unversioned items it contains will be removed. If $force is not set
then this operation will fail if any path contains locally modified and/or
unversioned items. If $force is set such items will be deleted.
The notify callback is called for each item deleted with the path of
the deleted item.
Has no return.
=item $client-E<gt>diff($diff_options, $target1, $revision1, $target2, $revision2, $recursive, $ignore_ancestry, $no_diff_deleted, $outfile, $errfile, $pool);
Produces diff output which describes the delta between $target1 at
$revision1 and $target2 at $revision2. They both must represent the same
node type (i.e. they most both be directories or files). The revisions
must not be undef.
Prints the output of the diff to the filename or filehandle passed as
$outfile, and any errors to the filename or filehandle passed as $errfile.
Use $ignore_ancestry to control whether or not items being diffed will be
checked for relatedness first. Unrelated items are typically transmitted to
the editor as a deletion of one thing and the addition of another, but if this
flag is true, unrelated items will be diffed as if they were related.
If $no_diff_deleted is true, then no diff output will be generated on deleted
files.
$diff_options is a reference to an array of additional arguments to pass to
diff process invoked to compare files. You'll usually just want to use [] to
pass an empty array to return a unified context diff (like `diff -u`).
Has no return.
=item $client-E<gt>diff_summarize($target1, $revision1, $target2, $revision2, $recursive, $ignore_ancestry, \&summarize_func, $pool);
Produce a diff summary which lists the changed items between $target1
at $revision1 and $target2 at $revision2 without creating text deltas.
$target1 and $target2 can be either working-copy paths or URLs.
The function may report false positives if $ignore_ancestry is false,
since a file might have been modified between two revisions, but still
have the same contents.
Calls \&summarize_func with with a svn_client_diff_summarize_t structure
describing the difference.
See diff() for a description of the other parameters.
Has no return.
=item $client-E<gt>export($from, $to, $revision, $force, $pool);
Export the contents of either a subversion repository or a subversion
working copy into a 'clean' directory (meaning a directory with no
administrative directories).
$from is either the path to the working copy on disk, or a URL
to the repository you wish to export.
$to is the path to the directory where you wish to create the exported
tree.
$revision is the revision that should be exported, which is only used
when exporting from a repository. It may be undef otherwise.
The notify callback will be called for the items exported.
Returns the value of the revision actually exported or
$SVN::Core::INVALID_REVNUM for local exports.
=item $client-E<gt>import($path, $url, $nonrecursive, $pool);
Import file or directory $path into repository directory $url at head.
If some components of $url do not exist then create parent directories
as necessary.
If $path is a directory, the contents of that directory are imported
directly into the directory identified by $url. Note that the directory
$path itself is not imported; that is, the basename of $path is not part
of the import.
If $path is a file, then the dirname of $url is the directory receiving the
import. The basename of $url is the filename in the repository. In this case
if $url already exists, raise an error.
The notify callback (if defined) will be called as the import progresses, with
any of the following actions: $SVN::Wc::Notify::Action::commit_added,
$SVN::Wc::Notify::Action::commit_postfix_txdelta.
Use $nonrecursive to indicate that imported directories should not recurse
into any subdirectories they may have.
Uses the log_msg callback to determine the log message for the commit when
one is needed.
Returns a svn_client_commit_info_t object.
=item $client-E<gt>info($path_or_url, $peg_revision, $revision, \&receiver, $recurse);
Invokes \&receiver passing it information about $path_or_url for $revision.
The information returned is system-generated metadata, not the sort of
"property" metadata created by users. For methods available on the object
passed to \&receiver, B<see svn_info_t>.
If both revision arguments are either svn_opt_revision_unspecified or NULL,
then information will be pulled solely from the working copy; no network
connections will be made.
Otherwise, information will be pulled from a repository. The actual node
revision selected is determined by the $path_or_url as it exists in
$peg_revision. If $peg_revision is undef, then it defaults to HEAD for URLs
or WORKING for WC targets.
If $path_or_url is not a local path, then if $revision is PREV (or some other
kind that requires a local path), an error will be returned, because the
desired revision cannot be determined.
Uses the authentication baton cached in ctx to authenticate against the
repository.
If $recurse is true (and $path_or_url is a directory) this will be a recursive
operation, invoking $receiver on each child.
my $receiver = sub {
my( $path, $info, $pool ) = @_;
print "Current revision of $path is ", $info->rev, "\n";
};
$client->info( 'foo/bar.c', undef, 'WORKING', $receiver, 0 );
=item $client-E<gt>log5($targets, $peg_revision, $revision_ranges, $limit, $discover_changed_paths, $strict_node_history, $include_merged_revisions, $revprops, \&log_entry_receiver, $pool);
Invoke C<log_entry_receiver> on each log message from
each revision range in C<$revision_ranges> in turn,
inclusive (but never invoke C<log_entry_receiver> on a given log message more
src/subversion/subversion/bindings/swig/perl/native/Client.pm view on Meta::CPAN
except there are no commits in the repository, hence this special case.
Deprecated.
=item $client-E<gt>ls($target, $revision, $recursive, $pool);
Returns a hash of svn_dirent_t objects for $target at $revision.
If $target is a directory, returns entries for all of the directories'
contents. If $recursive is true, it will recurse subdirectories in $target.
If $target is a file only return an entry for the file.
If $target is non-existent, raises the $SVN::Error::FS_NOT_FOUND
error.
=item $client-E<gt>merge($src1, $rev1, $src2, $rev2, $target_wcpath, $recursive, $ignore_ancestry, $force, $dry_run, $pool);
Merge changes from $src1/$rev1 to $src2/$rev2 into the working-copy path
$target_wcpath.
$src1 and $src2 are either URLs that refer to entries in the repository, or
paths to entries in the working copy.
By 'merging', we mean: apply file differences and schedule additions &
deletions when appropriate.
$src1 and $src2 must both represent the same node kind; that is, if $src1
is a directory, $src2 must also be, and if $src1 is a file, $src2 must also be.
If either $rev1 or $rev2 is undef raises the $SVN::Error::CLIENT_BAD_REVISION
error.
If $recursive is true (and the URLs are directories), apply changes recursively;
otherwise, only apply changes in the current directory.
Use $ignore_ancestry to control whether or not items being diffed will be
checked for relatedness first. Unrelated items are typically transmitted
to the editor as a deletion of one thing and the addition of another, but
if this flag is true, unrelated items will be diffed as if they were related.
If $force is not set and the merge involves deleting locally modified or
unversioned items the operation will raise an error. If $force is set such
items will be deleted.
Calls the notify callback once for each merged target, passing the targets
local path.
If $dry_run is true the merge is carried out, and the full notification
feedback is provided, but the working copy is not modified.
Has no return.
=item $client-E<gt>mkdir($targets, $pool);
Similar to $client-E<gt>mkdir2() except it returns an svn_client_commit_info_t
object instead of a svn_commit_info_t object.
=item $client-E<gt>mkdir2($targets, $pool);
Similar to $client-E<gt>mkdir3(), but with $make_parents always FALSE, and
$revprop_hash always undef.
=item $client-E<gt>mkdir3($targets, $make_parents, $revprop_hash, $pool);
Similar to $client-E<gt>mkdir4(), but returns a svn_commit_info_t object rather
than through a callback function.
=item $client-E<gt>mkdir4($targets, $make_parents, $revprop_hash, \&commit_callback, $pool);
Create a directory, either in a repository or a working copy.
If $targets contains URLs, immediately attempts to commit the creation of the
directories in $targets in the repository. Returns a svn_client_commit_info_t
object.
Else, create the directories on disk, and attempt to schedule them for addition.
In this case returns undef.
If $make_parents is TRUE, create any non-existant parent directories also.
If not undef, $revprop_hash is a reference to a hash table holding additional
custom revision properites (property names mapped to strings) to be set on the
new revision in the event that this is a committing operation. This hash
cannot contain any standard Subversion properties.
Calls the log message callback to query for a commit log message when one is
needed.
Calls the notify callback when the directory has been created (successfully)
in the working copy, with the path of the new directory. Note this is only
called for items added to the working copy.
If \&commit_callback is not undef, then for each successful commit, call
\&commit_callback with the svn_commit_info_t object for the commit.
=item $client-E<gt>move($src_path, $src_revision, $dst_path, $force, $pool);
Move $src_path to $dst_path.
$src_path must be a file or directory under version control, or the URL
of a versioned item in the repository.
If $src_path is a repository URL:
* $dst_path must also be a repository URL (existent or not).
* $src_revision is used to choose the revision from which to copy the
$src_path.
* The log_msg callback will be called for the commit log message.
* The move operation will be immediately committed. If the commit succeeds,
returns a svn_client_commit_info_t object.
If $src_path is a working copy path
* $dst_path must also be a working copy path (existent or not).
* $src_revision is ignored and may be undef. The log_msg callback will
not be called.
* This is a scheduling operation. No changes will happen to the repository
until a commit occurs. This scheduling can be removed with $client-E<gt>revert().
If $src_path is a file it is removed from the working copy immediately.
If $src_path is a directory it will remain in the working copy but all
files, and unversioned items, it contains will be removed.
* If $src_path contains locally modified and/or unversioned items and $force is
not set, the copy will raise an error. If $force is set such items will be
removed.
The notify callback will be called twice for each item moved, once to
indicate the deletion of the moved node, and once to indicate the addition
of the new location of the node.
=item $client-E<gt>propget($propname, $target, $revision, $recursive, $pool);
Returns a reference to a hash containing paths or URLs, prefixed by $target (a
working copy or URL), of items for which the property $propname is set, and
src/subversion/subversion/bindings/swig/perl/native/Client.pm view on Meta::CPAN
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.
Calls the notify callback on paths affected by the switch. Also invokes
the callback for files that may be restored from the text-base because they
were removed from the working copy.
Summary of purpose: This is normally used to switch a working directory
over to another line of development, such as a branch or a tag. Switching
an existing working directory is more efficient than checking out $url from
scratch.
Returns the value of the revision to which the working copy was actually
switched.
=item $client-E<gt>update($path, $revision, $recursive, $pool)
Similar to $client-E<gt>update2() except that it accepts only a single target in
$path, returns a single revision, and $ignore_externals is always set to FALSE.
=item $client-E<gt>update2($paths, $revision, $recursive, $ignore_externals, $pool)
Similar to $client-E<gt>update3() but with $allow_unver_obstructions always set to
FALSE, $depth_is_sticky to FALSE, and $depth set according to $recursive: if
$recursive is TRUE, set $depth to $SVN::Depth::infinity, if $recursive is
FALSE, set $depth to $SVN::Depth::files.
=item $client-E<gt>update3($paths, $revision, $depth, $depth_is_sticky, $ignore_externals, $allow_unver_obstructions, $pool)
Similar to $client-E<gt>update4() but with $make_parents always set to FALSE and
$adds_as_modification set to TRUE.
=item $client-E<gt>update4($paths, $revision, $depth, $depth_is_sticky, $ignore_externals, $allow_unver_obstructions, $adds_as_modification, $make_parents)
Update working trees $paths to $revision.
$paths is a array reference of paths to be updated. Unversioned paths that are
the direct children of a versioned path will cause an update that attempts to
add that path; other unversioned paths are skipped.
$revision must be a revision number, 'HEAD', or a date or this method will
raise the $SVN::Error::CLIENT_BAD_REVISION error.
The paths in $paths can be from multiple working copies from multiple
repositories, but even if they all come from the same repository there is no
guarantee that revision represented by 'HEAD' will remain the same as each path
is updated.
If $ignore_externals is set, don't process externals definitions as part of
this operation.
If $depth is $SVN::Depth::infinity, update fully recursivelly. Else if it is
$SVN::Depth::immediates or $SVN::Depth::files, update each target and its file
entries, but not its subdirectories. Else if $SVN::Depth::empty, update
exactly each target, nonrecursively (essentially, update the target's
properties).
If $depth is $SVN::Depth::unknown, take the working depth from $paths and then
describe as behaved above.
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++)
{
( run in 1.801 second using v1.01-cache-2.11-cpan-d7f47b0818f )