[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: rev 3444 - trunk/subversion/include trunk/subversion/svnlook trunk/subversion/libsvn_repos

From: Greg Stein <gstein_at_lyra.org>
Date: 2002-10-23 03:11:01 CEST

On Tue, Oct 22, 2002 at 04:22:47PM -0500, cmpilato@tigris.org wrote:
>...
> (apply_textdelta): No longer bother with handler baton.

Shouldn't even bother with a handler. If you return NULL for the handler
(allowed under the new editor), then the driver knows to avoid performing a
delta drive. The comment from svn_delta.h:

     If *HANDLER is set to NULL, then the editor is indicating to the
     driver that it is not interested in receiving information about
     the changes in this file. The driver can use this information to
     avoid computing changes. Note that the editor knows the change
     has occurred (by virtue of this function being invoked), but is
     simply indicating that it doesn't want the details. */

>...
> +++ trunk/subversion/libsvn_repos/node_tree.c Tue Oct 22 16:22:47 2002
>...
> +static svn_error_t *
> +add_open_helper (const char *path,
> + char action,
> + svn_node_kind_t kind,
> + void *parent_baton,
> + const char *copyfrom_path,
> + svn_revnum_t copyfrom_rev,
> + apr_pool_t *pool,
> + void **child_baton)
> +{
> + struct node_baton *pb = (struct node_baton *) parent_baton;
> + struct edit_baton *eb = pb->edit_baton;
> + struct node_baton *nb = apr_pcalloc (pool, sizeof (*nb));
> +
> + assert (parent_baton && path);
> +
> + nb->edit_baton = eb;
> + nb->parent_baton = pb;
> +
> + /* Create and populate the node. */
> + nb->node = create_child_node (pb->node, svn_path_basename (path, pool),
> + eb->node_pool);
> + nb->node->kind = kind;
> + nb->node->action = action;
> + nb->node->copyfrom_rev = copyfrom_rev;
> + nb->node->copyfrom_path =
> + copyfrom_path ? apr_pstrdup (eb->node_pool, copyfrom_path) : NULL;
> +
> + *child_baton = nb;
> return SVN_NO_ERROR;
> }
>
>
> static svn_error_t *
> open_root (void *edit_baton,
> - svn_revnum_t base_revision,
> - void **root_baton)
> + svn_revnum_t base_revision,
> + apr_pool_t *pool,
> + void **root_baton)
> {
> struct edit_baton *eb = (struct edit_baton *) edit_baton;
> - struct dir_baton *d = apr_pcalloc (eb->pool, sizeof (*d));
> + struct node_baton *d = apr_pcalloc (pool, sizeof (*d));
>
> - d->path = (svn_stringbuf_t *) svn_stringbuf_create ("", eb->pool);
> d->edit_baton = eb;
> + d->parent_baton = NULL;

Already NULL by virtue of the apr_pcalloc().

>...
> @@ -329,46 +300,29 @@
> svn_txdelta_window_handler_t *handler,
> void **handler_baton)
> {
> - struct file_baton *fb = (struct file_baton *) file_baton;
> - struct edit_baton *eb = (struct edit_baton *) fb->dir_baton->edit_baton;
> - struct window_handler_baton *whb = apr_palloc (eb->pool, sizeof (*whb));
> -
> - whb->node = fb->node;
> - whb->node->text_mod = TRUE;
> + struct node_baton *fb = (struct node_baton *) file_baton;
> + fb->node->text_mod = TRUE;
> *handler = window_handler;

*handler = NULL;

> - *handler_baton = whb;
> -
> + *handler_baton = NULL;
> return SVN_NO_ERROR;
> }
>...

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Oct 23 03:11:15 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.