Alien-SVN

 view release on metacpan or  search on metacpan

src/subversion/subversion/bindings/swig/perl/native/Ra.pm  view on Meta::CPAN

The callback for the original version will be passed three arguments:

=over

=item *

Number of the new revision.

=item *

Date and time that the revision was committed, which will be exactly
the same value as its C<svn:date> revision property.  It will be in
this format: C<2006-04-05T12:17:48.180320Z>

=item *

The name of the author who committed the revision, which will be the same
as the C<svn:author> revision property.

=back

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.

The C<$logmsg> value should be a string which will be stored in the
C<svn:log> revision property.  If undef is passed instead then the
new revision won't have a C<svn:log> property.

C<$lock_tokens> should be a reference to a hash mapping the paths to
lock tokens to use for them.  I seems that with S<Subversion 1.2> this is
required, so if you aren't using any locks simply pass C<{}>.  In
S<Subversion 1.3.1> though it seems to be necessary to I<not> pass this
argument at all.

If C<$keep_locks> is true then locks on the files committed won't be
released by the commit.

The C<get_commit_editor()> method itself returns a list of two items, the
first of which (a C<_p_svn_delta_editor_t> object) is the actual editor.
The second is the editor baton.  Neither is of any use without wrapping the
pair of them in a L<SVN::Delta::Editor>.

=item $ra-E<gt>get_dated_revision($time)

TODO - this doesn't seem to work in S<Subversion 1.3>.

=item $ra-E<gt>get_dir($path, $revnum)

=item $ra-E<gt>get_dir2($path, $revnum, $dirent_fields)

Fetch the directory entries and properties of the directory at C<$path>
in revision C<$revnum>

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 C<$path> (not full paths, just the filenames).  The values
are L<_p_svn_dirent_t|SVN::Core/_p_svn_dirent_t> objects, with all their
fields filled in.  The third parameter to C<get_dir2> allows you to
select particular fields.  TODO: I don't think the constants you'd use
to construct the C<$dirent_fields> value are provided in the Perl API.

The second value is a number, which is only valid if C<$revnum> is
C<$SVN::Core::INVALID_REVNUM>.  If that is the case then the latest revision
will be fetched, and the revision number (the HEAD revision) will be returned
as the second value.  Otherwise the revision number returned will be
completely arbitrary.

The third value returned will be a reference to a hash of all properties
on the directory.  This means I<all> properties: not just ones controlled by
the user and stored in the repository fs, but non-tweakable ones
generated by the SCM system itself (e.g. 'wcprops', 'entryprops', etc).

    my ($dirents, undef, $props) = $ra->get_dir('trunk/dir', 123);
    my ($dirents, $fetched_revnum, $props) = $ra->get_dir(
        'trunk/dir', $SVN::Core::INVALID_REVNUM);

=item $ra-E<gt>get_file($path, $revnum, $fh)

Fetch the contents and properties of the file at C<$path> in revision
C<$revnum>.  C<$fh> 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.

Note that C<$path> cannot end in a slash unless it is just '/'.

A list of two values are returned.  The first is a number, which is only
valid if C<$revnum> is C<$SVN::Core::INVALID_REVNUM>.  If that is the
case then the latest revision will be fetched, and the revision number
(the HEAD revision) will be returned as the first value.  Otherwise the
number returned will be completely arbitrary.

The second value returned will be a reference to a hash of all properties
on the file.  This means I<all> properties: not just ones controlled by
the user and stored in the repository fs, but non-tweakable ones
generated by the SCM system itself (e.g. 'wcprops', 'entryprops', etc).

    my (undef, $props) = $ra->get_file(
        'trunk/foo', 123, undef);

    open my $fh, '>', 'tmp_out'
        or die "error opening file: $!";
    my (undef, $props) = $ra->get_file(
        'trunk/foo', 123, $fh);

    my ($fetched_revnum, $props) = $ra->get_file(
        'trunk/foo', $SVN::Core::INVALID_REVNUM, $fh);

=item $ra-E<gt>get_file_revs($path, $start, $end, \&callback)

TODO - doesn't seem to work in Subversion 1.3

=item $ra-E<gt>get_latest_revnum

Return the number of the latest revision in the repository (HEAD).

=item $ra-E<gt>get_locations($path, $peg_revnum, \@location_revisions)

TODO - doesn't seem to work in Subversion 1.3

=item $ra-E<gt>get_lock($path)



( run in 1.540 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )