Alien-SVN
view release on metacpan or search on metacpan
src/subversion/subversion/include/svn_delta.h view on Meta::CPAN
*
* 4. A producer must call @c change_dir_prop on a directory either
* before opening any of the directory's subdirs or after closing
* them, but not in the middle.
*
* 5. When the producer calls @c open_file or @c add_file, either:
*
* (a) The producer must follow with any changes to the file
* (@c change_file_prop and/or @c apply_textdelta, as applicable),
* followed by a @c close_file call, before issuing any other file
* or directory calls, or
*
* (b) The producer must follow with a @c change_file_prop call if
* it is applicable, before issuing any other file or directory
* calls; later, after all directory batons including the root
* have been closed, the producer must issue @c apply_textdelta
* and @c close_file calls.
*
* 6. When the producer calls @c apply_textdelta, it must make all of
* the window handler calls (including the @c NULL window at the
* end) before issuing any other #svn_delta_editor_t calls.
*
* So, the producer needs to use directory and file batons as if it
* is doing a single depth-first traversal of the tree, with the
* exception that the producer may keep file batons open in order to
* make @c apply_textdelta calls at the end.
*
*
* <h3>Pool Usage</h3>
*
* Many editor functions are invoked multiple times, in a sequence
* determined by the editor "driver". The driver is responsible for
* creating a pool for use on each iteration of the editor function,
* and clearing that pool between each iteration. The driver passes
* the appropriate pool on each function invocation.
*
* Based on the requirement of calling the editor functions in a
* depth-first style, it is usually customary for the driver to similarly
* nest the pools. However, this is only a safety feature to ensure
* that pools associated with deeper items are always cleared when the
* top-level items are also cleared. The interface does not assume, nor
* require, any particular organization of the pools passed to these
* functions. In fact, if "postfix deltas" are used for files, the file
* pools definitely need to live outside the scope of their parent
* directories' pools.
*
* Note that close_directory can be called *before* a file in that
* directory has been closed. That is, the directory's baton is
* closed before the file's baton. The implication is that
* @c apply_textdelta and @c close_file should not refer to a parent
* directory baton UNLESS the editor has taken precautions to
* allocate it in a pool of the appropriate lifetime (the @a dir_pool
* passed to @c open_directory and @c add_directory definitely does not
* have the proper lifetime). In general, it is recommended to simply
* avoid keeping a parent directory baton in a file baton.
*
*
* <h3>Errors</h3>
*
* At least one implementation of the editor interface is
* asynchronous; an error from one operation may be detected some
* number of operations later. As a result, an editor driver must not
* assume that an error from an editing function resulted from the
* particular operation being detected. Moreover, once an editing
* function (including @c close_edit) returns an error, the edit is
* dead; the only further operation which may be called on the editor
* is @c abort_edit.
*/
typedef struct svn_delta_editor_t
{
/** Set the target revision for this edit to @a target_revision. This
* call, if used, should precede all other editor calls.
*
* @note This is typically used only for server->client update-type
* operations. It doesn't really make much sense for commit-type
* operations, because the revision of a commit isn't known until
* the commit is finalized.
*
* Any temporary allocations may be performed in @a scratch_pool.
*/
svn_error_t *(*set_target_revision)(void *edit_baton,
svn_revnum_t target_revision,
apr_pool_t *scratch_pool);
/** Set @a *root_baton to a baton for the top directory of the change.
* (This is the top of the subtree being changed, not necessarily
* the root of the filesystem.) As with any other directory baton, the
* producer should call @c close_directory on @a root_baton when done.
* And as with other @c open_* calls, the @a base_revision here is the
* current revision of the directory (before getting bumped up to the
* new target revision set with @c set_target_revision).
*
* Allocations for the returned @a root_baton should be performed in
* @a result_pool. It is also typical to (possibly) save this pool for
* later usage by @c close_directory.
*/
svn_error_t *(*open_root)(void *edit_baton,
svn_revnum_t base_revision,
apr_pool_t *result_pool,
void **root_baton);
/** Remove the directory entry at @a path, a child of the directory
* represented by @a parent_baton. If @a revision is a valid
* revision number, it is used as a sanity check to ensure that you
* are really removing the revision of @a path that you think you are.
*
* Any temporary allocations may be performed in @a scratch_pool.
*
* @note The @a revision parameter is typically used only for
* client->server commit-type operations, allowing the server to
* verify that it is deleting what the client thinks it should be
* deleting. It only really makes sense in the opposite direction
* (during server->client update-type operations) when the trees
* whose delta is being described are ancestrally related (that is,
* one tree is an ancestor of the other).
*/
svn_error_t *(*delete_entry)(const char *path,
svn_revnum_t revision,
void *parent_baton,
apr_pool_t *scratch_pool);
( run in 0.511 second using v1.01-cache-2.11-cpan-d7f47b0818f )