svn_repos.h File Reference

Tools built on top of the filesystem. More...

#include <apr_pools.h>
#include <apr_hash.h>
#include "svn_fs.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_parse_fns_t
 A vtable that is driven by svn_repos_parse_dumpstream(). More...

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_delta2().
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)
 Similar to svn_file_rev_handler_t, but without the result_of_merge parameter.
typedef 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_node_t svn_repos_node_t
 A node in the repository.
typedef svn_repos_parse_fns2_t svn_repos_parse_fns2_t
 A vtable that is driven by svn_repos_parse_dumpstream2().
typedef svn_repos_parse_fns2_t svn_repos_parser_fns2_t
typedef svn_repos_parse_fns_t svn_repos_parser_fns_t
 A vtable that is driven by svn_repos_parse_dumpstream().
typedef 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.
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.
enum  svn_repos_revision_access_level_t {
  svn_repos_revision_access_none,
  svn_repos_revision_access_partial,
  svn_repos_revision_access_full
}
 An enum defining levels of revision access. More...

Functions

const svn_version_tsvn_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_tsvn_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_tsvn_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_tsvn_repos_upgrade (const char *path, svn_boolean_t nonblocking, svn_error_t *(*start_callback)(void *baton), void *start_callback_baton, apr_pool_t *pool)
 Upgrade the Subversion repository (and its underlying versioned filesystem) located in the directory path to the latest version supported by this library.
svn_error_tsvn_repos_delete (const char *path, apr_pool_t *pool)
 Destroy the Subversion repository found at path, using pool for any necessary allocations.
svn_error_tsvn_repos_has_capability (svn_repos_t *repos, svn_boolean_t *has, const char *capability, apr_pool_t *pool)
 Set *has to TRUE if repos has capability (one of the capabilities beginning with "SVN_REPOS_CAPABILITY_"), else set *has to FALSE.
svn_fs_tsvn_repos_fs (svn_repos_t *repos)
 Return the filesystem associated with repository object repos.
svn_error_tsvn_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_tsvn_repos_recover3 (const char *path, svn_boolean_t nonblocking, svn_error_t *(*start_callback)(void *baton), void *start_callback_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
 Run database recovery procedures on the repository at path, returning the database to a consistent state.
SVN_DEPRECATED svn_error_tsvn_repos_recover2 (const char *path, svn_boolean_t nonblocking, svn_error_t *(*start_callback)(void *baton), void *start_callback_baton, apr_pool_t *pool)
 Similar to svn_repos_recover3(), but without cancellation support.
SVN_DEPRECATED svn_error_tsvn_repos_recover (const char *path, apr_pool_t *pool)
 Similar to svn_repos_recover2(), but with nonblocking set to FALSE, and with no callbacks provided.
svn_error_tsvn_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_tsvn_repos_begin_report2 (void **report_baton, svn_revnum_t revnum, svn_repos_t *repos, const char *fs_base, const char *target, const char *tgt_path, svn_boolean_t text_deltas, svn_depth_t depth, svn_boolean_t ignore_ancestry, svn_boolean_t send_copyfrom_args, 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_DEPRECATED svn_error_tsvn_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)
 The same as svn_repos_begin_report2(), but taking a boolean recurse flag, and sending FALSE for send_copyfrom_args.
svn_error_tsvn_repos_set_path3 (void *report_baton, const char *path, svn_revnum_t revision, svn_depth_t depth, svn_boolean_t start_empty, const char *lock_token, apr_pool_t *pool)
 Given a report_baton constructed by svn_repos_begin_report2(), record the presence of path, at revision with depth depth, in the current tree.
SVN_DEPRECATED svn_error_tsvn_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)
 Similar to svn_repos_set_path3(), but with depth set to svn_depth_infinity.
SVN_DEPRECATED svn_error_tsvn_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_tsvn_repos_link_path3 (void *report_baton, const char *path, const char *link_path, svn_revnum_t revision, svn_depth_t depth, svn_boolean_t start_empty, const char *lock_token, apr_pool_t *pool)
 Given a report_baton constructed by svn_repos_begin_report2(), record the presence of path in the current tree, containing the contents of link_path at revision with depth depth.
SVN_DEPRECATED svn_error_tsvn_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)
 Similar to svn_repos_link_path3(), but with depth set to svn_depth_infinity.
SVN_DEPRECATED svn_error_tsvn_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_tsvn_repos_delete_path (void *report_baton, const char *path, apr_pool_t *pool)
 Given a report_baton constructed by svn_repos_begin_report2(), record the non-existence of path in the current tree.
svn_error_tsvn_repos_finish_report (void *report_baton, apr_pool_t *pool)
 Given a report_baton constructed by svn_repos_begin_report2(), finish the report and drive the editor as specified when the report baton was constructed.
svn_error_tsvn_repos_abort_report (void *report_baton, apr_pool_t *pool)
 Given a report_baton constructed by svn_repos_begin_report2(), abort the report.
svn_error_tsvn_repos_dir_delta2 (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_depth_t depth, 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_DEPRECATED svn_error_tsvn_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)
 Similar to svn_repos_dir_delta2(), but if recurse is TRUE, pass svn_depth_infinity for depth, and if recurse is FALSE, pass svn_depth_files for depth.
svn_error_tsvn_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_DEPRECATED svn_error_tsvn_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_tsvn_repos_get_commit_editor5 (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, apr_hash_t *revprop_table, 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 the filesystem of repos, beginning at location 'rev:base_path', where "rev" is the argument given to open_root().
SVN_DEPRECATED svn_error_tsvn_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)
 Similar to svn_repos_get_commit_editor5(), but with revprop_table set to a hash containing user and log_msg as the SVN_PROP_REVISION_AUTHOR and SVN_PROP_REVISION_LOG properties, respectively.
SVN_DEPRECATED svn_error_tsvn_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_DEPRECATED svn_error_tsvn_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_DEPRECATED svn_error_tsvn_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_tsvn_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_tsvn_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_tsvn_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_tsvn_repos_deleted_rev (svn_fs_t *fs, const char *path, svn_revnum_t start, svn_revnum_t end, svn_revnum_t *deleted, apr_pool_t *pool)
 Given path which exists at revision start in fs, set *deleted to the revision path was first deleted, within the inclusive revision range set by start and end.
svn_error_tsvn_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_DEPRECATED svn_error_tsvn_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_tsvn_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_tsvn_repos_node_location_segments (svn_repos_t *repos, const char *path, svn_revnum_t peg_revision, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_location_segment_receiver_t receiver, void *receiver_baton, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool)
 Call receiver and receiver_baton to report successive location segments in revisions between start_rev and end_rev (inclusive) for the line of history identified by the peg-object path in peg_revision (and in repos).
svn_error_tsvn_repos_get_logs4 (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_boolean_t include_merged_revisions, const apr_array_header_t *revprops, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, svn_log_entry_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_DEPRECATED svn_error_tsvn_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)
 Same as svn_repos_get_logs4(), but with receiver being svn_log_message_receiver_t instead of svn_log_entry_receiver_t.
SVN_DEPRECATED svn_error_tsvn_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_DEPRECATED svn_error_tsvn_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_tsvn_repos_fs_get_mergeinfo (svn_mergeinfo_catalog_t *catalog, svn_repos_t *repos, const apr_array_header_t *paths, svn_revnum_t revision, svn_mergeinfo_inheritance_t inherit, svn_boolean_t include_descendants, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool)
 Fetch the mergeinfo for paths at revision in repos, and set *catalog to a catalog of this mergeinfo.
svn_error_tsvn_repos_get_file_revs2 (svn_repos_t *repos, const char *path, svn_revnum_t start, svn_revnum_t end, svn_boolean_t include_merged_revisions, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, svn_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_DEPRECATED svn_error_tsvn_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)
 Similar to svn_repos_get_file_revs2(), with include_merged_revisions set to FALSE.
svn_error_tsvn_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_tsvn_repos_fs_begin_txn_for_commit2 (svn_fs_txn_t **txn_p, svn_repos_t *repos, svn_revnum_t rev, apr_hash_t *revprop_table, apr_pool_t *pool)
 Like svn_fs_begin_txn(), but use revprop_table, a hash mapping const char * property names to svn_string_t values, to set the properties on transaction *txn_p.
SVN_DEPRECATED svn_error_tsvn_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)
 Same as svn_repos_fs_begin_txn_for_commit2(), but with revprop_table set to a hash containing author and log_msg as the SVN_PROP_REVISION_AUTHOR and SVN_PROP_REVISION_LOG properties, respectively.
svn_error_tsvn_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_tsvn_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_tsvn_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_tsvn_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_tsvn_repos_fs_change_rev_prop3 (svn_repos_t *repos, svn_revnum_t rev, const char *author, const char *name, const svn_string_t *new_value, svn_boolean_t use_pre_revprop_change_hook, svn_boolean_t use_post_revprop_change_hook, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool)
 Like svn_fs_change_rev_prop(), but validate the name and value of the property and invoke the repos's pre- and post-revprop-change hooks around the change as specified by use_pre_revprop_change_hook and use_post_revprop_change_hook (respectively).
SVN_DEPRECATED svn_error_tsvn_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)
 Similar to svn_repos_fs_change_rev_prop3(), but with the use_pre_revprop_change_hook and use_post_revprop_change_hook always set to TRUE.
SVN_DEPRECATED svn_error_tsvn_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_tsvn_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_tsvn_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_tsvn_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_tsvn_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_tsvn_repos_fs_change_txn_props (svn_fs_txn_t *txn, apr_array_header_t *props, apr_pool_t *pool)
 Validating wrapper for svn_fs_change_txn_props() (which see for argument descriptions).
svn_error_tsvn_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_delta2(), builds an svn_repos_node_t * tree representing the delta from base_root to root in repos's filesystem.
svn_repos_node_tsvn_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_delta2(), which is stored in edit_baton.
svn_error_tsvn_repos_verify_fs (svn_repos_t *repos, svn_stream_t *feedback_stream, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
 Verify the contents of the file system in repos.
svn_error_tsvn_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_DEPRECATED svn_error_tsvn_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_tsvn_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_DEPRECATED svn_error_tsvn_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_tsvn_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_tsvn_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_DEPRECATED svn_error_tsvn_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_DEPRECATED svn_error_tsvn_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_tsvn_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_tsvn_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.
svn_error_tsvn_repos_check_revision_access (svn_repos_revision_access_level_t *access_level, svn_repos_t *repos, svn_revnum_t revision, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool)
 Set access to the access level granted for revision in repos, as determined by consulting the authz_read_func callback function and its associated authz_read_baton.
svn_error_tsvn_repos_remember_client_capabilities (svn_repos_t *repos, apr_array_header_t *capabilities)
 Store in repos the client-reported capabilities capabilities, which must be allocated in memory at least as long-lived as repos.


Detailed Description

Tools built on top of the filesystem.

Definition in file svn_repos.h.


Typedef Documentation

typedef struct svn_authz_t svn_authz_t
 

A data type which stores the authz information.

Since:
New in 1.3.

Definition at line 2460 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_delta2(), 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 133 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_delta2().

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.

Note:
If someday we want more sophisticated authorization states than just yes/no, allowed can become an enum type.

Definition at line 71 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)
 

Similar to svn_file_rev_handler_t, but without the result_of_merge parameter.

Deprecated:
Provided for backward compatibility with 1.4 API.
Since:
New in 1.1.

Definition at line 148 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.

Signal to callback driver to stop processing/invoking this callback by returning the SVN_ERR_CEASE_INVOCATION error code.

Note:
SVN_ERR_CEASE_INVOCATION is new in 1.5.

Definition at line 1190 of file svn_repos.h.


Enumeration Type Documentation

enum svn_repos_authz_access_t
 

An enum defining the kinds of access authz looks up.

Since:
New in 1.3.
Enumeration values:
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 82 of file svn_repos.h.

enum svn_repos_revision_access_level_t
 

An enum defining levels of revision access.

Since:
New in 1.5.

Definition at line 2556 of file svn_repos.h.


Function Documentation

svn_error_t* svn_repos_abort_report void *  report_baton,
apr_pool_t *  pool
 

Given a report_baton constructed by svn_repos_begin_report2(), 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.

Since:
New in 1.3.

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.

Since:
New in 1.3.

SVN_DEPRECATED 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
 

The same as svn_repos_begin_report2(), but taking a boolean recurse flag, and sending FALSE for send_copyfrom_args.

If recurse is TRUE, the editor driver will drive the editor with a depth of svn_depth_infinity; if FALSE, then with a depth of svn_depth_files.

Note:
username is ignored, and has been removed in a revised version of this API.

Deprecated:
Provided for backward compatibility with the 1.4 API.

svn_error_t* svn_repos_begin_report2 void **  report_baton,
svn_revnum_t  revnum,
svn_repos_t repos,
const char *  fs_base,
const char *  target,
const char *  tgt_path,
svn_boolean_t  text_deltas,
svn_depth_t  depth,
svn_boolean_t  ignore_ancestry,
svn_boolean_t  send_copyfrom_args,
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.

ignore_ancestry instructs the driver to ignore node ancestry when determining how to transmit differences.

send_copyfrom_args instructs the driver to send 'copyfrom' arguments to the editor's add_file() and add_directory() methods, whenever it deems feasible.

The authz_read_func and authz_read_baton are passed along to svn_repos_dir_delta2(); see that function for how they are used.

All allocation for the context and collected state will occur in pool.

depth is the requested depth of the editor drive.

If depth is svn_depth_unknown, the editor will affect only the paths reported by the individual calls to svn_repos_set_path3 and svn_repos_link_path3.

For example, if the reported tree is the A subdir of the Greek Tree (see Subversion's test suite), at depth svn_depth_empty, but the A/B subdir is reported at depth svn_depth_infinity, then repository-side changes to A/mu, or underneath A/C and A/D, would not be reflected in the editor drive, but changes underneath A/B would be.

Additionally, the editor driver will call add_directory and and add_file for directories with an appropriate depth. For example, a directory reported at svn_depth_files will receive file (but not directory) additions. A directory at svn_depth_empty will receive neither.

If depth is svn_depth_files, svn_depth_immediates or svn_depth_infinity and depth is greater than the reported depth of the working copy, then the editor driver will emit editor operations so as to upgrade the working copy to this depth.

If depth is svn_depth_empty, svn_depth_files, svn_depth_immediates and depth is lower than or equal to the depth of the working copy, then the editor operations will affect only paths at or above depth.

Since:
New in 1.5.

svn_error_t* svn_repos_check_revision_access svn_repos_revision_access_level_t access_level,
svn_repos_t repos,
svn_revnum_t  revision,
svn_repos_authz_func_t  authz_read_func,
void *  authz_read_baton,
apr_pool_t *  pool
 

Set access to the access level granted for revision in repos, as determined by consulting the authz_read_func callback function and its associated authz_read_baton.

authz_read_func may be NULL, in which case access will be set to svn_repos_revision_access_full.

Since:
New in 1.5.

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.

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.

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.

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_report2(), record the non-existence of path in the current tree.

path may not be underneath a path on