📄 svn_repos.h
字号:
/** Return the path to @a repos's pre-revprop-change hook, allocated in * @a pool. */const char *svn_repos_pre_revprop_change_hook(svn_repos_t *repos, apr_pool_t *pool);/** Return the path to @a repos's post-revprop-change hook, allocated in * @a pool. */const char *svn_repos_post_revprop_change_hook(svn_repos_t *repos, apr_pool_t *pool);/** @defgroup svn_repos_lock_hooks paths to lock hooks * @{ * @since New in 1.2. *//** Return the path to @a repos's pre-lock hook, allocated in @a pool. */const char *svn_repos_pre_lock_hook(svn_repos_t *repos, apr_pool_t *pool);/** Return the path to @a repos's post-lock hook, allocated in @a pool. */const char *svn_repos_post_lock_hook(svn_repos_t *repos, apr_pool_t *pool);/** Return the path to @a repos's pre-unlock hook, allocated in @a pool. */const char *svn_repos_pre_unlock_hook(svn_repos_t *repos, apr_pool_t *pool);/** Return the path to @a repos's post-unlock hook, allocated in @a pool. */const char *svn_repos_post_unlock_hook(svn_repos_t *repos, apr_pool_t *pool);/** @} *//* ---------------------------------------------------------------*//* Reporting the state of a working copy, for updates. *//** * Construct and return a @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, * @a editor/@a edit_baton will be driven in such a way as to transform the * existing tree to @a revnum and, if @a tgt_path is non-NULL, switch the * reported hierarchy to @a tgt_path. * * @a fs_base is the absolute path of the node in the filesystem at which * the comparison should be rooted. @a target is a single path component, * used to limit the scope of the report to a single entry of @a fs_base, * or "" if all of @a fs_base itself is the main subject of the report. * * @a tgt_path and @a revnum is the fs path/revision pair that is the * "target" of the delta. @a tgt_path should be provided only when * the source and target paths of the report differ. That is, @a 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 @a tgt_path at revision @a revnum. A @c NULL value for @a tgt_path * will indicate that the editor should be driven in such a way as to * transform the reported hierarchy to revision @a revnum, preserving the * reported hierarchy. * * @a text_deltas instructs the driver of the @a editor to enable * the generation of text deltas. * * @a recurse instructs the driver of the @a editor to send a recursive * delta (or not.) * * @a ignore_ancestry instructs the driver to ignore node ancestry * when determining how to transmit differences. * * The @a authz_read_func and @a 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 * @a pool. * * @note @a username isn't used and should be removed if this function is * revised. */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);/** * Given a @a report_baton constructed by svn_repos_begin_report(), * record the presence of @a path at @a revision in the current tree. * * @a path is relative to the anchor/target used in the creation of the * @a report_baton. * * @a revision may be SVN_INVALID_REVNUM if (for example) @a path represents * a locally-added path with no revision number. * * The first call of this in a given report usually passes an empty * @a path; this is used to set up the correct root revision for the editor * drive. * * If @a start_empty is true and @a path is a directory, then require the * caller to explicitly provide all the children of @path - do not assume * that the tree also contains all the children of @a path at @a revision. * This is for 'low confidence' client reporting. * * If the caller has a lock token for @a path, then @a lock_token should * be set to that token. Else, @a lock_token should be NULL. * * All temporary allocations are done in @a pool. * * @since New in 1.2. */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);/** * Similar to svn_repos_set_path2(), but with @a lock_token set to @c NULL. * * @deprecated Provided for backward compatibility with the 1.1 API. */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);/** * Given a @a report_baton constructed by svn_repos_begin_report(), * record the presence of @path in the current tree, containing the contents * of @a link_path at @a revision. * * Note that while @a path is relative to the anchor/target used in the * creation of the @a report_baton, @a link_path is an absolute filesystem * path! * * If @a start_empty is true and @a path is a directory, then require the * caller to explicitly provide all the children of @path - do not assume * that the tree also contains all the children of @a link_path at * @a revision. This is for 'low confidence' client reporting. * * If the caller has a lock token for @a link_path, then @a lock_token * should be set to that token. Else, @a lock_token should be NULL. * * All temporary allocations are done in @a pool. * * @since New in 1.2. */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);/** * Similar to svn_repos_link_path2(), but with @a lock_token set to @c NULL. * * @deprecated Provided for backward compatibility with the 1.1 API. */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);/** Given a @a report_baton constructed by svn_repos_begin_report(), * record the non-existence of @a 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 @a pool. */svn_error_t *svn_repos_delete_path(void *report_baton, const char *path, apr_pool_t *pool);/** Given a @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, @a report_baton is no longer valid; * it should not be passed to any other reporting functions, including * svn_repos_abort_report(). */svn_error_t *svn_repos_finish_report(void *report_baton, apr_pool_t *pool);/** Given a @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, @a report_baton is no longer valid; * it should not be passed to any other reporting functions. */svn_error_t *svn_repos_abort_report(void *report_baton, apr_pool_t *pool);/* ---------------------------------------------------------------*//* The magical dir_delta update routines. *//** Use the provided @a editor and @a edit_baton to describe the changes * necessary for making a given node (and its descendants, if it is a * directory) under @a src_root look exactly like @a tgt_path under * @a tgt_root. @a src_entry is the node to update. If @a src_entry * is empty, then compute the difference between the entire tree * anchored at @a src_parent_dir under @a src_root and @a tgt_path * under @a target_root. Else, describe the changes needed to update * only that entry in @a src_parent_dir. Typically, callers of this * function will use a @a tgt_path that is the concatenation of @a * src_parent_dir and @a src_entry. * * @a src_root and @a tgt_root can both be either revision or transaction * roots. If @a tgt_root is a revision, @a editor's set_target_revision() * will be called with the @a tgt_root's revision number, else it will * not be called at all. * * If @a authz_read_func is non-null, invoke it before any call to * * @a editor->open_root * @a editor->add_directory * @a editor->open_directory * @a editor->add_file * @a editor->open_file * * passing @a tgt_root, the same path that would be passed to the * editor function in question, and @a authz_read_baton. If the * @a *allowed parameter comes back TRUE, then proceed with the planned * editor call; else if FALSE, then invoke @a editor->absent_file or * @a editor->absent_directory as appropriate, except if the planned * editor call was open_root, throw SVN_ERR_AUTHZ_ROOT_UNREADABLE. * * If @a text_deltas is @c FALSE, send a single @c NULL txdelta window to * the window handler returned by @a editor->apply_textdelta(). * * If @a entry_props is @c TRUE, accompany each opened/added entry with * propchange editor calls that relay special "entry props" (this * is typically used only for working copy updates). * * @a ignore_ancestry instructs the function to ignore node ancestry * when determining how to transmit differences. * * Before completing successfully, this function calls @a editor's * close_edit(), so the caller should expect its @a edit_baton to be * invalid after its use with this function. * * Do any allocation necessary for the delta computation in @a pool. * This function's maximum memory consumption is at most roughly * proportional to the greatest depth of the tree under @a tgt_root, not * the total size of the delta. */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 @a editor and @a edit_baton to describe the * skeletal changes made in a particular filesystem @a root * (revision or transaction). * * Changes will be limited to those within @a base_dir, and if * @a low_water_mark is set to something other than @c SVN_INVALID_REVNUM * it is assumed that the client has no knowledge of revisions prior to * @a 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 @a editor passed to this function should be aware of the fact * that, if @a 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 @a send_deltas is @c TRUE, the text and property deltas for changes * will be sent, otherwise null text deltas and empty prop changes will be * used. * * If @a 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. * * @note This editor driver passes SVN_INVALID_REVNUM for all * revision parameters in the editor interface except the copyfrom * parameter of the add_file() and add_directory() editor functions. * * @since New in 1.4. */svn_error_t *
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -