📄 svn_repos.h
字号:
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);
/**
* @deprecated Provided for backward compatibility with the 1.0.0 API.
*
* Similar to svn_repos_fs_change_rev_prop2(), but with the
* @a authz_read_func parameter always NULL.
*/
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);
/**
* @since New in 1.1.
*
* Set @a *value_p to the value of the property named @a propname on
* revision @a rev in the filesystem opened in @a repos. If @a rev
* has no property by that name, set @a *value_p to zero. Allocate
* the result in @a pool.
*
* If @a authz_read_func is non-NULL, then use it (with @a
* authz_read_baton) to validate the changed-paths associated with @a
* rev. If the changed-paths are all unreadable, then set @a *value_p
* to zero unconditionally. If only some of the changed-paths are
* unreadable, then allow 'svn:author' and 'svn:date' propvalues to be
* fetched, but return 0 for any other property.
*/
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);
/**
* @since New in 1.1.
*
* Set @a *table_p to the entire property list of revision @a rev in
* filesystem opened in @a repos, as a hash table allocated in @a
* pool. The table maps <tt>char *</tt> property names to @c
* svn_string_t * values; the names and values are allocated in @a
* pool.
*
* If @a authz_read_func is non-NULL, then use it (with @a
* authz_read_baton) to validate the changed-paths associated with @a
* rev. If the changed-paths are all unreadable, then return an empty
* hash. If only some of the changed-paths are unreadable, then return
* an empty hash, except for 'svn:author' and 'svn:date' properties
* (assuming those properties exist).
*/
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);
/* ---------------------------------------------------------------*/
/* Prop-changing wrappers for libsvn_fs routines. */
/* NOTE: svn_repos_fs_change_rev_prop() also exists, but is located
above with the hook-related functions. */
/** Validating wrapper for @c svn_fs_change_node_prop() (which see for
* argument descriptions).
*/
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 @c svn_fs_change_txn_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);
/** @} */
/* ---------------------------------------------------------------*/
/**
* @defgroup svn_repos_inspection Data structures and editor things for
* repository inspection.
* @{
*
* As it turns out, the @c svn_repos_dir_delta() interface can be
* extremely useful for examining the repository, or more exactly,
* changes to the repository. @c svn_repos_dir_delta() allows for
* differences between two trees to be described using an editor.
*
* By using the specific editor found below in conjunction with
* @c svn_repos_dir_delta(), the description of how to transform one tree
* into another can be used to build an in-memory linked-list tree,
* which each node representing a repository node that was changed as a
* result of having @c svn_repos_dir_delta() drive that editor.
*/
/** A node in the repository. */
typedef struct svn_repos_node_t
{
/** Node type (file, dir, etc.) */
svn_node_kind_t kind;
/** How this node entered the node tree: 'A'dd, 'D'elete, 'R'eplace */
char action;
/** Were there any textual mods? (files only) */
svn_boolean_t text_mod;
/** Where there any property mods? */
svn_boolean_t prop_mod;
/** The name of this node as it appears in its parent's entries list */
const char *name;
/** The filesystem revision where this was copied from (if any) */
svn_revnum_t copyfrom_rev;
/** The filesystem path where this was copied from (if any) */
const char *copyfrom_path;
/** Pointer to the next sibling of this node */
struct svn_repos_node_t *sibling;
/** Pointer to the first child of this node */
struct svn_repos_node_t *child;
/** Pointer to the parent of this node */
struct svn_repos_node_t *parent;
} svn_repos_node_t;
/** Set @a *editor and @a *edit_baton to an editor that, when driven by
* @c svn_repos_dir_delta(), builds an <tt>svn_repos_node_t *</tt> tree
* representing the delta from @a base_root to @a root in @a repos's
* filesystem.
*
* Invoke @c svn_repos_node_from_baton() on @a edit_baton to obtain the root
* node afterwards.
*
* Note that the delta includes "bubbled-up" directories; that is,
* many of the directory nodes will have no prop_mods.
*
* Allocate the tree and its contents in @a node_pool; do all other
* allocation in @a pool.
*/
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);
/** Return the root node of the linked-list tree generated by driving
* the editor created by @c svn_repos_node_editor() with
* @c svn_repos_dir_delta(), which is stored in @a edit_baton. This is
* only really useful if used *after* the editor drive is completed.
*/
svn_repos_node_t *svn_repos_node_from_baton (void *edit_baton);
/** @} */
/* ---------------------------------------------------------------*/
/**
* @defgroup svn_repos_dump_load Dumping and loading filesystem data
* @{
*
* The filesystem 'dump' format contains nothing but the abstract
* structure of the filesystem -- independent of any internal node-id
* schema or database back-end. All of the data in the dumpfile is
* acquired by public function calls into svn_fs.h. Similarly, the
* parser which reads the dumpfile is able to reconstruct the
* filesystem using only public svn_fs.h routines.
*
* Thus the dump/load feature's main purpose is for *migrating* data
* from one svn filesystem to another -- presumably two filesystems
* which have different internal implementations.
*
* If you simply want to backup your filesystem, you're probably
* better off using the built-in facilities of the DB backend (using
* Berkeley DB's hot-backup feature, for example.)
*
* For a description of the dumpfile format, see
* /trunk/notes/fs_dumprestore.txt.
*/
/* The RFC822-style headers in our dumpfile format. */
#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"
/* @since New in 1.1. */
#define SVN_REPOS_DUMPFILE_PROP_DELTA "Prop-delta"
/* @since New in 1.1. */
#define SVN_REPOS_DUMPFILE_TEXT_DELTA "Text-delta"
/** The different "actions" attached to nodes in the dumpfile. */
enum svn_node_action
{
svn_node_action_change,
svn_node_action_add,
svn_node_action_delete,
svn_node_action_replace
};
/** The different policies for processing the UUID in the dumpfile. */
enum svn_repos_load_uuid
{
svn_repos_load_uuid_default,
svn_repos_load_uuid_ignore,
svn_repos_load_uuid_force
};
/**
* @since New in 1.1.
*
* Dump the contents of the filesystem within already-open @a repos into
* writable @a dumpstream. Begin at revision @a start_rev, and dump every
* revision up through @a end_rev. Use @a pool for all allocation. If
* non-@c NULL, send feedback to @a feedback_stream. @a dumpstream can be
* @c NULL for the purpose of verifying the repository.
*
* If @a start_rev is @c SVN_INVALID_REVNUM, then start dumping at revision
* 0. If @a end_rev is @c SVN_INVALID_REVNUM, then dump through the @c HEAD
* revision.
*
* If @a incremental is @c TRUE, the first revision dumped will be a diff
* against the previous revision (usually it looks like a full dump of
* the tree).
*
* If @a use_deltas is @c TRUE, output only node properties which have
* changed relative to the previous contents, and output text contents
* as svndiff data against the previous contents. Regardless of how
* this flag is set, the first revision of a non-incremental dump will
* be done with full plain text. A dump with @a use_deltas set cannot
* be loaded by Subversion 1.0.x.
*
* If @a cancel_func is not @c NULL, it is called periodically with
* @a cancel_baton as argument to see if the client wishes to cancel
* the dump.
*/
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,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -