Main Page | Modules | Data Structures | File List | Data Fields | Globals

svn_ra_plugin_t Struct Reference

The RA Library. More...

#include <svn_ra.h>


Data Fields

const char * name
 The proper name of the RA library, (like "ra_dav" or "ra_local").

const char * description
 Short doc string printed out by `svn --version`.

svn_error_t *(* open )(void **session_baton, const char *repos_URL, const svn_ra_callbacks_t *callbacks, void *callback_baton, apr_hash_t *config, apr_pool_t *pool)
 Open a repository session to repos_url.

svn_error_t *(* get_latest_revnum )(void *session_baton, svn_revnum_t *latest_revnum, apr_pool_t *pool)
 Get the latest revision number from the repository.

svn_error_t *(* get_dated_revision )(void *session_baton, svn_revnum_t *revision, apr_time_t tm, apr_pool_t *pool)
 Get the latest revision number at time tm.

svn_error_t *(* change_rev_prop )(void *session_baton, svn_revnum_t rev, const char *name, const svn_string_t *value, apr_pool_t *pool)
 Set the property name to value on revision rev.

svn_error_t *(* rev_proplist )(void *session_baton, svn_revnum_t rev, apr_hash_t **props, apr_pool_t *pool)
 Set *props to the list of unversioned properties attached to revision rev.

svn_error_t *(* rev_prop )(void *session_baton, svn_revnum_t rev, const char *name, svn_string_t **value, apr_pool_t *pool)
 Set *value to the value of unversioned property name attached to revision rev.

svn_error_t *(* get_commit_editor )(void *session_baton, const svn_delta_editor_t **editor, void **edit_baton, const char *log_msg, svn_commit_callback_t callback, void *callback_baton, apr_pool_t *pool)
 Set *editor and *edit_baton to an editor for committing changes to the repository, using log_msg as the log message.

svn_error_t *(* get_file )(void *session_baton, const char *path, svn_revnum_t revision, svn_stream_t *stream, svn_revnum_t *fetched_rev, apr_hash_t **props, apr_pool_t *pool)
 Fetch the contents and properties of file path at revision.

svn_error_t *(* get_dir )(void *session_baton, const char *path, svn_revnum_t revision, apr_hash_t **dirents, svn_revnum_t *fetched_rev, apr_hash_t **props, apr_pool_t *pool)
 If dirents is non NULL, set *dirents to contain all the entries of directory path at revision.

svn_error_t *(* do_update )(void *session_baton, const svn_ra_reporter_t **reporter, void **report_baton, svn_revnum_t revision_to_update_to, const char *update_target, svn_boolean_t recurse, const svn_delta_editor_t *update_editor, void *update_baton, apr_pool_t *pool)
 Ask the network layer to update a working copy.

svn_error_t *(* do_switch )(void *session_baton, const svn_ra_reporter_t **reporter, void **report_baton, svn_revnum_t revision_to_switch_to, const char *switch_target, svn_boolean_t recurse, const char *switch_url, const svn_delta_editor_t *switch_editor, void *switch_baton, apr_pool_t *pool)
 Ask the network layer to 'switch' a working copy to a new switch_url; it's another form of do_update().

svn_error_t *(* do_status )(void *session_baton, const svn_ra_reporter_t **reporter, void **report_baton, const char *status_target, svn_revnum_t revision, svn_boolean_t recurse, const svn_delta_editor_t *status_editor, void *status_baton, apr_pool_t *pool)
 Ask the network layer to describe the status of a working copy with respect to revision of the repository (or HEAD, if revision is invalid).

svn_error_t *(* do_diff )(void *session_baton, const svn_ra_reporter_t **reporter, void **report_baton, svn_revnum_t revision, const char *diff_target, svn_boolean_t recurse, svn_boolean_t ignore_ancestry, const char *versus_url, const svn_delta_editor_t *diff_editor, void *diff_baton, apr_pool_t *pool)
 Ask the network layer to 'diff' a working copy against versus_url; it's another form of do_update().

svn_error_t *(* get_log )(void *session_baton, const apr_array_header_t *paths, svn_revnum_t start, svn_revnum_t end, svn_boolean_t discover_changed_paths, svn_boolean_t strict_node_history, svn_log_message_receiver_t receiver, void *receiver_baton, apr_pool_t *pool)
 Invoke receiver with receiver_baton on each log message from start to end.

svn_error_t *(* check_path )(void *session_baton, const char *path, svn_revnum_t revision, svn_node_kind_t *kind, apr_pool_t *pool)
 Set *kind to node kind associated with path at revision.

svn_error_t *(* get_uuid )(void *session_baton, const char **uuid, apr_pool_t *pool)
 Set *uuid to the repository's UUID.

svn_error_t *(* get_repos_root )(void *session_baton, const char **url, apr_pool_t *pool)
 Set *url to the repository's root URL.


Detailed Description

The RA Library.

A vtable structure which encapsulates all the functionality of a particular repository-access implementation.

Note: libsvn_client will keep an array of these objects, representing all RA libraries that it has simultaneously loaded into memory. Depending on the situation, the client can look through this array and find the appropriate implementation it needs.

Definition at line 262 of file svn_ra.h.


Field Documentation

svn_error_t*(* svn_ra_plugin_t::change_rev_prop)(void *session_baton, svn_revnum_t rev, const char *name, const svn_string_t *value, apr_pool_t *pool)
 

Set the property name to value on revision rev.

If value is NULL, delete the named revision property.

Please note that properties attached to revisions are **unversioned**.

Use pool for memory allocation.

svn_error_t*(* svn_ra_plugin_t::check_path)(void *session_baton, const char *path, svn_revnum_t revision, svn_node_kind_t *kind, apr_pool_t *pool)
 

Set *kind to node kind associated with path at revision.

If path does not exist under revision, set *kind to svn_node_none. path is relative to the session's parent URL.

Use pool for memory allocation.

svn_error_t*(* svn_ra_plugin_t::do_diff)(void *session_baton, const svn_ra_reporter_t **reporter, void **report_baton, svn_revnum_t revision, const char *diff_target, svn_boolean_t recurse, svn_boolean_t ignore_ancestry, const char *versus_url, const svn_delta_editor_t *diff_editor, void *diff_baton, apr_pool_t *pool)
 

Ask the network layer to 'diff' a working copy against versus_url; it's another form of do_update().

[Please note: this function cannot be used to diff a single file, only a working copy directory. See the do_switch() function for more details.]

The client initially provides a diff_editor/baton to the RA layer; this editor contains knowledge of where the common diff root is in the working copy (when open_root() is called).

In return, the client receives a reporter/report_baton. The client then describes its working-copy revision numbers by making calls into the reporter structure; the RA layer assumes that all paths are relative to the URL used to create session_baton.

When finished, the client calls reporter->finish_report(). The RA layer then does a complete drive of diff_editor, ending with close_edit(), to transmit the diff.

diff_target is an optional single path component will restrict the scope of the diff to an entry in the directory represented by the session_baton's URL, or empty if the entire directory is meant to be one of the diff paths.

The working copy will be diffed against versus_url as it exists in revision revision, or as it is in head if revision is SVN_INVALID_REVNUM.

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.

The caller may not perform any RA operations using session_baton before finishing the report, and may not perform any RA operations using session_baton from within the editing operations of diff_editor.

Use pool for memory allocation.

svn_error_t*(* svn_ra_plugin_t::do_status)(void *session_baton, const svn_ra_reporter_t **reporter, void **report_baton, const char *status_target, svn_revnum_t revision, svn_boolean_t recurse, const svn_delta_editor_t *status_editor, void *status_baton, apr_pool_t *pool)
 

Ask the network layer to describe the status of a working copy with respect to revision of the repository (or HEAD, if revision is invalid).

The client initially provides an status_editor/baton to the RA layer; this editor contains knowledge of where the change will begin in the working copy (when open_root() is called).

In return, the client receives a reporter/report_baton. The client then describes its working-copy revision numbers by making calls into the reporter structure; the RA layer assumes that all paths are relative to the URL used to create session_baton.

When finished, the client calls reporter->finish_report(). The RA layer then does a complete drive of status_editor, ending with close_edit(), to report, essentially, what would be modified in the working copy were the client to call do_update(). status_target is an optional single path component will restrict the scope of the status report to an entry in the directory represented by the session_baton's URL, or empty if the entire directory is meant to be examined.

The caller may not perform any RA operations using session_baton before finishing the report, and may not perform any RA operations using session_baton from within the editing operations of status_editor.

Use pool for memory allocation.

svn_error_t*(* svn_ra_plugin_t::do_switch)(void *session_baton, const svn_ra_reporter_t **reporter, void **report_baton, svn_revnum_t revision_to_switch_to, const char *switch_target, svn_boolean_t recurse, const char *switch_url, const svn_delta_editor_t *switch_editor, void *switch_baton, apr_pool_t *pool)
 

Ask the network layer to 'switch' a working copy to a new switch_url; it's another form of do_update().

The client initially provides an switch_editor/baton to the RA layer; this editor contains knowledge of where the change will begin in the working copy (when open_root() is called).

In return, the client receives a reporter/report_baton. The client then describes its working-copy revision numbers by making calls into the reporter structure; the RA layer assumes that all paths are relative to the URL used to create session_baton.

When finished, the client calls reporter->finish_report(). The RA layer then does a complete drive of switch_editor, ending with close_edit(), to switch the working copy.

switch_target is an optional single path component will restrict the scope of things affected by the switch to an entry in the directory represented by the session_baton's URL, or empty if the entire directory is meant to be switched.

The working copy will be switched to revision_to_switch_to, or the "latest" revision if this arg is invalid.

The caller may not perform any RA operations using session_baton before finishing the report, and may not perform any RA operations using session_baton from within the editing operations of switch_editor.

Use pool for memory allocation.

svn_error_t*(* svn_ra_plugin_t::do_update)(void *session_baton, const svn_ra_reporter_t **reporter, void **report_baton, svn_revnum_t revision_to_update_to, const char *update_target, svn_boolean_t recurse, const svn_delta_editor_t *update_editor, void *update_baton, apr_pool_t *pool)
 

Ask the network layer to update a working copy.

The client initially provides an update_editor/baton to the RA layer; this editor contains knowledge of where the change will begin in the working copy (when open_root() is called).

In return, the client receives a reporter/report_baton. The client then describes its working-copy revision numbers by making calls into the reporter structure; the RA layer assumes that all paths are relative to the URL used to create session_baton.

When finished, the client calls reporter->finish_report(). The RA layer then does a complete drive of update_editor, ending with close_edit(), to update the working copy.

update_target is an optional single path component will restrict the scope of things affected by the update to an entry in the directory represented by the session_baton's URL, or empty if the entire directory is meant to be updated.

The working copy will be updated to revision_to_update_to, or the "latest" revision if this arg is invalid.

The caller may not perform any RA operations using session_baton before finishing the report, and may not perform any RA operations using session_baton from within the editing operations of update_editor.

Use pool for memory allocation.

svn_error_t*(* svn_ra_plugin_t::get_commit_editor)(void *session_baton, const svn_delta_editor_t **editor, void **edit_baton, const char *log_msg, svn_commit_callback_t callback, void *callback_baton, apr_pool_t *pool)
 

Set *editor and *edit_baton to an editor for committing changes to the repository, using log_msg as the log message.

The revisions being committed against are passed to the editor functions, starting with the rev argument to open_root. The path root of the commit is in the session_baton's url.

These three functions all share close_baton:

* get_func is used by the RA layer to fetch any WC properties during the commit.

* set_func is used by the RA layer to set any WC properties, after the commit completes.

* close_func is used by the RA layer to bump the revisions of each committed item, after the commit completes. It may be called multiple times.

Any of these functions may be NULL.

Before close_edit returns, but after the commit has succeeded, it will invoke callback with the new revision number, the commit date (as a const char *), commit author (as a const char *), and callback_baton as arguments. If callback returns an error, that error will be returned from close_edit, otherwise close_edit will return successfully (unless it encountered an error before invoking callback).

The callback will not be called if the commit was a no-op (i.e. nothing was committed);

The caller may not perform any RA operations using session_baton before finishing the edit.

Use pool for memory allocation.

svn_error_t*(* svn_ra_plugin_t::get_dated_revision)(void *session_baton, svn_revnum_t *revision, apr_time_t tm, apr_pool_t *pool)
 

Get the latest revision number at time tm.

Use pool for memory allocation.

svn_error_t*(* svn_ra_plugin_t::get_dir)(void *session_baton, const char *path, svn_revnum_t revision, apr_hash_t **dirents, svn_revnum_t *fetched_rev, apr_hash_t **props, apr_pool_t *pool)
 

If dirents is non NULL, set *dirents to contain all the entries of directory path at revision.

The keys of dirents will be entry names (const char *), and the values dirents (svn_dirent_t *). Use pool for all allocations.

path is interpreted relative to the url in session_baton.

If revision is SVN_INVALID_REVNUM (meaning 'head') and *fetched_rev is not NULL, then this function will set *fetched_rev to the actual revision that was retrieved. (Some callers want to know, and some don't.)

If props is non NULL, set *props to contain the properties of the directory. This means *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.) The keys are const char *, values are svn_string_t *.

svn_error_t*(* svn_ra_plugin_t::get_file)(void *session_baton, const char *path, svn_revnum_t revision, svn_stream_t *stream, svn_revnum_t *fetched_rev, apr_hash_t **props, apr_pool_t *pool)
 

Fetch the contents and properties of file path at revision.

Interpret path relative to the url in session_baton. Use pool for all allocations.

If revision is SVN_INVALID_REVNUM (meaning 'head') and *fetched_rev is not NULL, then this function will set *fetched_rev to the actual revision that was retrieved. (Some callers want to know, and some don't.)

If stream is non NULL, push the contents of the file at stream.

If props is non NULL, set *props to contain the properties of the file. This means *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.) The keys are const char *, values are svn_string_t *.

The stream handlers for stream may not perform any RA operations using session_baton.

svn_error_t*(* svn_ra_plugin_t::get_latest_revnum)(void *session_baton, svn_revnum_t *latest_revnum, apr_pool_t *pool)
 

Get the latest revision number from the repository.

This is useful for the `svn status' command. :)

Use pool for memory allocation.

svn_error_t*(* svn_ra_plugin_t::get_log)(void *session_baton, const apr_array_header_t *paths, svn_revnum_t start, svn_revnum_t end, svn_boolean_t discover_changed_paths, svn_boolean_t strict_node_history, svn_log_message_receiver_t receiver, void *receiver_baton, apr_pool_t *pool)
 

Invoke receiver with receiver_baton on each log message from start to end.

start may be greater or less than end; this just controls whether the log messages are processed in descending or ascending revision number order.

If start or end is SVN_INVALID_REVNUM, it defaults to youngest.

If paths is non-null and has one or more elements, then only show revisions in which at least one of paths was changed (i.e., if file, text or props changed; if dir, props changed or an entry was added or deleted). Each path is an const char *, relative to the session's common parent.

If discover_changed_paths, then each call to receiver passes a const apr_hash_t * for the receiver's changed_paths argument; the hash's keys are all the paths committed in that revision. Otherwise, each call to receiver passes null for changed_paths.

If strict_node_history is set, copy history will not be traversed (if any exists) when harvesting the revision logs for each path.

If any invocation of receiver returns error, return that error immediately and without wrapping it.

If start or end is a non-existent revision, return the error SVN_ERR_FS_NO_SUCH_REVISION, without ever invoking receiver.

See also the documentation for svn_log_message_receiver_t.

The caller may not invoke any RA operations using session_baton from within receiver.

Use pool for memory allocation.

svn_error_t*(* svn_ra_plugin_t::get_repos_root)(void *session_baton, const char **url, apr_pool_t *pool)
 

Set *url to the repository's root URL.

The value will not include a trailing '/'.

NOTE: the URL has the same lifetime as the session_baton.

Use pool for temporary memory allocation.

svn_error_t*(* svn_ra_plugin_t::get_uuid)(void *session_baton, const char **uuid, apr_pool_t *pool)
 

Set *uuid to the repository's UUID.

NOTE: the UUID has the same lifetime as the session_baton.

Use pool for temporary memory allocation.

svn_error_t*(* svn_ra_plugin_t::open)(void **session_baton, const char *repos_URL, const svn_ra_callbacks_t *callbacks, void *callback_baton, apr_hash_t *config, apr_pool_t *pool)
 

Open a repository session to repos_url.

Return an opaque object representing this session in *session_baton, allocated in pool.

callbacks/callback_baton is a table of callbacks provided by the client; see svn_ra_callbacks_t above.

config is a hash mapping const char * keys to svn_config_t * values. For example, the svn_config_t for the "~/.subversion/config" file is under the key "config".

All RA requests require a session_baton; they will continue to use pool for memory allocation.

svn_error_t*(* svn_ra_plugin_t::rev_prop)(void *session_baton, svn_revnum_t rev, const char *name, svn_string_t **value, apr_pool_t *pool)
 

Set *value to the value of unversioned property name attached to revision rev.

If rev has no property by that name, set *value to NULL.

Use pool for memory allocation.

svn_error_t*(* svn_ra_plugin_t::rev_proplist)(void *session_baton, svn_revnum_t rev, apr_hash_t **props, apr_pool_t *pool)
 

Set *props to the list of unversioned properties attached to revision rev.

The hash maps (const char *) names to (svn_string_t *) values.

Use pool for memory allocation.


The documentation for this struct was generated from the following file:
Generated on Wed Oct 13 23:55:36 2004 for Subversion by doxygen 1.3.4