PKGBUILDs/extra/subversion/pkgnone/SVN::Ra.0

670 lines
30 KiB
Text

.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.ie \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.el \{\
. de IX
..
.\}
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "native::Ra 3"
.TH native::Ra 3 "2008-01-27" "perl v5.10.1" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
SVN::Ra \- Subversion remote access functions
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 2
\& use SVN::Core;
\& use SVN::Ra;
\&
\& my $ra = SVN::Ra\->new(\*(Aqfile:///tmp/svntest\*(Aq);
\& print $ra\->get_latest_revnum;
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
SVN::Ra wraps the object-oriented \f(CW\*(C`svn_ra_plugin_t\*(C'\fR functions,
providing access to a Subversion repository though a \s-1URL\s0, using
whichever repository access module is appropriate.
.SH "SVN::Ra"
.IX Header "SVN::Ra"
.SS "SVN::Ra\->new(...)"
.IX Subsection "SVN::Ra->new(...)"
The constructor creates an \s-1RA\s0 object and calls \f(CW\*(C`open\*(C'\fR for it. Its parameters
are either a hash of options or a single value containing the \s-1URL\s0 of the
repository. Valid options are:
.IP "url" 4
.IX Item "url"
The \s-1URL\s0 of the repository.
.IP "auth" 4
.IX Item "auth"
An \f(CW\*(C`auth_baton\*(C'\fR could be given to the \s-1SVN::RA\s0 object. Defaults to an
\&\f(CW\*(C`auth_provider\*(C'\fR with a \f(CW\*(C`username_provider\*(C'\fR. See SVN::Client for how to
create \f(CW\*(C`auth_baton\*(C'\fR.
.IP "pool" 4
.IX Item "pool"
The pool for the \s-1RA\s0 session to use. Member functions will also be
called with this pool. Defaults to a newly created root pool.
.IP "config" 4
.IX Item "config"
The config hash that could be obtained by calling
\&\f(CW\*(C`SVN::Core::config_get_config(undef)\*(C'\fR.
.IP "callback" 4
.IX Item "callback"
The \f(CW\*(C`ra_callback\*(C'\fR namespace to use. Defaults to SVN::Ra::Callbacks.
.PP
The following examples will both do the same thing, with all the optional
arguments taking their defaults:
.PP
.Vb 2
\& my $ra = SVN::Ra\->new(\*(Aqfile:///tmp/repos\*(Aq);
\& my $ra = SVN::Ra\->new(url => \*(Aqfile:///tmp/repos\*(Aq);
.Ve
.SS "\s-1METHODS\s0"
.IX Subsection "METHODS"
Please consult the svn_ra.h section in the Subversion \s-1API\s0. Member
functions of \f(CW\*(C`svn_ra_plugin_t\*(C'\fR can be called as methods of SVN::Ra
objects, with the \f(CW\*(C`session_baton\*(C'\fR and \f(CW\*(C`pool\*(C'\fR arguments omitted.
.ie n .IP "$ra\->change_rev_prop($revnum, $name, $value)" 4
.el .IP "\f(CW$ra\fR\->change_rev_prop($revnum, \f(CW$name\fR, \f(CW$value\fR)" 4
.IX Item "$ra->change_rev_prop($revnum, $name, $value)"
Sets the revision (unversioned) property \f(CW$name\fR to \f(CW$value\fR on
revision \f(CW$revnum\fR, or removes the property if \f(CW$value\fR is undef.
.Sp
.Vb 1
\& $ra\->change_rev_prop(123, \*(Aqsvn:log\*(Aq, \*(AqNew log message.\*(Aq);
.Ve
.Sp
Of course this will only work if there is a \f(CW\*(C`pre\-revprop\-change\*(C'\fR
hook available.
.ie n .IP "$ra\->check_path($path, $revnum)" 4
.el .IP "\f(CW$ra\fR\->check_path($path, \f(CW$revnum\fR)" 4
.IX Item "$ra->check_path($path, $revnum)"
Kind of node at \f(CW$path\fR in revision \f(CW$revnum\fR. A number which matches one
of these constants:
\&\f(CW$SVN::Node::none\fR, \f(CW$SVN::Node::file\fR,
\&\f(CW$SVN::Node::dir\fR, \f(CW$SVN::Node::unknown\fR.
.ie n .IP "$ra\->do_diff($revision, $target, $recurse, $ignore_ancestry, $versus_url, $editor)" 4
.el .IP "\f(CW$ra\fR\->do_diff($revision, \f(CW$target\fR, \f(CW$recurse\fR, \f(CW$ignore_ancestry\fR, \f(CW$versus_url\fR, \f(CW$editor\fR)" 4
.IX Item "$ra->do_diff($revision, $target, $recurse, $ignore_ancestry, $versus_url, $editor)"
.PD 0
.ie n .IP "$ra\->do_diff2($revision, $target, $recurse, $ignore_ancestry, $text_deltas, $versus_url, $editor)" 4
.el .IP "\f(CW$ra\fR\->do_diff2($revision, \f(CW$target\fR, \f(CW$recurse\fR, \f(CW$ignore_ancestry\fR, \f(CW$text_deltas\fR, \f(CW$versus_url\fR, \f(CW$editor\fR)" 4
.IX Item "$ra->do_diff2($revision, $target, $recurse, $ignore_ancestry, $text_deltas, $versus_url, $editor)"
.PD
Both of these return a SVN::Ra::Reporter with which you can describe
a working copy. It will then call methods on \f(CW$editor\fR to indicates
the differences between the repository and the working copy.
.Sp
The \f(CW\*(C`do_diff2\*(C'\fR method was added in Subversion\ 1.4. It adds the
\&\f(CW$text_deltas\fR option, which if false disables the generation of text
deltas on the editor. With \f(CW\*(C`do_diff\*(C'\fR text deltas are always generated.
.Sp
.Vb 4
\& my $reporter = $ra\->do_diff(1, \*(Aq\*(Aq, 1, 0, $repos_url,
\& MyEditor\->new);
\& $reporter\->set_path(...);
\& $reporter\->finish_report;
.Ve
.ie n .IP "$ra\->do_status($target, $revision, $recurse, $editor)" 4
.el .IP "\f(CW$ra\fR\->do_status($target, \f(CW$revision\fR, \f(CW$recurse\fR, \f(CW$editor\fR)" 4
.IX Item "$ra->do_status($target, $revision, $recurse, $editor)"
Returns a SVN::Ra::Reporter to which you can describe the status of
a working copy. It will then call methods on \f(CW$editor\fR to describe
the current status of the working copy compared to the repository.
.ie n .IP "$ra\->do_switch($revnum, $target, $recurse, $repos_url, $editor)" 4
.el .IP "\f(CW$ra\fR\->do_switch($revnum, \f(CW$target\fR, \f(CW$recurse\fR, \f(CW$repos_url\fR, \f(CW$editor\fR)" 4
.IX Item "$ra->do_switch($revnum, $target, $recurse, $repos_url, $editor)"
Returns a SVN::Ra::Reporter with which you can describe a working copy.
It will then call methods on \f(CW$editor\fR to indicate how to adjust the working
copy to switch it to revision \f(CW$revnum\fR of \f(CW$repos_url\fR.
.ie n .IP "$ra\->do_update($revision_to_update_to, $target, $recurse, $editor)" 4
.el .IP "\f(CW$ra\fR\->do_update($revision_to_update_to, \f(CW$target\fR, \f(CW$recurse\fR, \f(CW$editor\fR)" 4
.IX Item "$ra->do_update($revision_to_update_to, $target, $recurse, $editor)"
Returns a SVN::Ra::Reporter object. Call methods on the reporter to
describe the current state of your working copy (or whatever you're
updating). After calling the reporter's \f(CW\*(C`finish_report()\*(C'\fR method,
Subversion will generate calls to your \f(CW$editor\fR to describe the
differences between what you already have and the state of the repository in
\&\f(CW$revision_to_update_to\fR.
.Sp
To update to the latest revision, pass \f(CW$SVN::Core::INVALID_REVNUM\fR for
the first argument.
.Sp
\&\f(CW$target\fR should be the path to the part of the repository you are
interested in. You won't be given information about changes outside this
path. If you want everything, pass an empty string.
.Sp
If \f(CW$recurse\fR is true and the target is a directory, update
recursively; otherwise, update just the target and its immediate
entries, but not its child directories (if any).
.Sp
All paths are relative to the \s-1URL\s0 used to open \f(CW$ra\fR.
.Sp
The caller may not perform any \s-1RA\s0 operations using \f(CW$ra\fR before
finishing the report, and may not perform any \s-1RA\s0 operations using
\&\f(CW$ra\fR from within the editing operations of \f(CW$editor\fR.
.Sp
This example shows the simplest update, where the client tells the reporter
that it has nothing to start with:
.Sp
.Vb 3
\& my $reporter = $ra\->do_update($revnum, \*(Aq\*(Aq, 1, MyEditor\->new);
\& $reporter\->set_path(\*(Aq\*(Aq, 0, 1, undef);
\& $reporter\->finish_report;
.Ve
.ie n .IP "$ra\->get_commit_editor($logmsg, $callback, $callback_baton, $lock_tokens, $keep_locks)" 4
.el .IP "\f(CW$ra\fR\->get_commit_editor($logmsg, \f(CW$callback\fR, \f(CW$callback_baton\fR, \f(CW$lock_tokens\fR, \f(CW$keep_locks\fR)" 4
.IX Item "$ra->get_commit_editor($logmsg, $callback, $callback_baton, $lock_tokens, $keep_locks)"
.PD 0
.ie n .IP "$ra\->get_commit_editor2($logmsg, $callback, $callback_baton, $lock_tokens, $keep_locks)" 4
.el .IP "\f(CW$ra\fR\->get_commit_editor2($logmsg, \f(CW$callback\fR, \f(CW$callback_baton\fR, \f(CW$lock_tokens\fR, \f(CW$keep_locks\fR)" 4
.IX Item "$ra->get_commit_editor2($logmsg, $callback, $callback_baton, $lock_tokens, $keep_locks)"
.PD
Return an opaque editor object for committing a new revision to the
repository. The return values should be passed to the
SVN::Delta::Editor constructor to create an
editor object you can actually use. For example:
.Sp
.Vb 4
\& my $editor = SVN::Delta::Editor\->new(
\& $ra\->get_commit_editor(
\& "I\*(Aqm going to commit some changes from within my Perl code.",
\& \e&commit_callback, undef, {}, 0));
.Ve
.Sp
Now that you've got your editor you can call methods on it to describe
changes in the tree you want to make, such as adding directories, changing
file contents, etc. See SVN::Delta for documentation of the editor
interface.
.Sp
The \f(CW$callback\fR function will be called during your call to the
\&\f(CW\*(C`$ed\->close_edit()\*(C'\fR method, after the commit has succeeded. It will
not be called if there were no changes to commit. If you don't need it,
pass undef instead of a code ref.
.Sp
\&\f(CW\*(C`get_commit_editor2\*(C'\fR is identical to \f(CW\*(C`get_commit_editor\*(C'\fR except for
the information passed to the callback function. The new version, added
in Subversion\ 1.4, will pass the callback a single value (\s-1TODO:\s0 I
can' test this, but it's probably an object or hash ref) which contains
all the information. It also includes the error message from the
post-commit hook script, which is not available with \f(CW\*(C`get_commit_editor\*(C'\fR.
.Sp
The callback for the original version will be passed three arguments:
.RS 4
.IP "\(bu" 4
Number of the new revision.
.IP "\(bu" 4
Date and time that the revision was committed, which will be exactly
the same value as its \f(CW\*(C`svn:date\*(C'\fR revision property. It will be in
this format: \f(CW\*(C`2006\-04\-05T12:17:48.180320Z\*(C'\fR
.IP "\(bu" 4
The name of the author who committed the revision, which will be the same
as the \f(CW\*(C`svn:author\*(C'\fR revision property.
.RE
.RS 4
.Sp
The undef in the argument list in the example above is the baton which is
meant to be passed to the commit callback, but it isn't. This isn't a
problem since you can supply a closure as the callback so that it can get to
whatever variables you need.
.Sp
The \f(CW$logmsg\fR value should be a string which will be stored in the
\&\f(CW\*(C`svn:log\*(C'\fR revision property. If undef is passed instead then the
new revision won't have a \f(CW\*(C`svn:log\*(C'\fR property.
.Sp
\&\f(CW$lock_tokens\fR should be a reference to a hash mapping the paths to
lock tokens to use for them. I seems that with Subversion\ 1.2 this is
required, so if you aren't using any locks simply pass \f(CW\*(C`{}\*(C'\fR. In
Subversion\ 1.3.1 though it seems to be necessary to \fInot\fR pass this
argument at all.
.Sp
If \f(CW$keep_locks\fR is true then locks on the files committed won't be
released by the commit.
.Sp
The \f(CW\*(C`get_commit_editor()\*(C'\fR method itself returns a list of two items, the
first of which (a \f(CW\*(C`_p_svn_delta_editor_t\*(C'\fR object) is the actual editor.
The second is the editor baton. Neither is of any use without wrapping the
pair of them in a SVN::Delta::Editor.
.RE
.ie n .IP "$ra\->get_dated_revision($time)" 4
.el .IP "\f(CW$ra\fR\->get_dated_revision($time)" 4
.IX Item "$ra->get_dated_revision($time)"
\&\s-1TODO\s0 \- this doesn't seem to work in Subversion\ 1.3.
.ie n .IP "$ra\->get_dir($path, $revnum)" 4
.el .IP "\f(CW$ra\fR\->get_dir($path, \f(CW$revnum\fR)" 4
.IX Item "$ra->get_dir($path, $revnum)"
.PD 0
.ie n .IP "$ra\->get_dir2($path, $revnum, $dirent_fields)" 4
.el .IP "\f(CW$ra\fR\->get_dir2($path, \f(CW$revnum\fR, \f(CW$dirent_fields\fR)" 4
.IX Item "$ra->get_dir2($path, $revnum, $dirent_fields)"
.PD
Fetch the directory entries and properties of the directory at \f(CW$path\fR
in revision \f(CW$revnum\fR
.Sp
A list of three values are returned. The first is a reference to a hash
of directory entries. The keys are the names of all the files and
directories in \f(CW$path\fR (not full paths, just the filenames). The values
are _p_svn_dirent_t objects, with all their
fields filled in. The third parameter to \f(CW\*(C`get_dir2\*(C'\fR allows you to
select particular fields. \s-1TODO:\s0 I don't think the constants you'd use
to construct the \f(CW$dirent_fields\fR value are provided in the Perl \s-1API\s0.
.Sp
The second value is a number, which is only valid if \f(CW$revnum\fR is
\&\f(CW$SVN::Core::INVALID_REVNUM\fR. If that is the case then the latest revision
will be fetched, and the revision number (the \s-1HEAD\s0 revision) will be returned
as the second value. Otherwise the revision number returned will be
completely arbitrary.
.Sp
The third value returned will be a reference to a hash of all properties
on the directory. This means \fIall\fR properties: not just ones controlled by
the user and stored in the repository fs, but non-tweakable ones
generated by the \s-1SCM\s0 system itself (e.g. 'wcprops', 'entryprops', etc).
.Sp
.Vb 3
\& my ($dirents, undef, $props) = $ra\->get_dir(\*(Aq/trunk/dir\*(Aq, 123);
\& my ($dirents, $fetched_revnum, $props) = $ra\->get_dir(
\& \*(Aq/trunk/dir\*(Aq, $SVN::Core::INVALID_REVNUM);
.Ve
.ie n .IP "$ra\->get_file($path, $revnum, $fh)" 4
.el .IP "\f(CW$ra\fR\->get_file($path, \f(CW$revnum\fR, \f(CW$fh\fR)" 4
.IX Item "$ra->get_file($path, $revnum, $fh)"
Fetch the contents and properties of the file at \f(CW$path\fR in revision
\&\f(CW$revnum\fR. \f(CW$fh\fR should be a Perl filehandle, to which the contents
of the file will be written, or undef if you don't need the file contents.
.Sp
Note that \f(CW$path\fR cannot end in a slash unless it is just '/'.
.Sp
A list of two values are returned. The first is a number, which is only
valid if \f(CW$revnum\fR is \f(CW$SVN::Core::INVALID_REVNUM\fR. If that is the
case then the latest revision will be fetched, and the revision number
(the \s-1HEAD\s0 revision) will be returned as the first value. Otherwise the
number returned will be completely arbitrary.
.Sp
The second value returned will be a reference to a hash of all properties
on the file. This means \fIall\fR properties: not just ones controlled by
the user and stored in the repository fs, but non-tweakable ones
generated by the \s-1SCM\s0 system itself (e.g. 'wcprops', 'entryprops', etc).
.Sp
.Vb 2
\& my (undef, $props) = $ra\->get_file(
\& \*(Aq/trunk/foo\*(Aq, 123, undef);
\&
\& open my $fh, \*(Aq>\*(Aq, \*(Aqtmp_out\*(Aq
\& or die "error opening file: $!";
\& my (undef, $props) = $ra\->get_file(
\& \*(Aq/trunk/foo\*(Aq, 123, $fh);
\&
\& my ($fetched_revnum, $props) = $ra\->get_file(
\& \*(Aq/trunk/foo\*(Aq, $SVN::Core::INVALID_REVNUM, $fh);
.Ve
.ie n .IP "$ra\->get_file_revs($path, $start, $end, \e&callback)" 4
.el .IP "\f(CW$ra\fR\->get_file_revs($path, \f(CW$start\fR, \f(CW$end\fR, \e&callback)" 4
.IX Item "$ra->get_file_revs($path, $start, $end, &callback)"
\&\s-1TODO\s0 \- doesn't seem to work in Subversion 1.3
.ie n .IP "$ra\->get_latest_revnum" 4
.el .IP "\f(CW$ra\fR\->get_latest_revnum" 4
.IX Item "$ra->get_latest_revnum"
Return the number of the latest revision in the repository (\s-1HEAD\s0).
.ie n .IP "$ra\->get_locations($path, $peg_revnum, \e@location_revisions)" 4
.el .IP "\f(CW$ra\fR\->get_locations($path, \f(CW$peg_revnum\fR, \e@location_revisions)" 4
.IX Item "$ra->get_locations($path, $peg_revnum, @location_revisions)"
\&\s-1TODO\s0 \- doesn't seem to work in Subversion 1.3
.ie n .IP "$ra\->get_lock($path)" 4
.el .IP "\f(CW$ra\fR\->get_lock($path)" 4
.IX Item "$ra->get_lock($path)"
Returns a _p_svn_lock_t object containing
information about the lock at \f(CW$path\fR, or undef if that path isn't
currently locked.
.ie n .IP "$ra\->get_locks($path)" 4
.el .IP "\f(CW$ra\fR\->get_locks($path)" 4
.IX Item "$ra->get_locks($path)"
\&\s-1TODO\s0 \- doesn't seem to work in Subversion 1.3
.ie n .IP "$ra\->get_log(\e@paths, $start, $end, $limit, $discover_changed_paths, $strict_node_history, \e&callback)" 4
.el .IP "\f(CW$ra\fR\->get_log(\e@paths, \f(CW$start\fR, \f(CW$end\fR, \f(CW$limit\fR, \f(CW$discover_changed_paths\fR, \f(CW$strict_node_history\fR, \e&callback)" 4
.IX Item "$ra->get_log(@paths, $start, $end, $limit, $discover_changed_paths, $strict_node_history, &callback)"
For \f(CW$limit\fR revisions from \f(CW$start\fR to \f(CW$end\fR, invoke the receiver
\&\f(CW\*(C`callback()\*(C'\fR with information about the changes made in the revision
(log message, time, etc.).
.Sp
The caller may not invoke any \s-1RA\s0 operations using \f(CW$ra\fR from
within the callback function. They may work in some situations, but
it's not guaranteed.
.Sp
The first argument can be either a single string or a reference to an
array of strings. Each of these indicates a path in the repository
which you are interested in. Revisions which don't change any of these
paths (or files below them) will be ignored. Simply pass '' if you don't
want to limit by path.
.Sp
\&\f(CW$start\fR and \f(CW$end\fR should be revision numbers. If \f(CW$start\fR has a lower
value than \f(CW$end\fR then the revisions will be produced in ascending order
(r1, r2, ...), otherwise in descending order. If \f(CW$start\fR is
\&\f(CW$SVN::Core::INVALID_REVNUM\fR then it defaults to the latest revision.
.Sp
\&\s-1TODO\s0 \- the previous sentence should also be true of \f(CW$end\fR, but doing that
gets an error message in Subversion 1.3.
.Sp
\&\f(CW$limit\fR is a number indicating the maximum number of times that the
receiver \f(CW\*(C`callback()\*(C'\fR should be called. If it is 0, there will be no
limit.
.Sp
If \f(CW$discover_changed_paths\fR is true, then information about which changes
were made to which paths is passed to \f(CW\*(C`callback()\*(C'\fR.
.Sp
If \f(CW$strict_node_history\fR is true, copy history will not be traversed
(if any exists) when harvesting the revision logs for each path.
.Sp
The callback function will be given the following arguments:
.RS 4
.IP "\(bu" 4
A reference to a hash of paths changed by the revision. Only passed if
\&\f(CW$discover_changed_paths\fR is true, otherwise undef is passed in its
place.
.Sp
The hash's keys are the full paths to the files and directories changed.
The values are _p_svn_log_changed_path_t
objects.
.IP "\(bu" 4
Revision number.
.IP "\(bu" 4
Name of user who made the change, or undef if not known.
.IP "\(bu" 4
Date and time the revision was committed.
.IP "\(bu" 4
Log message as a single string, or undef.
.IP "\(bu" 4
A pool object.
.RE
.RS 4
.Sp
This example prints some of the information received in a simple format,
showing which paths were changed in each revision, for all revisions starting
from the first:
.Sp
.Vb 2
\& $ra\->get_log(\*(Aq\*(Aq, 1, $ra\->get_latest_revnum, 0, 1, 0,
\& \e&log_callback);
\&
\& sub log_callback
\& {
\& my ($paths, $revnum, $user, $datetime, $logmsg) = @_;
\& print "$datetime \- $user \- r$revnum\en";
\&
\& while (my ($path, $changes) = each %$paths) {
\& print $changes\->action, " $path\en";
\& if ($changes\->copyfrom_path) {
\& print " from ", $changes\->copyfrom_path,
\& " r", $changes\->copyfrom_rev, "\en"
\& }
\& }
\&
\& print "\en";
\& }
.Ve
.RE
.ie n .IP "$ra\->get_repos_root" 4
.el .IP "\f(CW$ra\fR\->get_repos_root" 4
.IX Item "$ra->get_repos_root"
Returns the repository's root \s-1URL\s0. The value will not include
a trailing '/'. The returned \s-1URL\s0 is guaranteed to be a prefix of the
session's \s-1URL\s0.
.ie n .IP "$ra\->get_uuid" 4
.el .IP "\f(CW$ra\fR\->get_uuid" 4
.IX Item "$ra->get_uuid"
Returns the repository's \s-1UUID\s0 as a string.
.ie n .IP "$ra\->lock(\e%path_revs, $comment, $steal_lock, \e&callback)" 4
.el .IP "\f(CW$ra\fR\->lock(\e%path_revs, \f(CW$comment\fR, \f(CW$steal_lock\fR, \e&callback)" 4
.IX Item "$ra->lock(%path_revs, $comment, $steal_lock, &callback)"
\&\s-1TODO\s0 \- doesn't seem to work in Subversion 1.3.2
.ie n .IP "$ra\->reparent($url)" 4
.el .IP "\f(CW$ra\fR\->reparent($url)" 4
.IX Item "$ra->reparent($url)"
Change the root \s-1URL\s0 of the session in \f(CW$ra\fR to point to a different
path. \f(CW$url\fR must be in the same repository as the one \f(CW$ra\fR is
already accessing.
.Sp
New in Subversion\ 1.4.
.ie n .IP "$ra\->replay($revnum, $low_water_mark, $send_deltas, $editor)" 4
.el .IP "\f(CW$ra\fR\->replay($revnum, \f(CW$low_water_mark\fR, \f(CW$send_deltas\fR, \f(CW$editor\fR)" 4
.IX Item "$ra->replay($revnum, $low_water_mark, $send_deltas, $editor)"
Call methods on \f(CW$editor\fR to describe the changes made in the revisions
after \f(CW$low_water_mark\fR, up to revision \f(CW$revnum\fR. This is like using
\&\f(CW\*(C`do_update()\*(C'\fR, except that it doesn't return a reporter object, and so
you don't have to describe a working copy to it. It assumes that you've
already got everything up to \f(CW$low_water_mark\fR.
.Sp
If \f(CW$send_deltas\fR is true then file contents and property values will
be supplied, otherwise just filename changes.
.Sp
New in Subversion\ 1.4.
.ie n .IP "$ra\->rev_prop($revnum, $name)" 4
.el .IP "\f(CW$ra\fR\->rev_prop($revnum, \f(CW$name\fR)" 4
.IX Item "$ra->rev_prop($revnum, $name)"
Return the value of the unversioned property \f(CW$name\fR from revision \f(CW$revnum\fR.
Returns undef if there is no such property.
.Sp
.Vb 1
\& print $ra\->rev_prop(123, \*(Aqsvn:date\*(Aq);
.Ve
.ie n .IP "$ra\->rev_proplist($revnum)" 4
.el .IP "\f(CW$ra\fR\->rev_proplist($revnum)" 4
.IX Item "$ra->rev_proplist($revnum)"
Returns a reference to a hash containing all the unversioned properties
of revision \f(CW$revnum\fR.
.Sp
.Vb 2
\& my $props = $ra\->rev_proplist(123);
\& print $props\->{\*(Aqsvn:log\*(Aq};
.Ve
.ie n .IP "$ra\->stat($path, $revnum)" 4
.el .IP "\f(CW$ra\fR\->stat($path, \f(CW$revnum\fR)" 4
.IX Item "$ra->stat($path, $revnum)"
Returns a _p_svn_dirent_t object containing
information about the file at \f(CW$path\fR in revision \f(CW$revnum\fR.
.ie n .IP "$ra\->unlock(\e%path_tokens, $break_lock, \e&callback)" 4
.el .IP "\f(CW$ra\fR\->unlock(\e%path_tokens, \f(CW$break_lock\fR, \e&callback)" 4
.IX Item "$ra->unlock(%path_tokens, $break_lock, &callback)"
\&\s-1TODO\s0 \- doesn't seem to work in Subversion 1.3.2
.SH "SVN::Ra::Reporter"
.IX Header "SVN::Ra::Reporter"
The SVN::Ra methods \f(CW\*(C`do_diff\*(C'\fR, \f(CW\*(C`do_status\*(C'\fR, \f(CW\*(C`do_switch\*(C'\fR, and
\&\f(CW\*(C`do_update\*(C'\fR all return a SVN::Ra::Reporter object, which can be used
to describe the working copy (or other available data) which the client has.
Subversion uses this to figure out what new information should be provided
through a tree delta editor.
.PP
Objects of this class are actually simple wrappers around underlying
\&\f(CW\*(C`svn_ra_reporter2_t\*(C'\fR objects and their associated baton.
.SS "\s-1METHODS\s0"
.IX Subsection "METHODS"
.ie n .IP "$reporter\->set_path($path, $revision, $start_empty, $lock_token, $pool)" 4
.el .IP "\f(CW$reporter\fR\->set_path($path, \f(CW$revision\fR, \f(CW$start_empty\fR, \f(CW$lock_token\fR, \f(CW$pool\fR)" 4
.IX Item "$reporter->set_path($path, $revision, $start_empty, $lock_token, $pool)"
Describe a working copy \f(CW$path\fR as being at a particular \f(CW$revision\fR.
.Sp
If \f(CW$start_empty\fR is true and \f(CW$path\fR is a directory, the
implementor should assume the directory has no entries or properties.
.Sp
This will \fIoverride\fR any previous \f(CW\*(C`set_path()\*(C'\fR calls made on parent
paths. \f(CW$path\fR is relative to the \s-1URL\s0 specified in \f(CW\*(C`SVN::Ra\->open()\*(C'\fR
or \f(CW\*(C`SVN::Ra\->new()\*(C'\fR.
.Sp
If \f(CW$lock_token\fR is not undef, it is the lock token for \f(CW$path\fR in the \s-1WC\s0.
.Sp
All temporary allocations are done in \f(CW$pool\fR.
.ie n .IP "$reporter\->delete_path($path, $pool)" 4
.el .IP "\f(CW$reporter\fR\->delete_path($path, \f(CW$pool\fR)" 4
.IX Item "$reporter->delete_path($path, $pool)"
Describe a working copy \f(CW$path\fR as missing.
.Sp
All temporary allocations are done in \f(CW$pool\fR.
.ie n .IP "$reporter\->link_path($path, $url, $revision, $start_empty, $lock_token, $pool)" 4
.el .IP "\f(CW$reporter\fR\->link_path($path, \f(CW$url\fR, \f(CW$revision\fR, \f(CW$start_empty\fR, \f(CW$lock_token\fR, \f(CW$pool\fR)" 4
.IX Item "$reporter->link_path($path, $url, $revision, $start_empty, $lock_token, $pool)"
Like \f(CW\*(C`set_path()\*(C'\fR, but differs in that \f(CW$path\fR in the working copy
(relative to the root of the report driver) isn't a reflection of
\&\f(CW$path\fR in the repository (relative to the \s-1URL\s0 specified when
opening the \s-1RA\s0 layer), but is instead a reflection of a different
repository \f(CW$url\fR at \f(CW$revision\fR.
.Sp
If \f(CW$start_empty\fR is true and \f(CW$path\fR is a directory,
the implementor should assume the directory has no entries or props.
.Sp
If \f(CW$lock_token\fR is not undef, it is the lock token for \f(CW$path\fR in the \s-1WC\s0.
.Sp
All temporary allocations are done in \f(CW$pool\fR.
.ie n .IP "$reporter\->finish_report($pool)" 4
.el .IP "\f(CW$reporter\fR\->finish_report($pool)" 4
.IX Item "$reporter->finish_report($pool)"
Call this when the state report is finished; any directories
or files not explicitly 'set' are assumed to be at the
baseline revision originally passed into \f(CW\*(C`do_update()\*(C'\fR. No other
reporting functions, including \f(CW\*(C`abort_report()\*(C'\fR, should be called after
calling this function.
.ie n .IP "$reporter\->abort_report($pool)" 4
.el .IP "\f(CW$reporter\fR\->abort_report($pool)" 4
.IX Item "$reporter->abort_report($pool)"
If an error occurs during a report, this method should cause the
filesystem transaction to be aborted and cleaned up. No other reporting
methods should be called after calling this method.
.SH "SVN::Ra::Callbacks"
.IX Header "SVN::Ra::Callbacks"
This is the wrapper class for \f(CW\*(C`svn_ra_callback_t\*(C'\fR. To supply custom
callbacks to SVN::Ra, subclass this class and override the member
functions.
.SH "AUTHORS"
.IX Header "AUTHORS"
Chia-liang Kao <clkao@clkao.org>
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
Copyright (c) 2003 CollabNet. All rights reserved.
.PP
This software is licensed as described in the file \s-1COPYING\s0, which you
should have received as part of this distribution. The terms are also
available at http://subversion.tigris.org/license\-1.html. If newer
versions of this license are posted there, you may use a newer version
instead, at your option.
.PP
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
and logs, available at http://subversion.tigris.org/.