tree deltas

Traversing tree deltas. More...

Data Structures

struct  svn_delta_editor_t
 A structure full of callback functions the delta source will invoke as it produces the delta. More...

Functions

svn_delta_editor_tsvn_delta_default_editor (apr_pool_t *pool)
 Return a default delta editor template, allocated in pool.
svn_error_tsvn_delta_noop_window_handler (svn_txdelta_window_t *window, void *baton)
 A text-delta window handler which does nothing.
svn_error_tsvn_delta_get_cancellation_editor (svn_cancel_func_t cancel_func, void *cancel_baton, const svn_delta_editor_t *wrapped_editor, void *wrapped_baton, const svn_delta_editor_t **editor, void **edit_baton, apr_pool_t *pool)
 Return a cancellation editor that wraps wrapped_editor.

Detailed Description

Traversing tree deltas.

In Subversion, we've got various producers and consumers of tree deltas.

In processing a `commit' command:

In processing an `update' command, the process is reversed:

The simplest approach would be to represent tree deltas using the obvious data structure. To do an update, the server would construct a delta structure, and the working copy library would apply that structure to the working copy; WebDAV's job would simply be to get the structure across the net intact.

However, we expect that these deltas will occasionally be too large to fit in a typical workstation's swap area. For example, in checking out a 200Mb source tree, the entire source tree is represented by a single tree delta. So it's important to handle deltas that are too large to fit in swap all at once.

So instead of representing the tree delta explicitly, we define a standard way for a consumer to process each piece of a tree delta as soon as the producer creates it. The svn_delta_editor_t structure is a set of callback functions to be defined by a delta consumer, and invoked by a delta producer. Each invocation of a callback function describes a piece of the delta --- a file's contents changing, something being renamed, etc.


Function Documentation

svn_delta_editor_t* svn_delta_default_editor apr_pool_t *  pool  ) 
 

Return a default delta editor template, allocated in pool.

The editor functions in the template do only the most basic baton-swapping: each editor function that produces a baton does so by copying its incoming baton into the outgoing baton reference.

This editor is not intended to be useful by itself, but is meant to be the basis for a useful editor. After getting a default editor, you substitute in your own implementations for the editor functions you care about. The ones you don't care about, you don't have to implement -- you can rely on the template's implementation to safely do nothing of consequence.

svn_error_t* svn_delta_get_cancellation_editor svn_cancel_func_t  cancel_func,
void *  cancel_baton,
const svn_delta_editor_t wrapped_editor,
void *  wrapped_baton,
const svn_delta_editor_t **  editor,
void **  edit_baton,
apr_pool_t *  pool
 

Return a cancellation editor that wraps wrapped_editor.

The editor will call cancel_func with cancel_baton when each of its functions is called, continuing on to call the corresponding wrapped function if it returns SVN_NO_ERROR.

If cancel_func is NULL, *editor is set to wrapped_editor and *edit_baton is set to wrapped_baton.

svn_error_t* svn_delta_noop_window_handler svn_txdelta_window_t window,
void *  baton
 

A text-delta window handler which does nothing.

Editors can return this handler from apply_textdelta if they don't care about text delta windows.


Generated on Mon May 8 07:45:44 2006 for Subversion by  doxygen 1.4.6