#include <apr_pools.h>
#include <apr_hash.h>
#include "svn_fs.h"
#include "svn_delta.h"
#include "svn_types.h"
#include "svn_error.h"
#include "svn_version.h"
Go to the source code of this file.
Data Structures | |
struct | svn_repos_node_t |
A node in the repository. More... | |
struct | svn_repos_parse_fns2_t |
A vtable that is driven by svn_repos_parse_dumpstream2(). More... | |
struct | svn_repos_parser_fns_t |
A vtable that is driven by svn_repos_parse_dumpstream(). More... | |
Defines | |
#define | SVN_REPOS_DUMPFILE_MAGIC_HEADER "SVN-fs-dump-format-version" |
#define | SVN_REPOS_DUMPFILE_FORMAT_VERSION 3 |
#define | SVN_REPOS_DUMPFILE_UUID "UUID" |
#define | SVN_REPOS_DUMPFILE_CONTENT_LENGTH "Content-length" |
#define | SVN_REPOS_DUMPFILE_REVISION_NUMBER "Revision-number" |
#define | SVN_REPOS_DUMPFILE_NODE_PATH "Node-path" |
#define | SVN_REPOS_DUMPFILE_NODE_KIND "Node-kind" |
#define | SVN_REPOS_DUMPFILE_NODE_ACTION "Node-action" |
#define | SVN_REPOS_DUMPFILE_NODE_COPYFROM_PATH "Node-copyfrom-path" |
#define | SVN_REPOS_DUMPFILE_NODE_COPYFROM_REV "Node-copyfrom-rev" |
#define | SVN_REPOS_DUMPFILE_TEXT_COPY_SOURCE_CHECKSUM "Text-copy-source-md5" |
#define | SVN_REPOS_DUMPFILE_TEXT_CONTENT_CHECKSUM "Text-content-md5" |
#define | SVN_REPOS_DUMPFILE_PROP_CONTENT_LENGTH "Prop-content-length" |
#define | SVN_REPOS_DUMPFILE_TEXT_CONTENT_LENGTH "Text-content-length" |
#define | SVN_REPOS_DUMPFILE_PROP_DELTA "Prop-delta" |
#define | SVN_REPOS_DUMPFILE_TEXT_DELTA "Text-delta" |
Typedefs | |
typedef svn_error_t *(* | svn_repos_authz_func_t )(svn_boolean_t *allowed, svn_fs_root_t *root, const char *path, void *baton, apr_pool_t *pool) |
Callback type for checking authorization on paths produced by (at least) svn_repos_dir_delta(). | |
typedef svn_error_t *(* | svn_repos_authz_callback_t )(svn_repos_authz_access_t required, svn_boolean_t *allowed, svn_fs_root_t *root, const char *path, void *baton, apr_pool_t *pool) |
Callback type for checking authorization on paths produced by the repository commit editor. | |
typedef svn_error_t *(* | svn_repos_file_rev_handler_t )(void *baton, const char *path, svn_revnum_t rev, apr_hash_t *rev_props, svn_txdelta_window_handler_t *delta_handler, void **delta_baton, apr_array_header_t *prop_diffs, apr_pool_t *pool) |
A callback function type for use in svn_repos_get_file_revs(). | |
typedef struct svn_repos_t | svn_repos_t |
The repository object. | |
typedef svn_error_t *(* | svn_repos_history_func_t )(void *baton, const char *path, svn_revnum_t revision, apr_pool_t *pool) |
Callback type for use with svn_repos_history(). | |
typedef svn_repos_parse_fns2_t | svn_repos_parser_fns2_t |
typedef struct svn_authz_t | svn_authz_t |
A data type which stores the authz information. | |
Enumerations | |
enum | svn_repos_authz_access_t { svn_authz_none = 0, svn_authz_read = 1, svn_authz_write = 2, svn_authz_recursive = 4 } |
An enum defining the kinds of access authz looks up. More... | |
enum | svn_node_action { svn_node_action_change, svn_node_action_add, svn_node_action_delete, svn_node_action_replace } |
The different "actions" attached to nodes in the dumpfile. More... | |
enum | svn_repos_load_uuid { svn_repos_load_uuid_default, svn_repos_load_uuid_ignore, svn_repos_load_uuid_force } |
The different policies for processing the UUID in the dumpfile. More... | |
Functions | |
const svn_version_t * | svn_repos_version (void) |
Get libsvn_repos version information. | |
const char * | svn_repos_find_root_path (const char *path, apr_pool_t *pool) |
Find the root path of the repository that contains path. | |
svn_error_t * | svn_repos_open (svn_repos_t **repos_p, const char *path, apr_pool_t *pool) |
Set *repos_p to a repository object for the repository at path. | |
svn_error_t * | svn_repos_create (svn_repos_t **repos_p, const char *path, const char *unused_1, const char *unused_2, apr_hash_t *config, apr_hash_t *fs_config, apr_pool_t *pool) |
Create a new Subversion repository at path, building the necessary directory structure, creating the filesystem, and so on. | |
svn_error_t * | svn_repos_delete (const char *path, apr_pool_t *pool) |
Destroy the Subversion repository found at path, using pool for any necessary allocations. | |
svn_fs_t * | svn_repos_fs (svn_repos_t *repos) |
Return the filesystem associated with repository object repos. | |
svn_error_t * | svn_repos_hotcopy (const char *src_path, const char *dst_path, svn_boolean_t clean_logs, apr_pool_t *pool) |
Make a hot copy of the Subversion repository found at src_path to dst_path. | |
svn_error_t * | svn_repos_recover (const char *path, apr_pool_t *pool) |
Run database recovery procedures on the repository at path, returning the database to a consistent state. | |
svn_error_t * | svn_repos_recover2 (const char *path, svn_boolean_t nonblocking, svn_error_t *(*start_callback)(void *baton), void *start_callback_baton, apr_pool_t *pool) |
Run database recovery procedures on the repository at path, returning the database to a consistent state. | |
svn_error_t * | svn_repos_db_logfiles (apr_array_header_t **logfiles, const char *path, svn_boolean_t only_unused, apr_pool_t *pool) |
This function is a wrapper around svn_fs_berkeley_logfiles(), returning log file paths relative to the root of the repository. | |
const char * | svn_repos_path (svn_repos_t *repos, apr_pool_t *pool) |
Return the top-level repository path allocated in pool. | |
const char * | svn_repos_db_env (svn_repos_t *repos, apr_pool_t *pool) |
Return the path to repos's filesystem directory, allocated in pool. | |
const char * | svn_repos_conf_dir (svn_repos_t *repos, apr_pool_t *pool) |
Return path to repos's config directory, allocated in pool. | |
const char * | svn_repos_svnserve_conf (svn_repos_t *repos, apr_pool_t *pool) |
Return path to repos's svnserve.conf, allocated in pool. | |
const char * | svn_repos_lock_dir (svn_repos_t *repos, apr_pool_t *pool) |
Return path to repos's lock directory, allocated in pool. | |
const char * | svn_repos_db_lockfile (svn_repos_t *repos, apr_pool_t *pool) |
Return path to repos's db lockfile, allocated in pool. | |
const char * | svn_repos_db_logs_lockfile (svn_repos_t *repos, apr_pool_t *pool) |
Return path to repos's db logs lockfile, allocated in pool. | |
const char * | svn_repos_hook_dir (svn_repos_t *repos, apr_pool_t *pool) |
Return the path to repos's hook directory, allocated in pool. | |
const char * | svn_repos_start_commit_hook (svn_repos_t *repos, apr_pool_t *pool) |
Return the path to repos's start-commit hook, allocated in pool. | |
const char * | svn_repos_pre_commit_hook (svn_repos_t *repos, apr_pool_t *pool) |
Return the path to repos's pre-commit hook, allocated in pool. | |
const char * | svn_repos_post_commit_hook (svn_repos_t *repos, apr_pool_t *pool) |
Return the path to repos's post-commit hook, allocated in pool. | |
const char * | svn_repos_pre_revprop_change_hook (svn_repos_t *repos, apr_pool_t *pool) |
Return the path to repos's pre-revprop-change hook, allocated in pool. | |
const char * | svn_repos_post_revprop_change_hook (svn_repos_t *repos, apr_pool_t *pool) |
Return the path to repos's post-revprop-change hook, allocated in pool. | |
const char * | svn_repos_pre_lock_hook (svn_repos_t *repos, apr_pool_t *pool) |
Return the path to repos's pre-lock hook, allocated in pool. | |
const char * | svn_repos_post_lock_hook (svn_repos_t *repos, apr_pool_t *pool) |
Return the path to repos's post-lock hook, allocated in pool. | |
const char * | svn_repos_pre_unlock_hook (svn_repos_t *repos, apr_pool_t *pool) |
Return the path to repos's pre-unlock hook, allocated in pool. | |
const char * | svn_repos_post_unlock_hook (svn_repos_t *repos, apr_pool_t *pool) |
Return the path to repos's post-unlock hook, allocated in pool. | |
svn_error_t * | svn_repos_begin_report (void **report_baton, svn_revnum_t revnum, const char *username, svn_repos_t *repos, const char *fs_base, const char *target, const char *tgt_path, svn_boolean_t text_deltas, svn_boolean_t recurse, svn_boolean_t ignore_ancestry, const svn_delta_editor_t *editor, void *edit_baton, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool) |
Construct and return a report_baton that will be passed to the other functions in this section to describe the state of a pre-existing tree (typically, a working copy). | |
svn_error_t * | svn_repos_set_path2 (void *report_baton, const char *path, svn_revnum_t revision, svn_boolean_t start_empty, const char *lock_token, apr_pool_t *pool) |
Given a report_baton constructed by svn_repos_begin_report(), record the presence of path at revision in the current tree. | |
svn_error_t * | svn_repos_set_path (void *report_baton, const char *path, svn_revnum_t revision, svn_boolean_t start_empty, apr_pool_t *pool) |
Similar to svn_repos_set_path2(), but with lock_token set to NULL . | |
svn_error_t * | svn_repos_link_path2 (void *report_baton, const char *path, const char *link_path, svn_revnum_t revision, svn_boolean_t start_empty, const char *lock_token, apr_pool_t *pool) |
Given a report_baton constructed by svn_repos_begin_report(), record the presence of in the current tree, containing the contents of link_path at revision. | |
svn_error_t * | svn_repos_link_path (void *report_baton, const char *path, const char *link_path, svn_revnum_t revision, svn_boolean_t start_empty, apr_pool_t *pool) |
Similar to svn_repos_link_path2(), but with lock_token set to NULL . | |
svn_error_t * | svn_repos_delete_path (void *report_baton, const char *path, apr_pool_t *pool) |
Given a report_baton constructed by svn_repos_begin_report(), record the non-existence of path in the current tree. | |
svn_error_t * | svn_repos_finish_report (void *report_baton, apr_pool_t *pool) |
Given a report_baton constructed by svn_repos_begin_report(), finish the report and drive the editor as specified when the report baton was constructed. | |
svn_error_t * | svn_repos_abort_report (void *report_baton, apr_pool_t *pool) |
Given a report_baton constructed by svn_repos_begin_report(), abort the report. | |
svn_error_t * | svn_repos_dir_delta (svn_fs_root_t *src_root, const char *src_parent_dir, const char *src_entry, svn_fs_root_t *tgt_root, const char *tgt_path, const svn_delta_editor_t *editor, void *edit_baton, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, svn_boolean_t text_deltas, svn_boolean_t recurse, svn_boolean_t entry_props, svn_boolean_t ignore_ancestry, apr_pool_t *pool) |
Use the provided editor and edit_baton to describe the changes necessary for making a given node (and its descendants, if it is a directory) under src_root look exactly like tgt_path under tgt_root. | |
svn_error_t * | svn_repos_replay2 (svn_fs_root_t *root, const char *base_dir, svn_revnum_t low_water_mark, svn_boolean_t send_deltas, const svn_delta_editor_t *editor, void *edit_baton, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool) |
Use the provided editor and edit_baton to describe the skeletal changes made in a particular filesystem root (revision or transaction). | |
svn_error_t * | svn_repos_replay (svn_fs_root_t *root, const svn_delta_editor_t *editor, void *edit_baton, apr_pool_t *pool) |
Similar to svn_repos_replay2(), but with base_dir set to "" , low_water_mark set to SVN_INVALID_REVNUM , send_deltas set to FALSE , and authz_read_func and authz_read_baton set to NULL . | |
svn_error_t * | svn_repos_get_commit_editor4 (const svn_delta_editor_t **editor, void **edit_baton, svn_repos_t *repos, svn_fs_txn_t *txn, const char *repos_url, const char *base_path, const char *user, const char *log_msg, svn_commit_callback2_t callback, void *callback_baton, svn_repos_authz_callback_t authz_callback, void *authz_baton, apr_pool_t *pool) |
Return an editor and edit_baton to commit changes to session->fs, beginning at location 'rev:base_path', where "rev" is the argument given to open_root(). | |
svn_error_t * | svn_repos_get_commit_editor3 (const svn_delta_editor_t **editor, void **edit_baton, svn_repos_t *repos, svn_fs_txn_t *txn, const char *repos_url, const char *base_path, const char *user, const char *log_msg, svn_commit_callback_t callback, void *callback_baton, svn_repos_authz_callback_t authz_callback, void *authz_baton, apr_pool_t *pool) |
Similar to svn_repos_get_commit_editor4(), but uses the svn_commit_callback_t type. | |
svn_error_t * | svn_repos_get_commit_editor2 (const svn_delta_editor_t **editor, void **edit_baton, svn_repos_t *repos, svn_fs_txn_t *txn, const char *repos_url, const char *base_path, const char *user, const char *log_msg, svn_commit_callback_t callback, void *callback_baton, apr_pool_t *pool) |
Similar to svn_repos_get_commit_editor3(), but with authz_callback and authz_baton set to NULL . | |
svn_error_t * | svn_repos_get_commit_editor (const svn_delta_editor_t **editor, void **edit_baton, svn_repos_t *repos, const char *repos_url, const char *base_path, const char *user, const char *log_msg, svn_commit_callback_t callback, void *callback_baton, apr_pool_t *pool) |
Similar to svn_repos_get_commit_editor2(), but with txn always set to NULL . | |
svn_error_t * | svn_repos_dated_revision (svn_revnum_t *revision, svn_repos_t *repos, apr_time_t tm, apr_pool_t *pool) |
Set *revision to the revision number in repos's filesystem that was youngest at time tm. | |
svn_error_t * | svn_repos_get_committed_info (svn_revnum_t *committed_rev, const char **committed_date, const char **last_author, svn_fs_root_t *root, const char *path, apr_pool_t *pool) |
Given a root/path within some filesystem, return three pieces of information allocated in pool:. | |
svn_error_t * | svn_repos_stat (svn_dirent_t **dirent, svn_fs_root_t *root, const char *path, apr_pool_t *pool) |
Set *dirent to an svn_dirent_t associated with path in root. | |
svn_error_t * | svn_repos_history2 (svn_fs_t *fs, const char *path, svn_repos_history_func_t history_func, void *history_baton, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, svn_revnum_t start, svn_revnum_t end, svn_boolean_t cross_copies, apr_pool_t *pool) |
Call history_func (with history_baton) for each interesting history location in the lifetime of path in fs, from the youngest of end and @ start to the oldest. | |
svn_error_t * | svn_repos_history (svn_fs_t *fs, const char *path, svn_repos_history_func_t history_func, void *history_baton, svn_revnum_t start, svn_revnum_t end, svn_boolean_t cross_copies, apr_pool_t *pool) |
Similar to svn_repos_history2(), but with authz_read_func and authz_read_baton always set to NULL. | |
svn_error_t * | svn_repos_trace_node_locations (svn_fs_t *fs, apr_hash_t **locations, const char *fs_path, svn_revnum_t peg_revision, apr_array_header_t *location_revisions, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool) |
Set *locations to be a mapping of the revisions to the paths of the file fs_path present at the repository in revision peg_revision, where the revisions are taken out of the array location_revisions. | |
svn_error_t * | svn_repos_get_logs3 (svn_repos_t *repos, const apr_array_header_t *paths, svn_revnum_t start, svn_revnum_t end, int limit, svn_boolean_t discover_changed_paths, svn_boolean_t strict_node_history, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, 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 in repos's filesystem. | |
svn_error_t * | svn_repos_get_logs2 (svn_repos_t *repos, 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_repos_authz_func_t authz_read_func, void *authz_read_baton, svn_log_message_receiver_t receiver, void *receiver_baton, apr_pool_t *pool) |
Same as svn_repos_get_logs3(), but with limit always set to 0. | |
svn_error_t * | svn_repos_get_logs (svn_repos_t *repos, 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) |
Same as svn_repos_get_logs2(), but with authz_read_func and authz_read_baton always set to NULL. | |
svn_error_t * | svn_repos_get_file_revs (svn_repos_t *repos, const char *path, svn_revnum_t start, svn_revnum_t end, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, svn_repos_file_rev_handler_t handler, void *handler_baton, apr_pool_t *pool) |
Retrieve a subset of the interesting revisions of a file path in repos as seen in revision end. | |
svn_error_t * | svn_repos_fs_commit_txn (const char **conflict_p, svn_repos_t *repos, svn_revnum_t *new_rev, svn_fs_txn_t *txn, apr_pool_t *pool) |
Like svn_fs_commit_txn(), but invoke the repos's pre- and post-commit hooks around the commit. | |
svn_error_t * | svn_repos_fs_begin_txn_for_commit (svn_fs_txn_t **txn_p, svn_repos_t *repos, svn_revnum_t rev, const char *author, const char *log_msg, apr_pool_t *pool) |
Like svn_fs_begin_txn(), but use author and log_msg to set the corresponding properties on transaction *txn_p. | |
svn_error_t * | svn_repos_fs_begin_txn_for_update (svn_fs_txn_t **txn_p, svn_repos_t *repos, svn_revnum_t rev, const char *author, apr_pool_t *pool) |
Like svn_fs_begin_txn(), but use author to set the corresponding property on transaction *txn_p. | |
svn_error_t * | svn_repos_fs_lock (svn_lock_t **lock, svn_repos_t *repos, const char *path, const char *token, const char *comment, svn_boolean_t is_dav_comment, apr_time_t expiration_date, svn_revnum_t current_rev, svn_boolean_t steal_lock, apr_pool_t *pool) |
Like svn_fs_lock(), but invoke the repos's pre- and post-lock hooks before and after the locking action. | |
svn_error_t * | svn_repos_fs_unlock (svn_repos_t *repos, const char *path, const char *token, svn_boolean_t break_lock, apr_pool_t *pool) |
Like svn_fs_unlock(), but invoke the repos's pre- and post-unlock hooks before and after the unlocking action. | |
svn_error_t * | svn_repos_fs_get_locks (apr_hash_t **locks, svn_repos_t *repos, const char *path, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool) |
Look up all the locks in and under path in repos, setting *locks to a hash which maps const char * paths to the svn_lock_t locks associated with those paths. | |
svn_error_t * | svn_repos_fs_change_rev_prop2 (svn_repos_t *repos, svn_revnum_t rev, const char *author, const char *name, const svn_string_t *new_value, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool) |
Like svn_fs_change_rev_prop(), but invoke the repos's pre- and post-revprop-change hooks around the change. | |
svn_error_t * | svn_repos_fs_change_rev_prop (svn_repos_t *repos, svn_revnum_t rev, const char *author, const char *name, const svn_string_t *new_value, apr_pool_t *pool) |
Similar to svn_repos_fs_change_rev_prop2(), but with the authz_read_func parameter always NULL. | |
svn_error_t * | svn_repos_fs_revision_prop (svn_string_t **value_p, svn_repos_t *repos, svn_revnum_t rev, const char *propname, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool) |
Set *value_p to the value of the property named propname on revision rev in the filesystem opened in repos. | |
svn_error_t * | svn_repos_fs_revision_proplist (apr_hash_t **table_p, svn_repos_t *repos, svn_revnum_t rev, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool) |
Set *table_p to the entire property list of revision rev in filesystem opened in repos, as a hash table allocated in pool. | |
svn_error_t * | svn_repos_fs_change_node_prop (svn_fs_root_t *root, const char *path, const char *name, const svn_string_t *value, apr_pool_t *pool) |
Validating wrapper for svn_fs_change_node_prop() (which see for argument descriptions). | |
svn_error_t * | svn_repos_fs_change_txn_prop (svn_fs_txn_t *txn, const char *name, const svn_string_t *value, apr_pool_t *pool) |
Validating wrapper for svn_fs_change_txn_prop() (which see for argument descriptions). | |
svn_error_t * | svn_repos_node_editor (const svn_delta_editor_t **editor, void **edit_baton, svn_repos_t *repos, svn_fs_root_t *base_root, svn_fs_root_t *root, apr_pool_t *node_pool, apr_pool_t *pool) |
Set *editor and *edit_baton to an editor that, when driven by svn_repos_dir_delta(), builds an svn_repos_node_t * tree representing the delta from base_root to root in repos's filesystem. | |
svn_repos_node_t * | svn_repos_node_from_baton (void *edit_baton) |
Return the root node of the linked-list tree generated by driving the editor created by svn_repos_node_editor() with svn_repos_dir_delta(), which is stored in edit_baton. | |
svn_error_t * | svn_repos_dump_fs2 (svn_repos_t *repos, svn_stream_t *dumpstream, svn_stream_t *feedback_stream, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_boolean_t incremental, svn_boolean_t use_deltas, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool) |
Dump the contents of the filesystem within already-open repos into writable dumpstream. | |
svn_error_t * | svn_repos_dump_fs (svn_repos_t *repos, svn_stream_t *dumpstream, svn_stream_t *feedback_stream, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_boolean_t incremental, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool) |
Similar to svn_repos_dump_fs2(), but with the use_deltas parameter always set to FALSE . | |
svn_error_t * | svn_repos_load_fs2 (svn_repos_t *repos, svn_stream_t *dumpstream, svn_stream_t *feedback_stream, enum svn_repos_load_uuid uuid_action, const char *parent_dir, svn_boolean_t use_pre_commit_hook, svn_boolean_t use_post_commit_hook, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool) |
Read and parse dumpfile-formatted dumpstream, reconstructing filesystem revisions in already-open repos, handling uuids in accordance with uuid_action. | |
svn_error_t * | svn_repos_load_fs (svn_repos_t *repos, svn_stream_t *dumpstream, svn_stream_t *feedback_stream, enum svn_repos_load_uuid uuid_action, const char *parent_dir, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool) |
Similar to svn_repos_load_fs2(), but with use_pre_commit_hook and use_post_commit_hook always FALSE . | |
svn_error_t * | svn_repos_parse_dumpstream2 (svn_stream_t *stream, const svn_repos_parse_fns2_t *parse_fns, void *parse_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool) |
Read and parse dumpfile-formatted stream, calling callbacks in parse_fns/parse_baton, and using pool for allocations. | |
svn_error_t * | svn_repos_get_fs_build_parser2 (const svn_repos_parse_fns2_t **parser, void **parse_baton, svn_repos_t *repos, svn_boolean_t use_history, enum svn_repos_load_uuid uuid_action, svn_stream_t *outstream, const char *parent_dir, apr_pool_t *pool) |
Set *parser and *parse_baton to a vtable parser which commits new revisions to the fs in repos. | |
svn_error_t * | svn_repos_parse_dumpstream (svn_stream_t *stream, const svn_repos_parser_fns_t *parse_fns, void *parse_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool) |
Similar to svn_repos_parse_dumpstream2(), but uses the more limited svn_repos_parser_fns_t vtable type. | |
svn_error_t * | svn_repos_get_fs_build_parser (const svn_repos_parser_fns_t **parser, void **parse_baton, svn_repos_t *repos, svn_boolean_t use_history, enum svn_repos_load_uuid uuid_action, svn_stream_t *outstream, const char *parent_dir, apr_pool_t *pool) |
Similar to svn_repos_get_fs_build_parser2(), but yields the more limited svn_repos_parser_fns_t vtable type. | |
svn_error_t * | svn_repos_authz_read (svn_authz_t **authz_p, const char *file, svn_boolean_t must_exist, apr_pool_t *pool) |
Read authz configuration data from file (a file or registry path) into *authz_p, allocated in pool. | |
svn_error_t * | svn_repos_authz_check_access (svn_authz_t *authz, const char *repos_name, const char *path, const char *user, svn_repos_authz_access_t required_access, svn_boolean_t *access_granted, apr_pool_t *pool) |
Check whether user can access path in the repository repos_name with the required_access. |
Definition in file svn_repos.h.
typedef struct svn_authz_t svn_authz_t |
A data type which stores the authz information.
Definition at line 1831 of file svn_repos.h.
typedef svn_error_t*(* svn_repos_authz_callback_t)(svn_repos_authz_access_t required, svn_boolean_t *allowed, svn_fs_root_t *root, const char *path, void *baton, apr_pool_t *pool) |
Callback type for checking authorization on paths produced by the repository commit editor.
Set *allowed to TRUE to indicate that the required access on path in root is authorized, or set it to FALSE to indicate unauthorized (presumable according to state stored in baton).
If path is NULL, the callback should perform a global authz lookup for the required access. That is, the lookup should check if the required access is granted for at least one path of the repository, and set *allowed to TRUE if so. root may also be NULL if path is NULL.
This callback is very similar to svn_repos_authz_func_t, with the exception of the addition of the required parameter. This is due to historical reasons: when authz was first implemented for svn_repos_dir_delta(), it seemed there would need only checks for read and write operations, hence the svn_repos_authz_func_t callback prototype and usage scenario. But it was then realized that lookups due to copying needed to be recursive, and that brute-force recursive lookups didn't square with the O(1) performances a copy operation should have.
So a special way to ask for a recursive lookup was introduced. The commit editor needs this capability to retain acceptable performance. Instead of revving the existing callback, causing unnecessary revving of functions that don't actually need the extended functionality, this second, more complete callback was introduced, for use by the commit editor.
Some day, it would be nice to reunite these two callbacks and do the necessary revving anyway, but for the time being, this dual callback mechanism will do.
Definition at line 132 of file svn_repos.h.
typedef svn_error_t*(* svn_repos_authz_func_t)(svn_boolean_t *allowed, svn_fs_root_t *root, const char *path, void *baton, apr_pool_t *pool) |
Callback type for checking authorization on paths produced by (at least) svn_repos_dir_delta().
Set *allowed to TRUE to indicate that some operation is authorized for path in root, or set it to FALSE to indicate unauthorized (presumably according to state stored in baton).
Do not assume pool has any lifetime beyond this call.
The exact operation being authorized depends on the callback implementation. For read authorization, for example, the caller would implement an instance that does read checking, and pass it as a parameter named [perhaps] 'authz_read_func'. The receiver of that parameter might also take another parameter named 'authz_write_func', which although sharing this type, would be a different implementation.
Definition at line 70 of file svn_repos.h.
typedef svn_error_t*(* svn_repos_file_rev_handler_t)(void *baton, const char *path, svn_revnum_t rev, apr_hash_t *rev_props, svn_txdelta_window_handler_t *delta_handler, void **delta_baton, apr_array_header_t *prop_diffs, apr_pool_t *pool) |
A callback function type for use in svn_repos_get_file_revs().
baton is provided by the caller, path is the pathname of the file in revision rev and rev_props are the revision properties. If delta_handler and delta_baton are non-NULL, they may be set to a handler/baton which will be called with the delta between the previous revision and this one after the return of this callback. They may be left as NULL/NULL. prop_diffs is an array of svn_prop_t elements indicating the property delta for this and the previous revision. pool may be used for temporary allocations, but you can't rely on objects allocated to live outside of this particular call and the immediately following calls to *delta_handler if any.
Definition at line 156 of file svn_repos.h.
typedef svn_error_t*(* svn_repos_history_func_t)(void *baton, const char *path, svn_revnum_t revision, apr_pool_t *pool) |
Callback type for use with svn_repos_history().
path and revision represent interesting history locations in the lifetime of the path passed to svn_repos_history(). baton is the same baton given to svn_repos_history(). pool is provided for the convenience of the implementor, who should not expect it to live longer than a single callback call.
Definition at line 840 of file svn_repos.h.
typedef struct svn_repos_t svn_repos_t |
An enum defining the kinds of access authz looks up.
svn_authz_none |
No access.
|
svn_authz_read |
Path can be read.
|
svn_authz_write |
Path can be altered.
|
svn_authz_recursive |
The other access credentials are recursive.
|
Definition at line 81 of file svn_repos.h.
svn_error_t* svn_repos_abort_report | ( | void * | report_baton, | |
apr_pool_t * | pool | |||
) |
Given a report_baton constructed by svn_repos_begin_report(), abort the report.
This function can be called anytime before svn_repos_finish_report() is called.
After the call to this function, report_baton is no longer valid; it should not be passed to any other reporting functions.
svn_error_t* svn_repos_authz_check_access | ( | svn_authz_t * | authz, | |
const char * | repos_name, | |||
const char * | path, | |||
const char * | user, | |||
svn_repos_authz_access_t | required_access, | |||
svn_boolean_t * | access_granted, | |||
apr_pool_t * | pool | |||
) |
Check whether user can access path in the repository repos_name with the required_access.
authz lists the ACLs to check against. Set *access_granted to indicate if the requested access is granted.
If path is NULL, then check whether user has the required_access anywhere in the repository. Set *access_granted to TRUE if at least one path is accessible with the required_access.
svn_error_t* svn_repos_authz_read | ( | svn_authz_t ** | authz_p, | |
const char * | file, | |||
svn_boolean_t | must_exist, | |||
apr_pool_t * | pool | |||
) |
Read authz configuration data from file (a file or registry path) into *authz_p, allocated in pool.
If file is not a valid authz rule file, then return SVN_AUTHZ_INVALID_CONFIG. The contents of *authz_p is then undefined. If must_exist is TRUE, a missing authz file is also an error.
svn_error_t* svn_repos_begin_report | ( | void ** | report_baton, | |
svn_revnum_t | revnum, | |||
const char * | username, | |||
svn_repos_t * | repos, | |||
const char * | fs_base, | |||
const char * | target, | |||
const char * | tgt_path, | |||
svn_boolean_t | text_deltas, | |||
svn_boolean_t | recurse, | |||
svn_boolean_t | ignore_ancestry, | |||
const svn_delta_editor_t * | editor, | |||
void * | edit_baton, | |||
svn_repos_authz_func_t | authz_read_func, | |||
void * | authz_read_baton, | |||
apr_pool_t * | pool | |||
) |
Construct and return a report_baton that will be passed to the other functions in this section to describe the state of a pre-existing tree (typically, a working copy).
When the report is finished, editor/edit_baton will be driven in such a way as to transform the existing tree to revnum and, if tgt_path is non-NULL, switch the reported hierarchy to tgt_path.
fs_base is the absolute path of the node in the filesystem at which the comparison should be rooted. target is a single path component, used to limit the scope of the report to a single entry of fs_base, or "" if all of fs_base itself is the main subject of the report.
tgt_path and revnum is the fs path/revision pair that is the "target" of the delta. tgt_path should be provided only when the source and target paths of the report differ. That is, tgt_path should *only* be specified when specifying that the resultant editor drive be one that transforms the reported hierarchy into a pristine tree of tgt_path at revision revnum. A NULL
value for tgt_path will indicate that the editor should be driven in such a way as to transform the reported hierarchy to revision revnum, preserving the reported hierarchy.
text_deltas instructs the driver of the editor to enable the generation of text deltas.
recurse instructs the driver of the editor to send a recursive delta (or not.)
ignore_ancestry instructs the driver to ignore node ancestry when determining how to transmit differences.
The authz_read_func and authz_read_baton are passed along to svn_repos_dir_delta(); see that function for how they are used.
All allocation for the context and collected state will occur in pool.
const char* svn_repos_conf_dir | ( | svn_repos_t * | repos, | |
apr_pool_t * | pool | |||
) |
Return path to repos's config directory, allocated in pool.
svn_error_t* svn_repos_create | ( | svn_repos_t ** | repos_p, | |
const char * | path, | |||
const char * | unused_1, | |||
const char * | unused_2, | |||
apr_hash_t * | config, | |||
apr_hash_t * | fs_config, | |||
apr_pool_t * | pool | |||
) |
Create a new Subversion repository at path, building the necessary directory structure, creating the filesystem, and so on.
Return the repository object in *repos_p, allocated in pool.
config is a client configuration hash of svn_config_t
* items keyed on config category names, and may be NULL.
fs_config is passed to the filesystem, and may be NULL.
unused_1 and unused_2 are not used and should be NULL.
const char* svn_repos_db_lockfile | ( | svn_repos_t * | repos, | |
apr_pool_t * | pool | |||
) |
Return path to repos's db lockfile, allocated in pool.
svn_error_t* svn_repos_db_logfiles | ( | apr_array_header_t ** | logfiles, | |
const char * | path, | |||
svn_boolean_t | only_unused, | |||
apr_pool_t * | pool | |||
) |
This function is a wrapper around svn_fs_berkeley_logfiles(), returning log file paths relative to the root of the repository.
Set *logfiles to an array of const char *
log file names of Berkeley DB-based Subversion filesystem.
If only_unused is TRUE
, set *logfiles to an array which contains only the names of Berkeley DB log files no longer in use by the filesystem. Otherwise, all log files (used and unused) are returned.
This function wraps the Berkeley DB 'log_archive' function called by the db_archive binary. Repository administrators may want to run this function periodically and delete the unused log files, as a way of reclaiming disk space.
const char* svn_repos_db_logs_lockfile | ( | svn_repos_t * | repos, | |
apr_pool_t * | pool | |||
) |
Return path to repos's db logs lockfile, allocated in pool.
svn_error_t* svn_repos_delete_path | ( | void * | report_baton, | |
const char * | path, | |||
apr_pool_t * | pool | |||
) |
Given a report_baton constructed by svn_repos_begin_report(), record the non-existence of path in the current tree.
(This allows the reporter's driver to describe missing pieces of a working copy, so that 'svn up' can recreate them.)
All temporary allocations are done in pool.
svn_error_t* svn_repos_dir_delta | ( | svn_fs_root_t * | src_root, | |
const char * | src_parent_dir, | |||
const char * | src_entry, | |||
svn_fs_root_t * | tgt_root, | |||
const char * | tgt_path, | |||
const svn_delta_editor_t * | editor, | |||
void * | edit_baton, | |||
svn_repos_authz_func_t | authz_read_func, | |||
void * | authz_read_baton, | |||
svn_boolean_t | text_deltas, | |||
svn_boolean_t | recurse, | |||
svn_boolean_t | entry_props, | |||
svn_boolean_t | ignore_ancestry, | |||
apr_pool_t * | pool | |||
) |
Use the provided editor and edit_baton to describe the changes necessary for making a given node (and its descendants, if it is a directory) under src_root look exactly like tgt_path under tgt_root.
src_entry is the node to update. If src_entry is empty, then compute the difference between the entire tree anchored at src_parent_dir under src_root and tgt_path under target_root. Else, describe the changes needed to update only that entry in src_parent_dir. Typically, callers of this function will use a tgt_path that is the concatenation of src_parent_dir and src_entry.
src_root and tgt_root can both be either revision or transaction roots. If tgt_root is a revision, editor's set_target_revision() will be called with the tgt_root's revision number, else it will not be called at all.
If authz_read_func is non-null, invoke it before any call to
editor->open_root editor->add_directory editor->open_directory editor->add_file editor->open_file
passing tgt_root, the same path that would be passed to the editor function in question, and authz_read_baton. If the *allowed parameter comes back TRUE, then proceed with the planned editor call; else if FALSE, then invoke editor->absent_file or editor->absent_directory as appropriate, except if the planned editor call was open_root, throw SVN_ERR_AUTHZ_ROOT_UNREADABLE.
If text_deltas is FALSE
, send a single NULL
txdelta window to the window handler returned by editor->apply_textdelta().
If entry_props is TRUE
, accompany each opened/added entry with propchange editor calls that relay special "entry props" (this is typically used only for working copy updates).
ignore_ancestry instructs the function to ignore node ancestry when determining how to transmit differences.
Before completing successfully, this function calls editor's close_edit(), so the caller should expect its edit_baton to be invalid after its use with this function.
Do any allocation necessary for the delta computation in pool. This function's maximum memory consumption is at most roughly proportional to the greatest depth of the tree under tgt_root, not the total size of the delta.
const char* svn_repos_find_root_path | ( | const char * | path, | |
apr_pool_t * | pool | |||
) |
Find the root path of the repository that contains path.
If a repository was found, the path to the root of the repository is returned, else NULL
. The pointer to the returned path may be equal to path.
svn_error_t* svn_repos_finish_report | ( | void * | report_baton, | |
apr_pool_t * | pool | |||
) |
Given a report_baton constructed by svn_repos_begin_report(), finish the report and drive the editor as specified when the report baton was constructed.
If an error occurs during the driving of the editor, do NOT abort the edit; that responsibility belongs to the caller of this function, if it happens at all.
After the call to this function, report_baton is no longer valid; it should not be passed to any other reporting functions, including svn_repos_abort_report().
svn_fs_t* svn_repos_fs | ( | svn_repos_t * | repos | ) |
Return the filesystem associated with repository object repos.
svn_error_t* svn_repos_get_commit_editor | ( | const svn_delta_editor_t ** | editor, | |
void ** | edit_baton, | |||
svn_repos_t * | repos, | |||
const char * | repos_url, | |||
const char * | base_path, | |||
const char * | user, | |||
const char * | log_msg, | |||
svn_commit_callback_t | callback, | |||
void * | callback_baton, | |||
apr_pool_t * | pool | |||
) |
Similar to svn_repos_get_commit_editor2(), but with txn always set to NULL
.
svn_error_t* svn_repos_get_commit_editor2 | ( | const svn_delta_editor_t ** | editor, | |
void ** | edit_baton, | |||
svn_repos_t * | repos, | |||
svn_fs_txn_t * | txn, | |||
const char * | repos_url, | |||
const char * | base_path, | |||
const char * | user, | |||
const char * | log_msg, | |||
svn_commit_callback_t | callback, | |||
void * | callback_baton, | |||
apr_pool_t * | pool | |||
) |
Similar to svn_repos_get_commit_editor3(), but with authz_callback and authz_baton set to NULL
.
svn_error_t* svn_repos_get_commit_editor3 | ( | const svn_delta_editor_t ** | editor, | |
void ** | edit_baton, | |||
svn_repos_t * | repos, | |||
svn_fs_txn_t * | txn, | |||
const char * | repos_url, | |||
const char * | base_path, | |||
const char * | user, | |||
const char * | log_msg, | |||
svn_commit_callback_t | callback, | |||
void * | callback_baton, | |||
svn_repos_authz_callback_t | authz_callback, | |||
void * | authz_baton, | |||
apr_pool_t * | pool | |||
) |
Similar to svn_repos_get_commit_editor4(), but uses the svn_commit_callback_t type.
svn_error_t* svn_repos_get_commit_editor4 | ( | const svn_delta_editor_t ** | editor, | |
void ** | edit_baton, | |||
svn_repos_t * | repos, | |||
svn_fs_txn_t * | txn, | |||
const char * | repos_url, | |||
const char * | base_path, | |||
const char * | user, | |||
const char * | log_msg, | |||
svn_commit_callback2_t | callback, | |||
void * | callback_baton, | |||
svn_repos_authz_callback_t | authz_callback, | |||
void * | authz_baton, | |||
apr_pool_t * | pool | |||
) |
Return an editor and edit_baton to commit changes to session->fs, beginning at location 'rev:base_path', where "rev" is the argument given to open_root().
repos is a previously opened repository. repos_url is the decoded URL to the base of the repository, and is used to check copyfrom paths. txn is a filesystem transaction object to use during the commit, or NULL
to indicate that this function should create (and fully manage) a new transaction.
Iff user is not NULL
, store it as the author of the commit transaction.
Iff log_msg is not NULL
, store it as the log message associated with the commit transaction.
Iff authz_callback is provided, check read/write authorizations on paths accessed by editor operations. An operation which fails due to authz will return SVN_ERR_AUTHZ_UNREADABLE or SVN_ERR_AUTHZ_UNWRITABLE.
Calling (*editor)->close_edit completes the commit. 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 if there was a post-commit hook failure, then that error will be returned and will have code SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED.
Calling (*editor)->abort_edit aborts the commit, and will also abort the commit transaction unless txn was supplied (not NULL
). Callers who supply their own transactions are responsible for cleaning them up (either by committing them, or aborting them).
svn_error_t* svn_repos_get_committed_info | ( | svn_revnum_t * | committed_rev, | |
const char ** | committed_date, | |||
const char ** | last_author, | |||
svn_fs_root_t * | root, | |||
const char * | path, | |||
apr_pool_t * | pool | |||
) |
Given a root/path within some filesystem, return three pieces of information allocated in pool:.
NULL
if not available.
NULL
if not available. svn_error_t* svn_repos_get_file_revs | ( | svn_repos_t * | repos, | |
const char * | path, | |||
svn_revnum_t | start, | |||
svn_revnum_t | end, | |||
svn_repos_authz_func_t | authz_read_func, | |||
void * | authz_read_baton, | |||
svn_repos_file_rev_handler_t | handler, | |||
void * | handler_baton, | |||
apr_pool_t * | pool | |||
) |
Retrieve a subset of the interesting revisions of a file path in repos as seen in revision end.
Invoke handler with handler_baton as its first argument for each such revision. pool is used for all allocations. See svn_fs_history_prev() for a discussion of interesting revisions.
If optional authz_read_func is non-NULL, then use this function (along with optional authz_read_baton) to check the readability of the rev-path in each interesting revision encountered.
Revision discovery happens from end to start, and if an unreadable revision is encountered before start is reached, then revision discovery stops and only the revisions from end to the oldest readable revision are returned (So it will appear that path was added without history in the latter revision).
If there is an interesting revision of the file that is less than or equal to start, the iteration will start at that revision. Else, the iteration will start at the first revision of the file in the repository, which has to be less than or equal to end. Note that if the function succeeds, handler will have been called at least once.
In a series of calls, the file contents for the first interesting revision will be provided as a text delta against the empty file. In the following calls, the delta will be against the contents for the previous call.
svn_error_t* svn_repos_get_logs | ( | svn_repos_t * | repos, | |
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 | |||
) |
Same as svn_repos_get_logs2(), but with authz_read_func and authz_read_baton always set to NULL.
svn_error_t* svn_repos_get_logs2 | ( | svn_repos_t * | repos, | |
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_repos_authz_func_t | authz_read_func, | |||
void * | authz_read_baton, | |||
svn_log_message_receiver_t | receiver, | |||
void * | receiver_baton, | |||
apr_pool_t * | pool | |||
) |
Same as svn_repos_get_logs3(), but with limit always set to 0.
svn_error_t* svn_repos_get_logs3 | ( | svn_repos_t * | repos, | |
const apr_array_header_t * | paths, | |||
svn_revnum_t | start, | |||
svn_revnum_t | end, | |||
int | limit, | |||
svn_boolean_t | discover_changed_paths, | |||
svn_boolean_t | strict_node_history, | |||
svn_repos_authz_func_t | authz_read_func, | |||
void * | authz_read_baton, | |||
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 in repos's filesystem.
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 or entries changed or any node changed below it). Each path is a const char *
representing an absolute path in the repository.
If limit is non-zero then only invoke receiver on the first limit logs.
If discover_changed_paths, then each call to receiver passes a hash mapping paths committed in that revision to information about them as the receiver's changed_paths argument. Otherwise, each call to receiver passes null for changed_paths.
If strict_node_history is set, copy history (if any exists) will not be traversed while harvesting 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.
If optional authz_read_func is non-NULL, then use this function (along with optional authz_read_baton) to check the readability of each changed-path in each revision about to be "pushed" at receiver. If a revision has all unreadable changed-paths, then don't push the revision at all. If a revision has a mixture of readable and unreadable changed-paths, then silently omit the unreadable changed-paths when pushing the revision.
See also the documentation for svn_log_message_receiver_t
.
Use pool for temporary allocations.
svn_error_t* svn_repos_history | ( | svn_fs_t * | fs, | |
const char * | path, | |||
svn_repos_history_func_t | history_func, | |||
void * | history_baton, | |||
svn_revnum_t | start, | |||
svn_revnum_t | end, | |||
svn_boolean_t | cross_copies, | |||
apr_pool_t * | pool | |||
) |
Similar to svn_repos_history2(), but with authz_read_func and authz_read_baton always set to NULL.
svn_error_t* svn_repos_history2 | ( | svn_fs_t * | fs, | |
const char * | path, | |||
svn_repos_history_func_t | history_func, | |||
void * | history_baton, | |||
svn_repos_authz_func_t | authz_read_func, | |||
void * | authz_read_baton, | |||
svn_revnum_t | start, | |||
svn_revnum_t | end, | |||
svn_boolean_t | cross_copies, | |||
apr_pool_t * | pool | |||
) |
Call history_func (with history_baton) for each interesting history location in the lifetime of path in fs, from the youngest of end and @ start to the oldest.
Only cross filesystem copy history if cross_copies is TRUE
. And do all of this in pool.
If authz_read_func is non-NULL, then use it (and authz_read_baton) to verify that path in end is readable; if not, return SVN_ERR_AUTHZ_UNREADABLE. Also verify the readability of every ancestral path/revision pair before pushing them at history_func. If a pair is deemed unreadable, then do not send them; instead, immediately stop traversing history and return SVN_NO_ERROR.
const char* svn_repos_hook_dir | ( | svn_repos_t * | repos, | |
apr_pool_t * | pool | |||
) |
Return the path to repos's hook directory, allocated in pool.
svn_error_t* svn_repos_hotcopy | ( | const char * | src_path, | |
const char * | dst_path, | |||
svn_boolean_t | clean_logs, | |||
apr_pool_t * | pool | |||
) |
Make a hot copy of the Subversion repository found at src_path to dst_path.
Copy a possibly live Subversion repository from src_path to dst_path. If clean_logs is TRUE
, perform cleanup on the source filesystem as part of the copy operation; currently, this means deleting copied, unused logfiles for a Berkeley DB source repository.
svn_error_t* svn_repos_link_path | ( | void * | report_baton, | |
const char * | path, | |||
const char * | link_path, | |||
svn_revnum_t | revision, | |||
svn_boolean_t | start_empty, | |||
apr_pool_t * | pool | |||
) |
Similar to svn_repos_link_path2(), but with lock_token set to NULL
.
svn_error_t* svn_repos_link_path2 | ( | void * | report_baton, | |
const char * | path, | |||
const char * | link_path, | |||
svn_revnum_t | revision, | |||
svn_boolean_t | start_empty, | |||
const char * | lock_token, | |||
apr_pool_t * | pool | |||
) |
Given a report_baton constructed by svn_repos_begin_report(), record the presence of in the current tree, containing the contents of link_path at revision.
Note that while path is relative to the anchor/target used in the creation of the report_baton, link_path is an absolute filesystem path!
If start_empty is true and path is a directory, then require the caller to explicitly provide all the children of - do not assume that the tree also contains all the children of link_path at revision. This is for 'low confidence' client reporting.
If the caller has a lock token for link_path, then lock_token should be set to that token. Else, lock_token should be NULL.
All temporary allocations are done in pool.
const char* svn_repos_lock_dir | ( | svn_repos_t * | repos, | |
apr_pool_t * | pool | |||
) |
Return path to repos's lock directory, allocated in pool.
svn_error_t* svn_repos_open | ( | svn_repos_t ** | repos_p, | |
const char * | path, | |||
apr_pool_t * | pool | |||
) |
Set *repos_p to a repository object for the repository at path.
Allocate *repos_p in pool.
Acquires a shared lock on the repository, and attaches a cleanup function to pool to remove the lock. If no lock can be acquired, returns error, with undefined effect on *repos_p. If an exclusive lock is present, this blocks until it's gone.
const char* svn_repos_path | ( | svn_repos_t * | repos, | |
apr_pool_t * | pool | |||
) |
Return the top-level repository path allocated in pool.
const char* svn_repos_post_commit_hook | ( | svn_repos_t * | repos, | |
apr_pool_t * | pool | |||
) |
Return the path to repos's post-commit hook, allocated in pool.
const char* svn_repos_pre_commit_hook | ( | svn_repos_t * | repos, | |
apr_pool_t * | pool | |||
) |
Return the path to repos's pre-commit hook, allocated in pool.
svn_error_t* svn_repos_recover | ( | const char * | path, | |
apr_pool_t * | pool | |||
) |
Run database recovery procedures on the repository at path, returning the database to a consistent state.
Use pool for all allocation.
Acquires an exclusive lock on the repository, recovers the database, and releases the lock. If an exclusive lock can't be acquired, returns error.
svn_error_t* svn_repos_recover2 | ( | const char * | path, | |
svn_boolean_t | nonblocking, | |||
svn_error_t *(*)(void *baton) | start_callback, | |||
void * | start_callback_baton, | |||
apr_pool_t * | pool | |||
) |
Run database recovery procedures on the repository at path, returning the database to a consistent state.
Use pool for all allocation.
Acquires an exclusive lock on the repository, recovers the database, and releases the lock. If an exclusive lock can't be acquired, returns error.
If nonblocking is TRUE, an error of type EWOULDBLOCK is returned if the lock is not immediately available.
If start_callback is not NULL, it will be called with start_callback_baton as argument before the recovery starts, but after the exclusive lock has been acquired.
svn_error_t* svn_repos_replay | ( | svn_fs_root_t * | root, | |
const svn_delta_editor_t * | editor, | |||
void * | edit_baton, | |||
apr_pool_t * | pool | |||
) |
Similar to svn_repos_replay2(), but with base_dir set to ""
, low_water_mark set to SVN_INVALID_REVNUM
, send_deltas set to FALSE
, and authz_read_func and authz_read_baton set to NULL
.
svn_error_t* svn_repos_replay2 | ( | svn_fs_root_t * | root, | |
const char * | base_dir, | |||
svn_revnum_t | low_water_mark, | |||
svn_boolean_t | send_deltas, | |||
const svn_delta_editor_t * | editor, | |||
void * | edit_baton, | |||
svn_repos_authz_func_t | authz_read_func, | |||
void * | authz_read_baton, | |||
apr_pool_t * | pool | |||
) |
Use the provided editor and edit_baton to describe the skeletal changes made in a particular filesystem root (revision or transaction).
Changes will be limited to those within base_dir, and if low_water_mark is set to something other than SVN_INVALID_REVNUM
it is assumed that the client has no knowledge of revisions prior to low_water_mark. Together, these two arguments define the portion of the tree that the client is assumed to have knowledge of, and thus any copies of data from outside that part of the tree will be sent in their entirety, not as simple copies or deltas against a previous version.
The editor passed to this function should be aware of the fact that, if send_deltas is false, calls to its change_dir_prop(), change_file_prop(), and apply_textdelta() functions will not contain meaningful data, and merely serve as indications that properties or textual contents were changed.
If send_deltas is TRUE
, the text and property deltas for changes will be sent, otherwise null text deltas and empty prop changes will be used.
If authz_read_func is non-NULL, it will be used to determine if the user has read access to the data being accessed. Data that the user cannot access will be skipped.
svn_error_t* svn_repos_set_path | ( | void * | report_baton, | |
const char * | path, | |||
svn_revnum_t | revision, | |||
svn_boolean_t | start_empty, | |||
apr_pool_t * | pool | |||
) |
Similar to svn_repos_set_path2(), but with lock_token set to NULL
.
svn_error_t* svn_repos_set_path2 | ( | void * | report_baton, | |
const char * | path, | |||
svn_revnum_t | revision, | |||
svn_boolean_t | start_empty, | |||
const char * | lock_token, | |||
apr_pool_t * | pool | |||
) |
Given a report_baton constructed by svn_repos_begin_report(), record the presence of path at revision in the current tree.
path is relative to the anchor/target used in the creation of the report_baton.
revision may be SVN_INVALID_REVNUM if (for example) path represents a locally-added path with no revision number.
The first call of this in a given report usually passes an empty path; this is used to set up the correct root revision for the editor drive.
If start_empty is true and path is a directory, then require the caller to explicitly provide all the children of - do not assume that the tree also contains all the children of path at revision. This is for 'low confidence' client reporting.
If the caller has a lock token for path, then lock_token should be set to that token. Else, lock_token should be NULL.
All temporary allocations are done in pool.
const char* svn_repos_start_commit_hook | ( | svn_repos_t * | repos, | |
apr_pool_t * | pool | |||
) |
Return the path to repos's start-commit hook, allocated in pool.
svn_error_t* svn_repos_stat | ( | svn_dirent_t ** | dirent, | |
svn_fs_root_t * | root, | |||
const char * | path, | |||
apr_pool_t * | pool | |||
) |
Set *dirent to an svn_dirent_t
associated with path in root.
If path does not exist in root, set *dirent to NULL. Use pool for memory allocation.
const char* svn_repos_svnserve_conf | ( | svn_repos_t * | repos, | |
apr_pool_t * | pool | |||
) |
Return path to repos's svnserve.conf, allocated in pool.
svn_error_t* svn_repos_trace_node_locations | ( | svn_fs_t * | fs, | |
apr_hash_t ** | locations, | |||
const char * | fs_path, | |||
svn_revnum_t | peg_revision, | |||
apr_array_header_t * | location_revisions, | |||
svn_repos_authz_func_t | authz_read_func, | |||
void * | authz_read_baton, | |||
apr_pool_t * | pool | |||
) |
Set *locations to be a mapping of the revisions to the paths of the file fs_path present at the repository in revision peg_revision, where the revisions are taken out of the array location_revisions.
location_revisions is an array of svn_revnum_t's and *locations maps 'svn_revnum_t *' to 'const char *'.
If optional authz_read_func is non-NULL, then use it (and authz_read_baton) to verify that the peg-object is readable. If not, return SVN_ERR_AUTHZ_UNREADABLE. Also use the authz_read_func to check that every path returned in the hash is readable. If an unreadable path is encountered, stop tracing and return SVN_NO_ERROR.
pool is used for all allocations.
const svn_version_t* svn_repos_version | ( | void | ) |
Get libsvn_repos version information.