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

in-progress patch for Change #1

From: Karl Fogel <kfogel_at_galois.collab.net>
Date: 2001-01-24 21:57:58 CET

I have to be out tomorrow, unfortunately, and that patch I'm working
on for "Change #1" is still in progress. As a unidiff, it's now about
3000 lines long. Yum.

Just in case anyone's blocking on this (I hope no one is, though), I'm
posting it along with the log message so far. If absolutely
necessary, you can apply it before starting on your own changes.

It's nearly done, and I expect it to be committed on Friday.

--------------------8-<-------cut-here---------8-<-----------------------
When an editor is created, the root_dir_baton is returned and used as
the baton for the first call requiring a dir baton. There is no more
externally visible edit_baton. This is Change #1, from the set of 7
changes posted by Ben to the dev list.

* include/svn_delta.h (svn_delta_edit_fns_t): Remove replace_root
and close_edit, change documentation accordingly.
(svn_delta_compose_editors, svn_delta_wrap_editor,
svn_delta_get_xml_editor, svn_delta_make_xml_parser,
svn_delta_xml_auto_parse): Replace edit_baton parameters with
root_dir_baton parameters.

* include/svn_fs.h (svn_fs_dir_delta): Replace edit_baton parameter
with root_dir_baton parameter.

* include/svn_wc.h (svn_wc_get_checkout_editor,
svn_wc_get_update_editor, svn_wc_crawl_local_mods,
svn_wc_crawl_revisions): Replace edit_baton parameter with
root_dir_baton parameter.

* include/svn_ra.h (svn_ra_plugin_t): Replace edit_baton parameter with
root_dir_baton parameter in get_commit_editor and do_checkout. In
do_update, do the same for report_baton and update_baton, which are
also edit_batons anyway. Report editors in general are probably
obsolete and about to be replaced with something simpler.

* include/svn_client.h (svn_client_checkout, svn_client_update,
svn_client_commit): Replace edit_baton parameter with root_dir_baton
parameter.

* include/svn_test.h (svn_test_get_editor): Replace edit_baton
parameter with root_dir_baton parameter.

* client/trace-update.c, client/trace-commit.c (edit_context): New
struct type, replaces edit_baton.
(dir_baton): Store an edit_context now, not an edit_baton.
(trace_editor): Remove replace_root and close_edit.
(svn_cl__get_trace_commit_editor, svn_cl__get_trace_update_editor):
return a root_dir_baton. Construct it to contain an edit_context.

* libsvn_delta/delta.h (svn_xml__digger_t): Remove edit_baton.
Replace rootdir_baton with root_dir_baton, for consistency.

* libsvn_delta/tests/deltaparse-test.c (main): Replace edit_baton with
root_dir_baton.

* libsvn_delta/tests/xml-output-test.c (main): Replace edit_baton with
root_dir_baton, get rid of now-superfluous root_baton. Remove calls
to replace_root and close_edit.

* libsvn_delta/xml_parse.c (svn_delta_make_xml_parser,
svn_delta_xml_auto_parse): Replace edit_baton with root_dir_baton.
(xml_handle_start): Remove call to replace_root. Also remove setting
of initial frame's baton, which we take care of in do_stack_append
now. Also, fix unrelated typo.
(do_stack_append): Set baton of initial stack frame to
root_dir_baton.
(svn_delta_xml_parsebytes): Don't call close_edit.

* libsvn_delta/xml_output.c (replace_root, close_edit): Removed.
(tree_editor): Remove entries for replace_root and close_edit.
(svn_delta_get_xml_editor): Replace edit_baton with root_dir_baton.
(close_directory): Handle root dir specially, like close_edit did.
(everywhere): Replace edit_baton with edit_context.

* libsvn_delta/compose_editors.c (edit_baton): Removed.
(dir_baton): Get the fields edit_baton used to have.
(add_directory, replace_directory): Put new stuff into child dir batons.
(add_directory, replace_directory): Unrelatedly, set child_baton's
parent to parent_baton instead of NULL. Why was it being set to NULL
before? I don't know, but it doesn't make any sense.

* libsvn_delta/delta.c (svn_fs_dir_delta): Take root_dir_baton instead
of edit_baton. Don't call replace_root.

* client/cl.h (svn_cl__get_trace_update_editor,
svn_cl__get_trace_commit_editor): Take root_dir_baton not edit_baton.

* client/checkout-cmd.c (svn_cl__checkout): Use root_dir_baton
instead of edit_baton with the trace editor.

* client/commit-cmd.c (svn_cl__commit): Use root_dir_baton
instead of edit_baton with the trace editor.

* client/update-cmd.c (svn_cl__update): Use root_dir_baton
instead of edit_baton with the trace editor.

* libsvn_client/update.c (svn_client_update): Use root_dir_baton
instead of edit_baton with the update editors.

* libsvn_client/checkout.c (svn_client_checkout): Use root_dir_baton
instead of edit_baton with the checkout editors.

* libsvn_client/commit.c (svn_client_commit): Use root_dir_baton
instead of edit_baton with the commit editors.

* libsvn_client/client.h, libsvn_client/apply_edits.c (apply_delta,
do_edits, svn_client__checkout_internal, svn_client__update_internal):
Use root_dir_batons instead of edit_batons with all editors.

* libsvn_ra_da/tests/ra-dav-test.c (main): Use root_dir_baton instead
of edit_baton. Don't call close_edit.

* libsvn_ra_dav/ra-commit.c (main): Use root_dir_baton instead of
edit_baton.

* libsvn_ra_dav/commit.c (commit_replace_root): Removed.
(commit_close_edit): Removed.
(dir_baton_t): New field `is_root'.
(svn_ra_dav__get_commit_editor): Replace edit_baton parameter with
root_dir_baton parameter. Initialize root_dir_baton using code from
replace_root(), setting new `is_root' field.
(commit_close_dir): If this is the root dir baton, do what close_edit
used to do.

* libsvn_ra_dav/fetch.c (fetch_ctx_t): Replace edit_baton field with
root_dir_baton.
(svn_ra_dav__checkout): Fold edit_baton and root_baton into a single
root_dir_baton.
(svn_ra_dav__get_update_editor): Replace edit_baton with
root_dir_baton, even though this function is #if'd out right now
anyway.
(update_editor): Remove the null placeholders where
update_replace_root and update_close_edit would have been. How
interestingly coincidental that those were the only two not
implemented here!

* libsvn_ra_dav/ra_dav.h (svn_ra_dav__get_commit_editor,
svn_ra_dav__checkout): Replace edit_baton with root_dir_baton.

* libsvn_wc/tests/checkout-test.c (apply_delta): Use root_dir_baton
instead of edit_baton.

* libsvn_wc/tests/commit-test.c (main): Use root_dir_baton instead of
edit_baton.

* libsvn_wc/adm_crawler.c (svn_wc_crawl_local_mods): Replace
edit_baton with root_dir_baton. Replace close_edit call with a call
to close_directory on that root_dir_baton.
(svn_wc_crawl_revisions): Don't call close_edit.
(do_dir_replaces): Use root_dir_baton instead of edit_baton. Don't
call replace_root, just use the baton we have.
(report_local_mods): Use root_dir_baton instead of edit_baton.

* libsvn_wc/get_editor.c (make_editor): Replace edit_baton with
root_baton, set up an edit_context instead. Do what replace_root used
to do.
(free_dir_baton): Do what close_edit used to do, if this is the root
directory baton.
(edit_context): Replaces edit_baton, still lives in dir_baton.
(replace_root): Removed.
(close_edit): Removed
(replace_root): Removed.
(tree_editor): Removed replace_root and close_edit members.

Index: client/checkout-cmd.c
===================================================================
RCS file: /cvs/subversion/subversion/client/checkout-cmd.c,v
retrieving revision 1.9
diff -u -r1.9 checkout-cmd.c
--- client/checkout-cmd.c 2001/01/03 18:53:23 1.9
+++ client/checkout-cmd.c 2001/01/24 23:17:54
@@ -35,11 +35,11 @@
                   apr_pool_t *pool)
 {
   const svn_delta_edit_fns_t *trace_editor;
- void *trace_edit_baton;
+ void *trace_root_dir_baton;
   svn_error_t *err;
 
   err = svn_cl__get_trace_update_editor (&trace_editor,
- &trace_edit_baton,
+ &trace_root_dir_baton,
                                          opt_state->target,
                                          pool);
   if (err)
@@ -48,7 +48,7 @@
 
   err = svn_client_checkout (NULL, NULL,
                              trace_editor,
- trace_edit_baton,
+ trace_root_dir_baton,
                              opt_state->target,
                              opt_state->xml_file,
                              opt_state->ancestor_path,
Index: client/cl.h
===================================================================
RCS file: /cvs/subversion/subversion/client/cl.h,v
retrieving revision 1.28
diff -u -r1.28 cl.h
--- client/cl.h 2001/01/03 20:50:37 1.28
+++ client/cl.h 2001/01/24 23:17:54
@@ -137,14 +137,14 @@
 /* Returns an editor that prints out events in an update or checkout. */
 svn_error_t *
 svn_cl__get_trace_update_editor (const svn_delta_edit_fns_t **editor,
- void **edit_baton,
+ void **root_dir_baton,
                                  svn_string_t *initial_path,
                                  apr_pool_t *pool);
 
 /* Returns an editor that prints out events in a commit. */
 svn_error_t *
 svn_cl__get_trace_commit_editor (const svn_delta_edit_fns_t **editor,
- void **edit_baton,
+ void **root_dir_baton,
                                  svn_string_t *initial_path,
                                  apr_pool_t *pool);
 
Index: client/commit-cmd.c
===================================================================
RCS file: /cvs/subversion/subversion/client/commit-cmd.c,v
retrieving revision 1.9
diff -u -r1.9 commit-cmd.c
--- client/commit-cmd.c 2001/01/04 02:42:59 1.9
+++ client/commit-cmd.c 2001/01/24 23:17:54
@@ -42,10 +42,10 @@
       {
         svn_string_t *target = ((svn_string_t **) (targets->elts))[i];
         const svn_delta_edit_fns_t *trace_editor;
- void *trace_edit_baton;
+ void *trace_root_dir_baton;
     
         err = svn_cl__get_trace_commit_editor (&trace_editor,
- &trace_edit_baton,
+ &trace_root_dir_baton,
                                                target, pool);
         if (err) return err;
 
@@ -53,7 +53,7 @@
            pass TARGETS on down into svn_client_commit(). */
 
         err = svn_client_commit (NULL, NULL,
- trace_editor, trace_edit_baton,
+ trace_editor, trace_root_dir_baton,
                                  target,
                                  opt_state->xml_file,
                                  opt_state->revision,
Index: client/trace-commit.c
===================================================================
RCS file: /cvs/subversion/subversion/client/trace-commit.c,v
retrieving revision 1.4
diff -u -r1.4 trace-commit.c
--- client/trace-commit.c 2001/01/11 21:00:05 1.4
+++ client/trace-commit.c 2001/01/24 23:17:54
@@ -25,7 +25,7 @@
 
 
 
-struct edit_baton
+struct edit_context
 {
   apr_pool_t *pool;
   svn_string_t *initial_path;
@@ -34,7 +34,7 @@
 
 struct dir_baton
 {
- struct edit_baton *edit_baton;
+ struct edit_context *edit_context;
   struct dir_baton *parent_dir_baton;
   svn_string_t *path;
   svn_boolean_t added;
@@ -53,12 +53,12 @@
 
 
 static svn_error_t *
-replace_root (void *edit_baton, void **root_baton)
+replace_root (void *edit_context, void **root_baton)
 {
- struct edit_baton *eb = edit_baton;
+ struct edit_context *eb = edit_context;
   struct dir_baton *rb = apr_pcalloc (eb->pool, sizeof (*rb));
 
- rb->edit_baton = eb;
+ rb->edit_context = eb;
   rb->parent_dir_baton = NULL;
   rb->path = eb->initial_path;
 
@@ -73,7 +73,7 @@
 {
   struct dir_baton *d = parent_baton;
 
- svn_string_t *printable_name = svn_string_dup (d->path, d->edit_baton->pool);
+ svn_string_t *printable_name = svn_string_dup (d->path, d->edit_context->pool);
   svn_path_add_component (printable_name, name, svn_path_local_style);
 
   printf ("Deleting %s\n", printable_name->data);
@@ -90,11 +90,11 @@
 {
   struct dir_baton *parent_d = parent_baton;
   struct dir_baton *child_d
- = apr_pcalloc (parent_d->edit_baton->pool, sizeof (*child_d));
+ = apr_pcalloc (parent_d->edit_context->pool, sizeof (*child_d));
 
- child_d->edit_baton = parent_d->edit_baton;
+ child_d->edit_context = parent_d->edit_context;
   child_d->parent_dir_baton = parent_d;
- child_d->path = svn_string_dup (parent_d->path, child_d->edit_baton->pool);
+ child_d->path = svn_string_dup (parent_d->path, child_d->edit_context->pool);
   svn_path_add_component (child_d->path, name, svn_path_local_style);
   child_d->added = TRUE;
 
@@ -114,11 +114,11 @@
 {
   struct dir_baton *parent_d = parent_baton;
   struct dir_baton *child_d
- = apr_pcalloc (parent_d->edit_baton->pool, sizeof (*child_d));
+ = apr_pcalloc (parent_d->edit_context->pool, sizeof (*child_d));
 
- child_d->edit_baton = parent_d->edit_baton;
+ child_d->edit_context = parent_d->edit_context;
   child_d->parent_dir_baton = parent_d;
- child_d->path = svn_string_dup (parent_d->path, child_d->edit_baton->pool);
+ child_d->path = svn_string_dup (parent_d->path, child_d->edit_context->pool);
   svn_path_add_component (child_d->path, name, svn_path_local_style);
 
   *child_baton = child_d;
@@ -158,7 +158,7 @@
 
 
 static svn_error_t *
-close_edit (void *edit_baton)
+close_edit (void *edit_context)
 {
   /* If we get here, then the *real* close_edit() must have
      succeeded. */
@@ -196,10 +196,10 @@
 {
   struct dir_baton *parent_d = parent_baton;
   struct file_baton *child_fb
- = apr_pcalloc (parent_d->edit_baton->pool, sizeof (*child_fb));
+ = apr_pcalloc (parent_d->edit_context->pool, sizeof (*child_fb));
 
   child_fb->parent_dir_baton = parent_d;
- child_fb->path = svn_string_dup (parent_d->path, parent_d->edit_baton->pool);
+ child_fb->path = svn_string_dup (parent_d->path, parent_d->edit_context->pool);
   svn_path_add_component (child_fb->path, name, svn_path_local_style);
   child_fb->added = TRUE;
 
@@ -218,10 +218,10 @@
 {
   struct dir_baton *parent_d = parent_baton;
   struct file_baton *child_fb
- = apr_pcalloc (parent_d->edit_baton->pool, sizeof (*child_fb));
+ = apr_pcalloc (parent_d->edit_context->pool, sizeof (*child_fb));
 
   child_fb->parent_dir_baton = parent_d;
- child_fb->path = svn_string_dup (parent_d->path, parent_d->edit_baton->pool);
+ child_fb->path = svn_string_dup (parent_d->path, parent_d->edit_context->pool);
   svn_path_add_component (child_fb->path, name, svn_path_local_style);
 
   *file_baton = child_fb;
@@ -256,7 +256,6 @@
 
 static const svn_delta_edit_fns_t trace_editor =
 {
- replace_root,
   delete_item,
   add_directory,
   replace_directory,
@@ -267,24 +266,31 @@
   apply_textdelta,
   change_file_prop,
   close_file,
- close_edit
 };
 
 
 svn_error_t *
 svn_cl__get_trace_commit_editor (const svn_delta_edit_fns_t **editor,
- void **edit_baton,
+ void **root_dir_baton,
                                  svn_string_t *initial_path,
                                  apr_pool_t *pool)
 {
- struct edit_baton *eb = apr_pcalloc (pool, sizeof (*eb));
- eb->initial_path = initial_path;
- eb->pool = pool;
+ /* Allocate an edit baton to be stored in every directory baton.
+ Set it up for the directory baton we create here, which is the
+ root baton. */
+ struct edit_context *ec = apr_pcalloc (pool, sizeof (*ec));
+ struct dir_baton *rb = apr_pcalloc (pool, sizeof (*rb));
+
+ /* kff todo: hmm, that's a bit of a kluge now, isn't it? */
+ if ((initial_path == NULL) || (initial_path[0] == '\0'))
+ initial_path = ".";
 
- if (! eb->initial_path)
- eb->initial_path = svn_string_create (".", pool);
+ ec->pool = svn_pool_create (pool);
+ ec->initial_path = apr_pstrdup (ec->pool, initial_path);
 
- *edit_baton = eb;
+ rb->edit_context = ec;
+
+ *root_dir_baton = rb;
   *editor = &trace_editor;
   
   return SVN_NO_ERROR;
Index: client/trace-update.c
===================================================================
RCS file: /cvs/subversion/subversion/client/trace-update.c,v
retrieving revision 1.19
diff -u -r1.19 trace-update.c
--- client/trace-update.c 2001/01/23 21:49:44 1.19
+++ client/trace-update.c 2001/01/24 23:17:55
@@ -25,7 +25,7 @@
 
 
 
-struct edit_baton
+struct edit_context
 {
   apr_pool_t *pool;
   svn_string_t *initial_path;
@@ -34,7 +34,7 @@
 
 struct dir_baton
 {
- struct edit_baton *edit_baton;
+ struct edit_context *edit_context;
   struct dir_baton *parent_dir_baton;
   svn_string_t *path;
   svn_boolean_t added;
@@ -53,27 +53,12 @@
 
 
 static svn_error_t *
-replace_root (void *edit_baton, void **root_baton)
-{
- struct edit_baton *eb = edit_baton;
- struct dir_baton *rb = apr_pcalloc (eb->pool, sizeof (*rb));
-
- rb->edit_baton = eb;
- rb->parent_dir_baton = NULL;
- rb->path = eb->initial_path;
-
- *root_baton = rb;
-
- return SVN_NO_ERROR;
-}
-
-
-static svn_error_t *
 delete_item (svn_string_t *name, void *parent_baton)
 {
   struct dir_baton *d = parent_baton;
 
- svn_string_t *printable_name = svn_string_dup (d->path, d->edit_baton->pool);
+ svn_string_t *printable_name
+ = svn_string_dup (d->path, d->edit_context->pool);
   svn_path_add_component (printable_name, name, svn_path_local_style);
 
   printf ("D %s\n", printable_name->data);
@@ -90,11 +75,11 @@
 {
   struct dir_baton *parent_d = parent_baton;
   struct dir_baton *child_d
- = apr_pcalloc (parent_d->edit_baton->pool, sizeof (*child_d));
+ = apr_pcalloc (parent_d->edit_context->pool, sizeof (*child_d));
 
- child_d->edit_baton = parent_d->edit_baton;
+ child_d->edit_context = parent_d->edit_context;
   child_d->parent_dir_baton = parent_d;
- child_d->path = svn_string_dup (parent_d->path, child_d->edit_baton->pool);
+ child_d->path = svn_string_dup (parent_d->path, child_d->edit_context->pool);
   svn_path_add_component (child_d->path, name, svn_path_local_style);
   child_d->added = TRUE;
 
@@ -114,11 +99,11 @@
 {
   struct dir_baton *parent_d = parent_baton;
   struct dir_baton *child_d
- = apr_pcalloc (parent_d->edit_baton->pool, sizeof (*child_d));
+ = apr_pcalloc (parent_d->edit_context->pool, sizeof (*child_d));
 
- child_d->edit_baton = parent_d->edit_baton;
+ child_d->edit_context = parent_d->edit_context;
   child_d->parent_dir_baton = parent_d;
- child_d->path = svn_string_dup (parent_d->path, child_d->edit_baton->pool);
+ child_d->path = svn_string_dup (parent_d->path, child_d->edit_context->pool);
   svn_path_add_component (child_d->path, name, svn_path_local_style);
 
   *child_baton = child_d;
@@ -145,19 +130,19 @@
       
       err = svn_wc_entry (&entry,
                           d->path,
- d->edit_baton->pool);
+ d->edit_context->pool);
       if (err) return err;
       
       err = svn_wc_conflicted_p (&text_conflict, &prop_conflict,
                                  d->path,
                                  entry,
- d->edit_baton->pool);
+ d->edit_context->pool);
       if (err) return err;
       
       if (! prop_conflict)
         {
           err = svn_wc_props_modified_p
- (&merged, d->path, d->edit_baton->pool);
+ (&merged, d->path, d->edit_context->pool);
           if (err) return err;
         }
       
@@ -194,13 +179,13 @@
 
       err = svn_wc_entry (&entry,
                           fb->path,
- fb->parent_dir_baton->edit_baton->pool);
+ fb->parent_dir_baton->edit_context->pool);
       if (err) return err;
 
       err = svn_wc_conflicted_p (&text_conflict, &prop_conflict,
                                  fb->parent_dir_baton->path,
                                  entry,
- fb->parent_dir_baton->edit_baton->pool);
+ fb->parent_dir_baton->edit_context->pool);
       if (err) return err;
 
       if (fb->text_changed)
@@ -208,7 +193,7 @@
           if (! text_conflict)
             {
               err = svn_wc_text_modified_p
- (&merged, fb->path, fb->parent_dir_baton->edit_baton->pool);
+ (&merged, fb->path, fb->parent_dir_baton->edit_context->pool);
               if (err) return err;
             }
 
@@ -224,7 +209,7 @@
           if (! prop_conflict)
             {
               err = svn_wc_props_modified_p
- (&merged, fb->path, fb->parent_dir_baton->edit_baton->pool);
+ (&merged, fb->path, fb->parent_dir_baton->edit_context->pool);
               if (err) return err;
             }
           
@@ -244,13 +229,6 @@
 
 
 static svn_error_t *
-close_edit (void *edit_baton)
-{
- return SVN_NO_ERROR;
-}
-
-
-static svn_error_t *
 window_handler (svn_txdelta_window_t *window, void *handler_pair)
 {
   return SVN_NO_ERROR;
@@ -278,10 +256,11 @@
 {
   struct dir_baton *parent_d = parent_baton;
   struct file_baton *child_fb
- = apr_pcalloc (parent_d->edit_baton->pool, sizeof (*child_fb));
+ = apr_pcalloc (parent_d->edit_context->pool, sizeof (*child_fb));
 
   child_fb->parent_dir_baton = parent_d;
- child_fb->path = svn_string_dup (parent_d->path, parent_d->edit_baton->pool);
+ child_fb->path = svn_string_dup (parent_d->path,
+ parent_d->edit_context->pool);
   svn_path_add_component (child_fb->path, name, svn_path_local_style);
   child_fb->added = TRUE;
 
@@ -300,10 +279,11 @@
 {
   struct dir_baton *parent_d = parent_baton;
   struct file_baton *child_fb
- = apr_pcalloc (parent_d->edit_baton->pool, sizeof (*child_fb));
+ = apr_pcalloc (parent_d->edit_context->pool, sizeof (*child_fb));
 
   child_fb->parent_dir_baton = parent_d;
- child_fb->path = svn_string_dup (parent_d->path, parent_d->edit_baton->pool);
+ child_fb->path = svn_string_dup (parent_d->path,
+ parent_d->edit_context->pool);
   svn_path_add_component (child_fb->path, name, svn_path_local_style);
 
   *file_baton = child_fb;
@@ -338,7 +318,6 @@
 
 static const svn_delta_edit_fns_t trace_editor =
 {
- replace_root,
   delete_item,
   add_directory,
   replace_directory,
@@ -349,21 +328,27 @@
   apply_textdelta,
   change_file_prop,
   close_file,
- close_edit
 };
 
 
 svn_error_t *
 svn_cl__get_trace_update_editor (const svn_delta_edit_fns_t **editor,
- void **edit_baton,
+ void **root_dir_baton,
                                  svn_string_t *initial_path,
                                  apr_pool_t *pool)
 {
- struct edit_baton *eb = apr_pcalloc (pool, sizeof (*eb));
- eb->initial_path = initial_path;
- eb->pool = pool;
+ /* Allocate an edit baton to be stored in every directory baton.
+ Set it up for the directory baton we create here, which is the
+ root baton. */
+ struct edit_context *ec = apr_pcalloc (pool, sizeof (*ec));
+ struct dir_baton *rb = apr_pcalloc (pool, sizeof (*rb));
+
+ ec->pool = svn_pool_create (pool);
+ ec->initial_path = apr_pstrdup (ec->pool, initial_path->data);
+
+ rb->edit_context = ec;
 
- *edit_baton = eb;
+ *root_dir_baton = rb;
   *editor = &trace_editor;
   
   return SVN_NO_ERROR;
Index: client/update-cmd.c
===================================================================
RCS file: /cvs/subversion/subversion/client/update-cmd.c,v
retrieving revision 1.9
diff -u -r1.9 update-cmd.c
--- client/update-cmd.c 2001/01/03 18:53:23 1.9
+++ client/update-cmd.c 2001/01/24 23:17:55
@@ -42,16 +42,16 @@
       {
         svn_string_t *target = ((svn_string_t **) (targets->elts))[i];
         const svn_delta_edit_fns_t *trace_editor;
- void *trace_edit_baton;
+ void *trace_root_dir_baton;
 
         err = svn_cl__get_trace_update_editor (&trace_editor,
- &trace_edit_baton,
+ &trace_root_dir_baton,
                                                target, pool);
         if (err)
           return err;
 
         err = svn_client_update (NULL, NULL,
- trace_editor, trace_edit_baton,
+ trace_editor, trace_root_dir_baton,
                                  target,
                                  opt_state->xml_file,
                                  opt_state->revision,
cvs server: Diffing client/tests
Index: client/tests/svn-test2.sh
===================================================================
RCS file: /cvs/subversion/subversion/client/tests/svn-test2.sh,v
retrieving revision 1.11
diff -u -r1.11 svn-test2.sh
--- client/tests/svn-test2.sh 2001/01/04 02:42:59 1.11
+++ client/tests/svn-test2.sh 2001/01/24 23:17:55
@@ -129,11 +129,13 @@
 ${SVN_PROG} status ${TEST_DIR_1}
 check_status 14
 
+
 ### Try to commit; the conflict should now succeed.
 echo "Attempting to commit again, with conflicts removed."
 ${SVN_PROG} commit --xml-file ${COMMIT_RESULTFILE_NAME}-1.xml \
                    --revision 24 ${TEST_DIR_1}
 check_status 15
+
 
 ### Examine status; everything should be up-to-date.
 echo "Status of directory:"
cvs server: Diffing clients
cvs server: Diffing clients/win32
cvs server: Diffing clients/win32/SVNControls
cvs server: Diffing clients/win32/WiNSVN
cvs server: Diffing clients/win32/WiNSVN/Binaries
cvs server: Diffing clients/win32/svn_com
cvs server: Diffing include
Index: include/svn_client.h
===================================================================
RCS file: /cvs/subversion/subversion/include/svn_client.h,v
retrieving revision 1.16
diff -u -r1.16 svn_client.h
--- include/svn_client.h 2001/01/08 18:55:41 1.16
+++ include/svn_client.h 2001/01/24 23:17:55
@@ -46,9 +46,9 @@
 
 svn_error_t *
 svn_client_checkout (const svn_delta_edit_fns_t *before_editor,
- void *before_edit_baton,
+ void *before_root_dir_baton,
                      const svn_delta_edit_fns_t *after_editor,
- void *after_edit_baton,
+ void *after_root_dir_baton,
                      svn_string_t *path,
                      svn_string_t *xml_src,
                      svn_string_t *ancestor_path,
@@ -58,9 +58,9 @@
 
 svn_error_t *
 svn_client_update (const svn_delta_edit_fns_t *before_editor,
- void *before_edit_baton,
+ void *before_root_dir_baton,
                    const svn_delta_edit_fns_t *after_editor,
- void *after_edit_baton,
+ void *after_root_dir_baton,
                    svn_string_t *path,
                    svn_string_t *xml_src,
                    svn_revnum_t ancestor_revision,
@@ -80,9 +80,9 @@
 
 svn_error_t *
 svn_client_commit (const svn_delta_edit_fns_t *before_editor,
- void *before_edit_baton,
+ void *before_root_dir_baton,
                    const svn_delta_edit_fns_t *after_editor,
- void *after_edit_baton,
+ void *after_root_dir_baton,
                    svn_string_t *path,
                    svn_string_t *xml_dst,
                    svn_revnum_t revision, /* this param is temporary */
Index: include/svn_delta.h
===================================================================
RCS file: /cvs/subversion/subversion/include/svn_delta.h,v
retrieving revision 1.135
diff -u -r1.135 svn_delta.h
--- include/svn_delta.h 2000/12/26 18:37:46 1.135
+++ include/svn_delta.h 2001/01/24 23:17:57
@@ -282,12 +282,10 @@
      caller (producer) is pushing tree delta data at the callee
      (consumer).
 
- At the start of traversal, the consumer provides EDIT_BATON, a
- baton global to the entire delta edit. In the case of
- `svn_xml_parse', this would be the EDIT_BATON argument; other
- producers will work differently. The producer should pass this
- value as the EDIT_BATON argument to the `replace_root' function,
- to get a baton representing root of the tree being edited.
+ At the start of traversal, the consumer provides ROOT_DIR_BATON,
+ a baton for the root directory of the entire delta edit. The
+ producer should pass this value as the DIR_BATON argument to the
+ `replace_dir' function that starts the edit.
 
      Most of the callbacks work in the obvious way:
 
@@ -301,14 +299,7 @@
      (NAME is always a single path component, never a full directory
      path.)
 
- Since every call requires a parent directory baton, including
- add_directory and replace_directory, where do we ever get our
- initial directory baton, to get things started? The
- `replace_root' function returns a baton for the top directory of
- the change. In general, the producer needs to invoke the
- editor's `replace_root' function before it can get anything done.
-
- While `replace_root' provides a directory baton for the root of
+ Just as the consumer provided a ROOT_DIR_BATON for the root of
      the tree being changed, the `add_directory' and
      `replace_directory' callbacks provide batons for other
      directories. Like the callbacks above, they take a PARENT_BATON
@@ -320,14 +311,15 @@
      So, if we already have subdirectories named `foo' and `foo/bar',
      then the producer can create a new file named `foo/bar/baz.c' by
      calling:
- replace_root () --- yielding a baton ROOT for the top directory
         replace_directory (ROOT, "foo") --- yielding a baton F for `foo'
         replace_directory (F, "bar") --- yielding a baton B for `foo/bar'
         add_file (B, "baz.c")
      
      When the producer is finished making changes to a directory, it
      should call `close_directory'. This lets the consumer do any
- necessary cleanup, and free the baton's storage.
+ necessary cleanup, and free the baton's storage. Calling
+ close_directory() on the ROOT_DIR_BATON signifies the end of
+ editing.
 
      The `add_file' and `replace_file' callbacks each return a baton
      for the file being created or changed. This baton can then be
@@ -390,17 +382,8 @@
      text deltas to appear at the end. */
 
 
- /* Set *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.) Like any other directory baton, the
- producer should call `close_directory' on ROOT_BATON when they're
- done. */
- svn_error_t *(*replace_root) (void *edit_baton,
- void **root_baton);
-
-
   /* Deleting things. */
-
+
   /* Remove the directory entry named NAME. */
   /* FIXME: this used to be just delete(), but was changed to avoid
    * gratuitous incompatibility with C++, where `delete' is a reserved
@@ -507,14 +490,11 @@
      more, so whatever resources it refers to may now be freed. */
   svn_error_t *(*close_file) (void *file_baton);
 
- /* All delta processing is done. Call this, with the EDIT_BATON for
- the entire edit. */
- svn_error_t *(*close_edit) (void *edit_baton);
-
 } svn_delta_edit_fns_t;
 
 
-/* Compose EDITOR_1 and its baton with EDITOR_2 and its baton.
+/* Compose EDITOR_1 and its baton with EDITOR_2 and its root dir
+ * baton.
  *
  * Returns a new editor in E which each function FUN calls
  * EDITOR_1->FUN and then EDITOR_2->FUN, with the corresponding batons.
@@ -528,19 +508,19 @@
  */
 void
 svn_delta_compose_editors (const svn_delta_edit_fns_t **new_editor,
- void **new_edit_baton,
+ void **new_root_dir_baton,
                            const svn_delta_edit_fns_t *editor_1,
- void *edit_baton_1,
+ void *root_dir_baton_1,
                            const svn_delta_edit_fns_t *editor_2,
- void *edit_baton_2,
+ void *root_dir_baton_2,
                            apr_pool_t *pool);
 
 
-/* Compose BEFORE_EDITOR, BEFORE_EDIT_BATON with MIDDLE_EDITOR,
- * MIDDLE_EDIT_BATON, then compose the result with AFTER_EDITOR,
- * AFTER_EDIT_BATON, all according to the conventions of
+/* Compose BEFORE_EDITOR, BEFORE_ROOT_DIR_BATON with MIDDLE_EDITOR,
+ * MIDDLE_ROOT_DIR_BATON, then compose the result with AFTER_EDITOR,
+ * AFTER_ROOT_DIR_BATON, all according to the conventions of
  * svn_delta_compose_editors(). Return the resulting editor in
- * *NEW_EDITOR, *NEW_EDIT_BATON.
+ * *NEW_EDITOR, *NEW_ROOT_DIR_BATON.
  *
  * If either BEFORE_EDITOR or AFTER_EDITOR is null, that editor will
  * simply not be included in the composition. It is advised, though
@@ -551,25 +531,25 @@
  * happens if it is.
  */
 void svn_delta_wrap_editor (const svn_delta_edit_fns_t **new_editor,
- void **new_edit_baton,
+ void **new_root_dir_baton,
                             const svn_delta_edit_fns_t *before_editor,
- void *before_edit_baton,
+ void *before_root_dir_baton,
                             const svn_delta_edit_fns_t *middle_editor,
- void *middle_edit_baton,
+ void *middle_root_dir_baton,
                             const svn_delta_edit_fns_t *after_editor,
- void *after_edit_baton,
+ void *after_root_dir_baton,
                             apr_pool_t *pool);
 
 
 
 /* Creates an editor which outputs XML delta streams to OUTPUT. On
- return, *EDITOR and *EDITOR_BATON will be set to the editor and its
- associate baton. The editor's memory will live in a sub-pool of
- POOL. */
+ return, *EDITOR and *ROOT_DIR_BATON will be set to the editor and
+ its associated baton. The editor's memory will live in a sub-pool
+ of POOL. */
 svn_error_t *
 svn_delta_get_xml_editor (svn_stream_t *output,
                           const svn_delta_edit_fns_t **editor,
- void **edit_baton,
+ void **root_dir_baton,
                           apr_pool_t *pool);
 
 
@@ -579,13 +559,13 @@
 typedef struct svn_delta_xml_parser_t svn_delta_xml_parser_t;
 
 /* Given a precreated svn_delta_edit_fns_t EDITOR, return a custom xml
- PARSER that will call into it (and feed EDIT_BATON to its
+ PARSER that will call into it (and feed ROOT_DIR_BATON to its
    callbacks.) Additionally, this XML parser will use BASE_PATH and
    BASE_REVISION as default "context variables" when computing ancestry
    within a tree-delta. */
 svn_error_t *svn_delta_make_xml_parser (svn_delta_xml_parser_t **parser,
                                          const svn_delta_edit_fns_t *editor,
- void *edit_baton,
+ void *root_dir_baton,
                                          svn_string_t *base_path,
                                          svn_revnum_t base_revision,
                                          apr_pool_t *pool);
@@ -614,7 +594,7 @@
    until either the stream runs out or an error occurs. */
 svn_error_t *svn_delta_xml_auto_parse (svn_stream_t *source,
                                        const svn_delta_edit_fns_t *editor,
- void *edit_baton,
+ void *root_dir_baton,
                                        svn_string_t *base_path,
                                        svn_revnum_t base_revision,
                                        apr_pool_t *pool);
Index: include/svn_fs.h
===================================================================
RCS file: /cvs/subversion/subversion/include/svn_fs.h,v
retrieving revision 1.33
diff -u -r1.33 svn_fs.h
--- include/svn_fs.h 2000/12/26 18:37:46 1.33
+++ include/svn_fs.h 2001/01/24 23:17:58
@@ -832,20 +832,36 @@
 
 /* Compute the differences between SOURCE_DIR and TARGET_DIR, and make
    calls describing those differences on EDITOR, using the provided
- EDIT_BATON. SOURCE_DIR and TARGET_DIR must be directories from the
- same filesystem.
+ ROOT_DIR_BATON. SOURCE_DIR and TARGET_DIR must be directories from
+ the same filesystem.
 
- The caller must call editor->close_edit on EDIT_BATON;
- svn_fs_dir_delta does not close the edit itself.
-
    Do any allocation necessary for the delta computation in POOL.
    This function's maximum memory consumption is at most roughly
    proportional to the greatest depth of TARGET_DIR, not the total
- size of the delta. */
+ size of the delta.
+
+ FIXME: kff todo: this doc string also used to say:
+
+ The caller must call editor->close_edit on EDIT_BATON;
+ svn_fs_dir_delta does not close the edit itself.
+
+ But close_edit() doesn't exist anymore. And while it is tempting
+ to replace the above text with this:
+
+ The caller must call editor->close_close_directory on
+ ROOT_DIR_BATON; svn_fs_dir_delta does not close the edit itself.
+
+ ...I have not done so, because delta.c:svn_fs_dir_delta() still
+ calls editor->close_directory() on the root directory baton, which
+ should now also do any work close_edit() used to do. We may have
+ to revisit this issue, if it turns out that closing the root
+ directory is something the caller of svn_fs_dir_delta() wants to do
+ itself. In the meantime, see the tie-in comment in
+ delta.c:svn_fs_dir_delta(). */
 svn_error_t *svn_fs_dir_delta (svn_fs_node_t *source_dir,
                                svn_fs_node_t *target_dir,
                                svn_delta_edit_fns_t *editor,
- void *edit_baton,
+ void *root_dir_baton,
                                apr_pool_t *pool);
 
 
Index: include/svn_ra.h
===================================================================
RCS file: /cvs/subversion/subversion/include/svn_ra.h,v
retrieving revision 1.27
diff -u -r1.27 svn_ra.h
--- include/svn_ra.h 2000/12/26 18:37:46 1.27
+++ include/svn_ra.h 2001/01/24 23:17:58
@@ -64,23 +64,23 @@
                                      svn_revnum_t *latest_revnum);
 
 
- /* Return an *EDITOR and *EDIT_BATON capable of transmitting a
+ /* Return an *EDITOR and *ROOT_DIR_BATON capable of transmitting a
      commit to the repository beginning at absolute repository path
      ROOT_PATH. Also, ra's editor must guarantee that if close_edit()
      returns successfully, that *NEW_REVISION will be set to the
      repository's new revision number resulting from the commit. */
   svn_error_t *(*get_commit_editor) (void *session_baton,
                                      const svn_delta_edit_fns_t **editor,
- void **edit_baton,
+ void **root_dir_baton,
                                      svn_revnum_t *new_revision);
 
 
   /* Ask the network layer to check out a copy of ROOT_PATH from a
- repository's filesystem, using EDITOR and EDIT_BATON to create a
- working copy. */
+ repository's filesystem, using EDITOR and ROOT_DIR_BATON to
+ create a working copy. */
   svn_error_t *(*do_checkout) (void *session_baton,
                                const svn_delta_edit_fns_t *editor,
- void *edit_baton);
+ void *root_dir_baton);
 
 
   /* Ask the network layer to update a working copy from URL.
@@ -90,15 +90,16 @@
      that will be updated. The client also provides an UPDATE_EDITOR
      (and baton) that can be used to modify the working copy.
 
- The network layer then returns a REPORT_EDITOR and REPORT_BATON
- to the client; the client first uses this to transmit an empty
- tree-delta to the repository which describes all revision numbers
- in the working copy.
+ The network layer then returns a REPORT_EDITOR and
+ REPORT_ROOT_DIR_BATON to the client; the client first uses this
+ to transmit an empty tree-delta to the repository which describes
+ all revision numbers in the working copy.
 
      There is one special property of the REPORT_EDITOR: its
      close_edit() function. When the client calls close_edit(), the
      network layer then talks to the repository and proceeds to use
- UPDATE_EDITOR and UPDATE_BATON to patch the working copy.
+ UPDATE_EDITOR and UPDATE_ROOT_DIR_BATON to patch the working
+ copy.
 
      When the update_editor->close_edit() returns, then
      report_editor->close_edit() returns too. Therefore the return
@@ -106,9 +107,9 @@
      entire update. */
   svn_error_t *(*do_update) (void *session_baton,
                              const svn_delta_edit_fns_t **report_editor,
- void **report_baton,
+ void **report_root_dir_baton,
                              const svn_delta_edit_fns_t *update_editor,
- void *update_baton);
+ void *update_root_dir_baton);
 
 } svn_ra_plugin_t;
 
Index: include/svn_test.h
===================================================================
RCS file: /cvs/subversion/subversion/include/svn_test.h,v
retrieving revision 1.7
diff -u -r1.7 svn_test.h
--- include/svn_test.h 2000/12/26 18:37:46 1.7
+++ include/svn_test.h 2001/01/24 23:17:58
@@ -33,7 +33,7 @@
    is implemented in tests-common/libsvn_test_editor.la */
 
 svn_error_t *svn_test_get_editor (const svn_delta_edit_fns_t **editor,
- void **edit_baton,
+ void **root_dir_baton,
                                   svn_string_t *path,
                                   svn_revnum_t revision,
                                   apr_pool_t *pool);
Index: include/svn_wc.h
===================================================================
RCS file: /cvs/subversion/subversion/include/svn_wc.h,v
retrieving revision 1.67
diff -u -r1.67 svn_wc.h
--- include/svn_wc.h 2001/01/12 21:29:29 1.67
+++ include/svn_wc.h 2001/01/24 23:17:59
@@ -292,7 +292,7 @@
    Do a depth-first crawl of the local changes in a working copy,
    beginning at ROOT_DIRECTORY. Communicate all local changes (both
    textual and tree) to the supplied EDIT_FNS object (coupled with the
- supplied EDIT_BATON).
+ supplied ROOT_DIR_BATON).
 
    Any items that were found to be modified, and were therefore
    committed, are stored in TARGETS as full paths, so caller can clean
@@ -301,7 +301,7 @@
 svn_wc_crawl_local_mods (apr_hash_t **targets,
                          svn_string_t *root_directory,
                          const svn_delta_edit_fns_t *edit_fns,
- void *edit_baton,
+ void *root_dir_baton,
                          apr_pool_t *pool);
 
 
@@ -322,7 +322,7 @@
 svn_error_t *
 svn_wc_crawl_revisions (svn_string_t *root_directory,
                         const svn_delta_edit_fns_t *edit_fns,
- void *edit_baton,
+ void *root_dir_baton,
                         apr_pool_t *pool);
 
 
@@ -338,14 +338,12 @@
  * TARGET_REVISION is the repository revision that results from this set
  * of changes.
  *
- * EDITOR, EDIT_BATON, and DIR_BATON are all returned by reference,
- * and the latter two should be used as parameters to editor
- * functions.
+ * EDITOR and ROOT_DIR_BATON are returned by reference.
  */
 svn_error_t *svn_wc_get_update_editor (svn_string_t *dest,
                                        svn_revnum_t target_revision,
                                        const svn_delta_edit_fns_t **editor,
- void **edit_baton,
+ void **root_dir_baton,
                                        apr_pool_t *pool);
 
 
@@ -364,6 +362,9 @@
  * REPOS is the repository string to be recorded in this working
  * copy.
  *
+ *
+ * EDITOR and ROOT_DIR_BATON are returned by reference.
+ *
  * kff todo: Actually, REPOS is one of several possible non-delta-ish
  * things that may be needed by a editor when creating new
  * administrative subdirs. Other things might be username and/or auth
@@ -375,7 +376,7 @@
                                          svn_string_t *ancestor_path,
                                          svn_revnum_t target_revision,
                                          const svn_delta_edit_fns_t **editor,
- void **edit_baton,
+ void **root_dir_baton,
                                          apr_pool_t *pool);
 
 
cvs server: Diffing libsvn_client
Index: libsvn_client/apply_edits.c
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_client/apply_edits.c,v
retrieving revision 1.9
diff -u -r1.9 apply_edits.c
--- libsvn_client/apply_edits.c 2000/12/23 22:24:50 1.9
+++ libsvn_client/apply_edits.c 2001/01/24 23:17:59
@@ -33,9 +33,9 @@
 
 static svn_error_t *
 apply_delta (const svn_delta_edit_fns_t *before_editor,
- void *before_edit_baton,
+ void *before_root_dir_baton,
              const svn_delta_edit_fns_t *after_editor,
- void *after_edit_baton,
+ void *after_root_dir_baton,
              svn_stream_t *delta,
              svn_string_t *dest,
              svn_string_t *repos, /* ignored if update */
@@ -45,7 +45,7 @@
              svn_boolean_t is_update)
 {
   const svn_delta_edit_fns_t *editor;
- void *edit_baton;
+ void *root_dir_baton;
   svn_error_t *err;
 
   if (! ancestor_path)
@@ -58,7 +58,7 @@
       err = svn_wc_get_update_editor (dest,
                                       ancestor_revision,
                                       &editor,
- &edit_baton,
+ &root_dir_baton,
                                       pool);
     }
   else /* checkout */
@@ -68,25 +68,25 @@
                                         ancestor_path,
                                         ancestor_revision,
                                         &editor,
- &edit_baton,
+ &root_dir_baton,
                                         pool);
     }
   if (err)
     return err;
 
   svn_delta_wrap_editor (&editor,
- &edit_baton,
+ &root_dir_baton,
                          before_editor,
- before_edit_baton,
+ before_root_dir_baton,
                          editor,
- edit_baton,
+ root_dir_baton,
                          after_editor,
- after_edit_baton,
+ after_root_dir_baton,
                          pool);
 
   return svn_delta_xml_auto_parse (delta,
                                    editor,
- edit_baton,
+ root_dir_baton,
                                    ancestor_path,
                                    ancestor_revision,
                                    pool);
@@ -96,9 +96,9 @@
 
 static svn_error_t *
 do_edits (const svn_delta_edit_fns_t *before_editor,
- void *before_edit_baton,
+ void *before_root_dir_baton,
           const svn_delta_edit_fns_t *after_editor,
- void *after_edit_baton,
+ void *after_root_dir_baton,
           svn_string_t *path,
           svn_string_t *xml_src,
           svn_string_t *ancestor_path, /* ignored if update */
@@ -127,9 +127,9 @@
 
   /* Check out the delta. */
   err = apply_delta (before_editor,
- before_edit_baton,
+ before_root_dir_baton,
                      after_editor,
- after_edit_baton,
+ after_root_dir_baton,
                      svn_stream_from_aprfile (in, pool),
                      path,
                      svn_string_create (repos, pool),
@@ -154,33 +154,33 @@
 
 svn_error_t *
 svn_client__checkout_internal (const svn_delta_edit_fns_t *before_editor,
- void *before_edit_baton,
+ void *before_root_dir_baton,
                                const svn_delta_edit_fns_t *after_editor,
- void *after_edit_baton,
+ void *after_root_dir_baton,
                                svn_string_t *path,
                                svn_string_t *xml_src,
                                svn_string_t *ancestor_path,
                                svn_revnum_t ancestor_revision,
                                apr_pool_t *pool)
 {
- return do_edits (before_editor, before_edit_baton,
- after_editor, after_edit_baton,
+ return do_edits (before_editor, before_root_dir_baton,
+ after_editor, after_root_dir_baton,
                    path, xml_src, ancestor_path, ancestor_revision, pool, 0);
 }
 
 
 svn_error_t *
 svn_client__update_internal (const svn_delta_edit_fns_t *before_editor,
- void *before_edit_baton,
+ void *before_root_dir_baton,
                              const svn_delta_edit_fns_t *after_editor,
- void *after_edit_baton,
+ void *after_root_dir_baton,
                              svn_string_t *path,
                              svn_string_t *xml_src,
                              svn_revnum_t ancestor_revision,
                              apr_pool_t *pool)
 {
- return do_edits (before_editor, before_edit_baton,
- after_editor, after_edit_baton,
+ return do_edits (before_editor, before_root_dir_baton,
+ after_editor, after_root_dir_baton,
                    path, xml_src, NULL, ancestor_revision, pool, 1);
 }
 
Index: libsvn_client/checkout.c
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_client/checkout.c,v
retrieving revision 1.12
diff -u -r1.12 checkout.c
--- libsvn_client/checkout.c 2000/11/22 23:48:46 1.12
+++ libsvn_client/checkout.c 2001/01/24 23:17:59
@@ -33,9 +33,9 @@
 
 svn_error_t *
 svn_client_checkout (const svn_delta_edit_fns_t *before_editor,
- void *before_edit_baton,
+ void *before_root_dir_baton,
                      const svn_delta_edit_fns_t *after_editor,
- void *after_edit_baton,
+ void *after_root_dir_baton,
                      svn_string_t *path,
                      svn_string_t *xml_src,
                      svn_string_t *ancestor_path,
@@ -43,9 +43,9 @@
                      apr_pool_t *pool)
 {
   return svn_client__checkout_internal (before_editor,
- before_edit_baton,
+ before_root_dir_baton,
                                         after_editor,
- after_edit_baton,
+ after_root_dir_baton,
                                         path,
                                         xml_src,
                                         ancestor_path,
Index: libsvn_client/client.h
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_client/client.h,v
retrieving revision 1.8
diff -u -r1.8 client.h
--- libsvn_client/client.h 2000/12/14 20:04:06 1.8
+++ libsvn_client/client.h 2001/01/24 23:17:59
@@ -68,9 +68,9 @@
 
 svn_error_t *
 svn_client__checkout_internal (const svn_delta_edit_fns_t *before_editor,
- void *before_edit_baton,
+ void *before_root_dir_baton,
                                const svn_delta_edit_fns_t *after_editor,
- void *after_edit_baton,
+ void *after_root_dir_baton,
                                svn_string_t *path,
                                svn_string_t *xml_src,
                                svn_string_t *ancestor_path,
@@ -80,9 +80,9 @@
 
 svn_error_t *
 svn_client__update_internal (const svn_delta_edit_fns_t *before_editor,
- void *before_edit_baton,
+ void *before_root_dir_baton,
                              const svn_delta_edit_fns_t *after_editor,
- void *after_edit_baton,
+ void *after_root_dir_baton,
                              svn_string_t *path,
                              svn_string_t *xml_src,
                              svn_revnum_t ancestor_revision,
Index: libsvn_client/commit.c
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_client/commit.c,v
retrieving revision 1.15
diff -u -r1.15 commit.c
--- libsvn_client/commit.c 2001/01/04 02:43:00 1.15
+++ libsvn_client/commit.c 2001/01/24 23:17:59
@@ -36,9 +36,9 @@
 
 svn_error_t *
 svn_client_commit (const svn_delta_edit_fns_t *before_editor,
- void *before_edit_baton,
+ void *before_root_dir_baton,
                    const svn_delta_edit_fns_t *after_editor,
- void *after_edit_baton,
+ void *after_root_dir_baton,
                    svn_string_t *path,
                    svn_string_t *xml_dst,
                    svn_revnum_t revision, /* this param is temporary */
@@ -48,7 +48,7 @@
   apr_status_t apr_err;
   apr_file_t *dst = NULL; /* old habits die hard */
   const svn_delta_edit_fns_t *editor;
- void *edit_baton;
+ void *root_dir_baton;
   apr_hash_t *targets = NULL;
 
   /* Step 1: look for local mods and send 'em out. */
@@ -66,20 +66,20 @@
      module. */
   err = svn_delta_get_xml_editor (svn_stream_from_aprfile (dst, pool),
                                   &editor,
- &edit_baton,
+ &root_dir_baton,
                                   pool);
   if (err)
     return err;
 
   /* Compose the commit-editor with any other editors passed in */
   svn_delta_wrap_editor (&editor,
- &edit_baton,
+ &root_dir_baton,
                          before_editor,
- before_edit_baton,
+ before_root_dir_baton,
                          editor,
- edit_baton,
+ root_dir_baton,
                          after_editor,
- after_edit_baton,
+ after_root_dir_baton,
                          pool);
 
 
@@ -87,7 +87,7 @@
   err = svn_wc_crawl_local_mods (&targets,
                                  path,
                                  editor,
- edit_baton,
+ root_dir_baton,
                                  pool);
   if (err)
     return err;
Index: libsvn_client/update.c
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_client/update.c,v
retrieving revision 1.9
diff -u -r1.9 update.c
--- libsvn_client/update.c 2000/11/22 23:48:46 1.9
+++ libsvn_client/update.c 2001/01/24 23:17:59
@@ -31,16 +31,16 @@
 
 svn_error_t *
 svn_client_update (const svn_delta_edit_fns_t *before_editor,
- void *before_edit_baton,
+ void *before_root_dir_baton,
                    const svn_delta_edit_fns_t *after_editor,
- void *after_edit_baton,
+ void *after_root_dir_baton,
                    svn_string_t *path,
                    svn_string_t *xml_src,
                    svn_revnum_t revision,
                    apr_pool_t *pool)
 {
- return svn_client__update_internal (before_editor, before_edit_baton,
- after_editor, after_edit_baton,
+ return svn_client__update_internal (before_editor, before_root_dir_baton,
+ after_editor, after_root_dir_baton,
                                       path, xml_src, revision, pool);
 }
 
cvs server: Diffing libsvn_delta
Index: libsvn_delta/compose_editors.c
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_delta/compose_editors.c,v
retrieving revision 1.7
diff -u -r1.7 compose_editors.c
--- libsvn_delta/compose_editors.c 2000/12/22 22:48:21 1.7
+++ libsvn_delta/compose_editors.c 2001/01/24 23:18:00
@@ -19,20 +19,12 @@
 
 
 
-struct edit_baton
-{
- const svn_delta_edit_fns_t *editor_1;
- void *edit_baton_1;
- const svn_delta_edit_fns_t *editor_2;
- void *edit_baton_2;
- apr_pool_t *pool;
-};
-
-
 struct dir_baton
 {
- struct edit_baton *edit_baton;
   struct dir_baton *parent_dir_baton;
+ apr_pool_t *pool;
+ const svn_delta_edit_fns_t *editor_1;
+ const svn_delta_edit_fns_t *editor_2;
   void *dir_baton_1;
   void *dir_baton_2;
 };
@@ -47,53 +39,21 @@
 
 
 static svn_error_t *
-replace_root (void *edit_baton, void **root_baton)
-{
- struct edit_baton *eb = edit_baton;
- svn_error_t *err;
- struct dir_baton *d = apr_pcalloc (eb->pool, sizeof (*d));
-
- d->edit_baton = eb;
- d->parent_dir_baton = NULL;
-
- if (eb->editor_1->replace_root)
- {
- err = (* (eb->editor_1->replace_root)) (eb->edit_baton_1,
- &(d->dir_baton_1));
- if (err)
- return err;
- }
-
- if (eb->editor_2->replace_root)
- {
- err = (* (eb->editor_2->replace_root)) (eb->edit_baton_2,
- &(d->dir_baton_2));
- if (err)
- return err;
- }
-
- *root_baton = d;
-
- return SVN_NO_ERROR;
-}
-
-
-static svn_error_t *
 delete_item (svn_string_t *name, void *parent_baton)
 {
   struct dir_baton *d = parent_baton;
   svn_error_t *err;
 
- if (d->edit_baton->editor_1->delete_item)
+ if (d->editor_1->delete_item)
     {
- err = (* (d->edit_baton->editor_1->delete_item)) (name, d->dir_baton_1);
+ err = (* (d->editor_1->delete_item)) (name, d->dir_baton_1);
       if (err)
         return err;
     }
   
- if (d->edit_baton->editor_2->delete_item)
+ if (d->editor_2->delete_item)
     {
- err = (* (d->edit_baton->editor_2->delete_item)) (name, d->dir_baton_2);
+ err = (* (d->editor_2->delete_item)) (name, d->dir_baton_2);
       if (err)
         return err;
     }
@@ -111,23 +71,25 @@
 {
   struct dir_baton *d = parent_baton;
   svn_error_t *err;
- struct dir_baton *child = apr_pcalloc (d->edit_baton->pool, sizeof (*child));
+ struct dir_baton *child = apr_pcalloc (d->pool, sizeof (*child));
 
- child->edit_baton = d->edit_baton;
- child->parent_dir_baton = NULL;
+ child->pool = d->pool;
+ child->editor_1 = d->editor_1;
+ child->editor_2 = d->editor_2;
+ child->parent_dir_baton = parent_baton;
 
- if (d->edit_baton->editor_1->add_directory)
+ if (d->editor_1->add_directory)
     {
- err = (* (d->edit_baton->editor_1->add_directory))
+ err = (* (d->editor_1->add_directory))
         (name, d->dir_baton_1, ancestor_path, ancestor_revision,
          &(child->dir_baton_1));
       if (err)
         return err;
     }
 
- if (d->edit_baton->editor_2->add_directory)
+ if (d->editor_2->add_directory)
     {
- err = (* (d->edit_baton->editor_2->add_directory))
+ err = (* (d->editor_2->add_directory))
         (name, d->dir_baton_2, ancestor_path, ancestor_revision,
          &(child->dir_baton_2));
       if (err)
@@ -149,23 +111,25 @@
 {
   struct dir_baton *d = parent_baton;
   svn_error_t *err;
- struct dir_baton *child = apr_pcalloc (d->edit_baton->pool, sizeof (*child));
+ struct dir_baton *child = apr_pcalloc (d->pool, sizeof (*child));
 
- child->edit_baton = d->edit_baton;
- child->parent_dir_baton = NULL;
+ child->pool = d->pool;
+ child->editor_1 = d->editor_1;
+ child->editor_2 = d->editor_2;
+ child->parent_dir_baton = parent_baton;
 
- if (d->edit_baton->editor_1->replace_directory)
+ if (d->editor_1->replace_directory)
     {
- err = (* (d->edit_baton->editor_1->replace_directory))
+ err = (* (d->editor_1->replace_directory))
         (name, d->dir_baton_1, ancestor_path, ancestor_revision,
          &(child->dir_baton_1));
       if (err)
         return err;
     }
 
- if (d->edit_baton->editor_2->replace_directory)
+ if (d->editor_2->replace_directory)
     {
- err = (* (d->edit_baton->editor_2->replace_directory))
+ err = (* (d->editor_2->replace_directory))
         (name, d->dir_baton_2, ancestor_path, ancestor_revision,
          &(child->dir_baton_2));
       if (err)
@@ -184,16 +148,16 @@
   struct dir_baton *d = dir_baton;
   svn_error_t *err;
 
- if (d->edit_baton->editor_1->close_directory)
+ if (d->editor_1->close_directory)
     {
- err = (* (d->edit_baton->editor_1->close_directory)) (d->dir_baton_1);
+ err = (* (d->editor_1->close_directory)) (d->dir_baton_1);
       if (err)
         return err;
     }
   
- if (d->edit_baton->editor_2->close_directory)
+ if (d->editor_2->close_directory)
     {
- err = (* (d->edit_baton->editor_2->close_directory)) (d->dir_baton_2);
+ err = (* (d->editor_2->close_directory)) (d->dir_baton_2);
       if (err)
         return err;
     }
@@ -208,17 +172,17 @@
   struct file_baton *fb = file_baton;
   svn_error_t *err;
 
- if (fb->dir_baton->edit_baton->editor_1->close_file)
+ if (fb->dir_baton->editor_1->close_file)
     {
- err = (* (fb->dir_baton->edit_baton->editor_1->close_file))
+ err = (* (fb->dir_baton->editor_1->close_file))
         (fb->file_baton_1);
       if (err)
         return err;
     }
   
- if (fb->dir_baton->edit_baton->editor_2->close_file)
+ if (fb->dir_baton->editor_2->close_file)
     {
- err = (* (fb->dir_baton->edit_baton->editor_2->close_file))
+ err = (* (fb->dir_baton->editor_2->close_file))
         (fb->file_baton_2);
       if (err)
         return err;
@@ -228,30 +192,6 @@
 }
 
 
-static svn_error_t *
-close_edit (void *edit_baton)
-{
- struct edit_baton *eb = edit_baton;
- svn_error_t *err;
-
- if (eb->editor_1->close_edit)
- {
- err = (* (eb->editor_1->close_edit)) (eb->edit_baton_1);
- if (err)
- return err;
- }
-
- if (eb->editor_2->close_edit)
- {
- err = (* (eb->editor_2->close_edit)) (eb->edit_baton_2);
- if (err)
- return err;
- }
-
- return SVN_NO_ERROR;
-}
-
-
 struct handler_pair
 {
   struct file_baton *file_baton;
@@ -294,21 +234,21 @@
   struct file_baton *fb = file_baton;
   svn_error_t *err;
   struct handler_pair *hp
- = apr_pcalloc (fb->dir_baton->edit_baton->pool, sizeof (*hp));
+ = apr_pcalloc (fb->dir_baton->pool, sizeof (*hp));
   
   hp->file_baton = fb;
 
- if (fb->dir_baton->edit_baton->editor_1->apply_textdelta)
+ if (fb->dir_baton->editor_1->apply_textdelta)
     {
- err = (* (fb->dir_baton->edit_baton->editor_1->apply_textdelta))
+ err = (* (fb->dir_baton->editor_1->apply_textdelta))
         (fb->file_baton_1, &(hp->handler_1), &(hp->handler_baton_1));
       if (err)
         return err;
     }
 
- if (fb->dir_baton->edit_baton->editor_2->apply_textdelta)
+ if (fb->dir_baton->editor_2->apply_textdelta)
     {
- err = (* (fb->dir_baton->edit_baton->editor_2->apply_textdelta))
+ err = (* (fb->dir_baton->editor_2->apply_textdelta))
         (fb->file_baton_2, &(hp->handler_2), &(hp->handler_baton_2));
       if (err)
         return err;
@@ -330,22 +270,22 @@
 {
   struct dir_baton *d = parent_baton;
   svn_error_t *err;
- struct file_baton *fb = apr_pcalloc (d->edit_baton->pool, sizeof (*fb));
+ struct file_baton *fb = apr_pcalloc (d->pool, sizeof (*fb));
 
   fb->dir_baton = d;
 
- if (d->edit_baton->editor_1->add_file)
+ if (d->editor_1->add_file)
     {
- err = (* (d->edit_baton->editor_1->add_file))
+ err = (* (d->editor_1->add_file))
         (name, d->dir_baton_1, ancestor_path, ancestor_revision,
          &(fb->file_baton_1));
       if (err)
         return err;
     }
 
- if (d->edit_baton->editor_2->add_file)
+ if (d->editor_2->add_file)
     {
- err = (* (d->edit_baton->editor_2->add_file))
+ err = (* (d->editor_2->add_file))
         (name, d->dir_baton_2, ancestor_path, ancestor_revision,
          &(fb->file_baton_2));
       if (err)
@@ -366,22 +306,22 @@
 {
   struct dir_baton *d = parent_baton;
   svn_error_t *err;
- struct file_baton *fb = apr_pcalloc (d->edit_baton->pool, sizeof (*fb));
+ struct file_baton *fb = apr_pcalloc (d->pool, sizeof (*fb));
 
   fb->dir_baton = d;
 
- if (d->edit_baton->editor_1->replace_file)
+ if (d->editor_1->replace_file)
     {
- err = (* (d->edit_baton->editor_1->replace_file))
+ err = (* (d->editor_1->replace_file))
         (name, d->dir_baton_1, ancestor_path, ancestor_revision,
          &(fb->file_baton_1));
       if (err)
         return err;
     }
 
- if (d->edit_baton->editor_2->replace_file)
+ if (d->editor_2->replace_file)
     {
- err = (* (d->edit_baton->editor_2->replace_file))
+ err = (* (d->editor_2->replace_file))
         (name, d->dir_baton_2, ancestor_path, ancestor_revision,
          &(fb->file_baton_2));
       if (err)
@@ -401,17 +341,17 @@
   struct file_baton *fb = file_baton;
   svn_error_t *err;
 
- if (fb->dir_baton->edit_baton->editor_1->change_file_prop)
+ if (fb->dir_baton->editor_1->change_file_prop)
     {
- err = (* (fb->dir_baton->edit_baton->editor_1->change_file_prop))
+ err = (* (fb->dir_baton->editor_1->change_file_prop))
         (fb->file_baton_1, name, value);
       if (err)
         return err;
     }
 
- if (fb->dir_baton->edit_baton->editor_2->change_file_prop)
+ if (fb->dir_baton->editor_2->change_file_prop)
     {
- err = (* (fb->dir_baton->edit_baton->editor_2->change_file_prop))
+ err = (* (fb->dir_baton->editor_2->change_file_prop))
         (fb->file_baton_2, name, value);
       if (err)
         return err;
@@ -429,17 +369,17 @@
   struct dir_baton *d = parent_baton;
   svn_error_t *err;
 
- if (d->edit_baton->editor_1->change_dir_prop)
+ if (d->editor_1->change_dir_prop)
     {
- err = (* (d->edit_baton->editor_1->change_dir_prop))
+ err = (* (d->editor_1->change_dir_prop))
         (d->dir_baton_1, name, value);
       if (err)
         return err;
     }
 
- if (d->edit_baton->editor_2->change_dir_prop)
+ if (d->editor_2->change_dir_prop)
     {
- err = (* (d->edit_baton->editor_2->change_dir_prop))
+ err = (* (d->editor_2->change_dir_prop))
         (d->dir_baton_2, name, value);
       if (err)
         return err;
@@ -453,7 +393,6 @@
 
 static const svn_delta_edit_fns_t composed_editor =
 {
- replace_root,
   delete_item,
   add_directory,
   replace_directory,
@@ -464,60 +403,59 @@
   apply_textdelta,
   change_file_prop,
   close_file,
- close_edit
 };
 
 
 void
 svn_delta_compose_editors (const svn_delta_edit_fns_t **new_editor,
- void **new_edit_baton,
+ void **new_root_dir_baton,
                            const svn_delta_edit_fns_t *editor_1,
- void *edit_baton_1,
+ void *root_dir_baton_1,
                            const svn_delta_edit_fns_t *editor_2,
- void *edit_baton_2,
+ void *root_dir_baton_2,
                            apr_pool_t *pool)
 {
- struct edit_baton *eb = apr_pcalloc (pool, sizeof (*eb));
+ struct root_dir_baton *rb = apr_pcalloc (pool, sizeof (*rb));
   
- eb->editor_1 = editor_1;
- eb->editor_2 = editor_2;
- eb->edit_baton_1 = edit_baton_1;
- eb->edit_baton_2 = edit_baton_2;
- eb->pool = pool;
+ rb->editor_1 = editor_1;
+ rb->editor_2 = editor_2;
+ rb->root_dir_baton_1 = root_dir_baton_1;
+ rb->root_dir_baton_2 = root_dir_baton_2;
+ rb->pool = pool;
 
- *new_edit_baton = eb;
+ *new_root_dir_baton = rb;
   *new_editor = &composed_editor;
 }
 
 
 void
 svn_delta_wrap_editor (const svn_delta_edit_fns_t **new_editor,
- void **new_edit_baton,
+ void **new_root_dir_baton,
                        const svn_delta_edit_fns_t *before_editor,
- void *before_edit_baton,
+ void *before_root_dir_baton,
                        const svn_delta_edit_fns_t *middle_editor,
- void *middle_edit_baton,
+ void *middle_root_dir_baton,
                        const svn_delta_edit_fns_t *after_editor,
- void *after_edit_baton,
+ void *after_root_dir_baton,
                        apr_pool_t *pool)
 {
   assert (middle_editor != NULL);
 
   if (before_editor)
     {
- svn_delta_compose_editors (new_editor, new_edit_baton,
- before_editor, before_edit_baton,
- middle_editor, middle_edit_baton,
+ svn_delta_compose_editors (new_editor, new_root_dir_baton,
+ before_editor, before_root_dir_baton,
+ middle_editor, middle_root_dir_baton,
                                  pool);
       middle_editor = *new_editor;
- middle_edit_baton = *new_edit_baton;
+ middle_root_dir_baton = *new_root_dir_baton;
     }
 
   if (after_editor)
     {
- svn_delta_compose_editors (new_editor, new_edit_baton,
- middle_editor, middle_edit_baton,
- after_editor, after_edit_baton,
+ svn_delta_compose_editors (new_editor, new_root_dir_baton,
+ middle_editor, middle_root_dir_baton,
+ after_editor, after_root_dir_baton,
                                  pool);
     }
 }
Index: libsvn_delta/delta.h
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_delta/delta.h,v
retrieving revision 1.48
diff -u -r1.48 delta.h
--- libsvn_delta/delta.h 2000/12/26 23:28:29 1.48
+++ libsvn_delta/delta.h 2001/01/24 23:18:00
@@ -182,9 +182,8 @@
 
   /* Userdata structures that we need to keep track of while we parse,
      given to us by either the SVN filesystem or the SVN client */
- void *edit_baton; /* (global data from our caller) */
- void *rootdir_baton; /* (local info about root directory; local subdir
- info will be stored in each stackframe structure) */
+ void *root_dir_baton; /* (local info about root directory; local subdir
+ info will be stored in each stackframe structure) */
   void *dir_baton; /* (temporary info about current working dir, also
                         stored within stackframes.) */
   void *file_baton; /* (local info about current file) */
Index: libsvn_delta/xml_output.c
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_delta/xml_output.c,v
retrieving revision 1.24
diff -u -r1.24 xml_output.c
--- libsvn_delta/xml_output.c 2000/12/26 23:28:29 1.24
+++ libsvn_delta/xml_output.c 2001/01/24 23:18:01
@@ -54,7 +54,7 @@
   elem_file_prop_delta
 };
 
-struct edit_baton
+struct edit_context
 {
   svn_stream_t *output;
   enum elemtype elem; /* Current element we are inside at
@@ -70,7 +70,7 @@
 
 struct dir_baton
 {
- struct edit_baton *edit_baton;
+ struct edit_context *edit_context;
   enum elemtype addreplace; /* elem_add or elem_replace, or
                                    elem_delta_pkg for the root
                                    directory. */
@@ -80,7 +80,7 @@
 
 struct file_baton
 {
- struct edit_baton *edit_baton;
+ struct edit_context *edit_context;
   enum elemtype addreplace;
   int txdelta_id; /* ID of deferred text delta;
                                    0 means we're still working on the file,
@@ -91,12 +91,12 @@
 
 
 static struct dir_baton *
-make_dir_baton (struct edit_baton *eb, enum elemtype addreplace)
+make_dir_baton (struct edit_context *ec, enum elemtype addreplace)
 {
- apr_pool_t *subpool = svn_pool_create (eb->pool);
+ apr_pool_t *subpool = svn_pool_create (ec->pool);
   struct dir_baton *db = apr_palloc (subpool, sizeof (*db));
 
- db->edit_baton = eb;
+ db->edit_context = ec;
   db->addreplace = addreplace;
   db->pool = subpool;
   return db;
@@ -104,12 +104,12 @@
 
 
 static struct file_baton *
-make_file_baton (struct edit_baton *eb, enum elemtype addreplace)
+make_file_baton (struct edit_context *ec, enum elemtype addreplace)
 {
- apr_pool_t *subpool = svn_pool_create (eb->pool);
+ apr_pool_t *subpool = svn_pool_create (ec->pool);
   struct file_baton *fb = apr_palloc (subpool, sizeof (*fb));
 
- fb->edit_baton = eb;
+ fb->edit_context = ec;
   fb->addreplace = addreplace;
   fb->txdelta_id = 0;
   fb->closed = 0;
@@ -146,26 +146,26 @@
    ELEM specifies the element type we want to get to, with prop_delta
    split out into elem_dir_prop_delta and elem_file_prop_delta
    depending on where the prop_delta is in the little tree. The
- element type we are currently in is recorded inside EB. */
+ element type we are currently in is recorded inside EC. */
 
 static svn_string_t *
-get_to_elem (struct edit_baton *eb, enum elemtype elem, apr_pool_t *pool)
+get_to_elem (struct edit_context *ec, enum elemtype elem, apr_pool_t *pool)
 {
   svn_string_t *str = svn_string_create ("", pool);
   struct file_baton *fb;
 
   /* Unwind. Start from the leaves and go back as far as necessary. */
- if (eb->elem == elem_file_prop_delta && elem != elem_file_prop_delta)
+ if (ec->elem == elem_file_prop_delta && elem != elem_file_prop_delta)
     {
       svn_xml_make_close_tag (&str, pool, "prop-delta");
- eb->elem = elem_file;
+ ec->elem = elem_file;
     }
- if (eb->elem == elem_file && elem != elem_file
+ if (ec->elem == elem_file && elem != elem_file
       && elem != elem_file_prop_delta)
     {
       const char *outertag;
 
- fb = eb->curfile;
+ fb = ec->curfile;
       if (fb->txdelta_id == 0)
         {
           char buf[128];
@@ -173,7 +173,7 @@
 
           /* Leak a little memory from pool to create idstr; all of our
              callers are using temporary pools anyway. */
- fb->txdelta_id = eb->txdelta_id_counter++;
+ fb->txdelta_id = ec->txdelta_id_counter++;
           sprintf (buf, "%d", fb->txdelta_id);
           idstr = svn_string_create (buf, pool);
           svn_xml_make_open_tag (&str, pool, svn_xml_self_closing,
@@ -183,59 +183,59 @@
       outertag = (fb->addreplace == elem_add) ? "add" : "replace";
       svn_xml_make_close_tag (&str, pool, outertag);
       fb->closed = 1;
- eb->curfile = NULL;
- eb->elem = elem_tree_delta;
+ ec->curfile = NULL;
+ ec->elem = elem_tree_delta;
     }
- if (eb->elem == elem_tree_delta
+ if (ec->elem == elem_tree_delta
       && (elem == elem_dir || elem == elem_dir_prop_delta))
     {
       svn_xml_make_close_tag (&str, pool, "tree-delta");
- eb->elem = elem_dir;
+ ec->elem = elem_dir;
     }
- if (eb->elem == elem_dir_prop_delta && elem != elem_dir_prop_delta)
+ if (ec->elem == elem_dir_prop_delta && elem != elem_dir_prop_delta)
     {
       svn_xml_make_close_tag (&str, pool, "prop-delta");
- eb->elem = elem_dir;
+ ec->elem = elem_dir;
     }
 
   /* Now wind. */
- if (eb->elem == elem_dir && elem == elem_tree_delta)
+ if (ec->elem == elem_dir && elem == elem_tree_delta)
     {
       svn_xml_make_open_tag (&str, pool, svn_xml_normal, "tree-delta", NULL);
- eb->elem = elem_tree_delta;
+ ec->elem = elem_tree_delta;
     }
- if ((eb->elem == elem_dir && elem == elem_dir_prop_delta)
- || (eb->elem == elem_file && elem == elem_file_prop_delta))
+ if ((ec->elem == elem_dir && elem == elem_dir_prop_delta)
+ || (ec->elem == elem_file && elem == elem_file_prop_delta))
     {
       svn_xml_make_open_tag (&str, pool, svn_xml_normal, "prop-delta", NULL);
- eb->elem = elem;
+ ec->elem = elem;
     }
 
   /* If we didn't make it to the type of element the caller asked for,
      either the caller wants us to do something we don't do or we have
      a bug. */
- assert (eb->elem == elem);
+ assert (ec->elem == elem);
 
   return str;
 }
 
 
 /* Output XML for adding or replacing a file or directory. Also set
- EB->elem to the value of DIRFILE for consistency. */
+ EC->elem to the value of DIRFILE for consistency. */
 static svn_error_t *
-output_addreplace (struct edit_baton *eb, enum elemtype addreplace,
+output_addreplace (struct edit_context *ec, enum elemtype addreplace,
                    enum elemtype dirfile, svn_string_t *name,
                    svn_string_t *ancestor_path, svn_revnum_t ancestor_revision)
 {
   svn_string_t *str;
- apr_pool_t *pool = svn_pool_create (eb->pool);
+ apr_pool_t *pool = svn_pool_create (ec->pool);
   svn_error_t *err;
   apr_size_t len;
   apr_hash_t *att;
   const char *outertag = (addreplace == elem_add) ? "add" : "replace";
   const char *innertag = (dirfile == elem_dir) ? "dir" : "file";
 
- str = get_to_elem (eb, elem_tree_delta, pool);
+ str = get_to_elem (ec, elem_tree_delta, pool);
   svn_xml_make_open_tag (&str, pool, svn_xml_normal, outertag,
                          "name", name, NULL);
 
@@ -249,10 +249,10 @@
     }
   svn_xml_make_open_tag_hash (&str, pool, svn_xml_normal, innertag, att);
 
- eb->elem = dirfile;
+ ec->elem = dirfile;
 
   len = str->len;
- err = svn_stream_write (eb->output, str->data, &len);
+ err = svn_stream_write (ec->output, str->data, &len);
   apr_destroy_pool (pool);
   return err;
 }
@@ -260,17 +260,17 @@
 
 /* Output a set or delete element. ELEM is the type of prop-delta
    (elem_dir_prop_delta or elem_file_prop_delta) the element lives
- in. This function sets EB->elem to ELEM for consistency. */
+ in. This function sets EC->elem to ELEM for consistency. */
 static svn_error_t *
-output_propset (struct edit_baton *eb, enum elemtype elem,
+output_propset (struct edit_context *ec, enum elemtype elem,
                 svn_string_t *name, svn_string_t *value)
 {
   svn_string_t *str;
- apr_pool_t *pool = svn_pool_create (eb->pool);
+ apr_pool_t *pool = svn_pool_create (ec->pool);
   svn_error_t *err;
   apr_size_t len;
 
- str = get_to_elem (eb, elem, pool);
+ str = get_to_elem (ec, elem, pool);
   if (value != NULL)
     {
       svn_xml_make_open_tag (&str, pool, svn_xml_protect_pcdata, "set",
@@ -283,51 +283,28 @@
                            "name", name, NULL);
 
   len = str->len;
- err = svn_stream_write (eb->output, str->data, &len);
+ err = svn_stream_write (ec->output, str->data, &len);
   apr_destroy_pool (pool);
   return err;
 }
 
 
 static svn_error_t *
-replace_root (void *edit_baton,
- void **dir_baton)
-{
- struct edit_baton *eb = (struct edit_baton *) edit_baton;
- apr_pool_t *pool = svn_pool_create (eb->pool);
- svn_string_t *str = NULL;
- apr_size_t len;
- svn_error_t *err;
-
- svn_xml_make_header (&str, pool);
- svn_xml_make_open_tag (&str, pool, svn_xml_normal, "delta-pkg", NULL);
-
- *dir_baton = make_dir_baton (eb, elem_delta_pkg);
- eb->elem = elem_dir;
-
- len = str->len;
- err = svn_stream_write (eb->output, str->data, &len);
- apr_destroy_pool (pool);
- return err;
-}
-
-
-static svn_error_t *
 delete_item (svn_string_t *name, void *parent_baton)
 {
   struct dir_baton *db = (struct dir_baton *) parent_baton;
- struct edit_baton *eb = db->edit_baton;
+ struct edit_context *ec = db->edit_context;
   svn_string_t *str;
- apr_pool_t *pool = svn_pool_create (eb->pool);
+ apr_pool_t *pool = svn_pool_create (ec->pool);
   svn_error_t *err;
   apr_size_t len;
 
- str = get_to_elem (eb, elem_tree_delta, pool);
+ str = get_to_elem (ec, elem_tree_delta, pool);
   svn_xml_make_open_tag (&str, pool, svn_xml_self_closing, "delete",
                          "name", name, NULL);
 
   len = str->len;
- err = svn_stream_write (eb->output, str->data, &len);
+ err = svn_stream_write (ec->output, str->data, &len);
   apr_destroy_pool (pool);
   return err;
 }
@@ -341,10 +318,10 @@
                void **child_baton)
 {
   struct dir_baton *db = (struct dir_baton *) parent_baton;
- struct edit_baton *eb = db->edit_baton;
+ struct edit_context *ec = db->edit_context;
 
- *child_baton = make_dir_baton (eb, elem_add);
- return output_addreplace (eb, elem_add, elem_dir, name,
+ *child_baton = make_dir_baton (ec, elem_add);
+ return output_addreplace (ec, elem_add, elem_dir, name,
                             ancestor_path, ancestor_revision);
 }
 
@@ -357,10 +334,10 @@
                    void **child_baton)
 {
   struct dir_baton *db = (struct dir_baton *) parent_baton;
- struct edit_baton *eb = db->edit_baton;
+ struct edit_context *ec = db->edit_context;
 
- *child_baton = make_dir_baton (eb, elem_replace);
- return output_addreplace (eb, elem_replace, elem_dir, name,
+ *child_baton = make_dir_baton (ec, elem_replace);
+ return output_addreplace (ec, elem_replace, elem_dir, name,
                             ancestor_path, ancestor_revision);
 }
 
@@ -371,9 +348,9 @@
                  svn_string_t *value)
 {
   struct dir_baton *db = (struct dir_baton *) dir_baton;
- struct edit_baton *eb = db->edit_baton;
+ struct edit_context *ec = db->edit_context;
 
- return output_propset (eb, elem_dir_prop_delta, name, value);
+ return output_propset (ec, elem_dir_prop_delta, name, value);
 }
 
 
@@ -381,26 +358,38 @@
 close_directory (void *dir_baton)
 {
   struct dir_baton *db = (struct dir_baton *) dir_baton;
- struct edit_baton *eb = db->edit_baton;
+ struct edit_context *ec = db->edit_context;
   svn_string_t *str;
   svn_error_t *err;
   apr_size_t len;
 
- str = get_to_elem (eb, elem_dir, db->pool);
+ str = get_to_elem (ec, elem_dir, db->pool);
   if (db->addreplace != elem_delta_pkg)
     {
       /* Not the root directory. */
       const char *outertag = (db->addreplace == elem_add) ? "add" : "replace";
       svn_xml_make_close_tag (&str, db->pool, "dir");
       svn_xml_make_close_tag (&str, db->pool, outertag);
- eb->elem = elem_tree_delta;
+ ec->elem = elem_tree_delta;
+
+ len = str->len;
+ err = svn_stream_write (ec->output, str->data, &len);
+
+ apr_destroy_pool (db->pool);
     }
   else
- eb->elem = elem_delta_pkg;
+ {
+ /* It's the root directory, so close the edit. */
+ svn_xml_make_close_tag (&str, ec->pool, "delta-pkg");
 
- len = str->len;
- err = svn_stream_write (eb->output, str->data, &len);
- apr_destroy_pool (db->pool);
+ len = str->len;
+ err = svn_stream_write (ec->output, str->data, &len);
+ if (err == SVN_NO_ERROR)
+ err = svn_stream_close (ec->output);
+
+ apr_destroy_pool (ec->pool); /* will destroy db->pool as well */
+ }
+
   return err;
 }
 
@@ -413,12 +402,12 @@
           void **file_baton)
 {
   struct dir_baton *db = (struct dir_baton *) parent_baton;
- struct edit_baton *eb = db->edit_baton;
+ struct edit_context *ec = db->edit_context;
 
- SVN_ERR(output_addreplace (eb, elem_add, elem_file, name,
+ SVN_ERR(output_addreplace (ec, elem_add, elem_file, name,
                              ancestor_path, ancestor_revision));
- *file_baton = make_file_baton (eb, elem_add);
- eb->curfile = *file_baton;
+ *file_baton = make_file_baton (ec, elem_add);
+ ec->curfile = *file_baton;
   return SVN_NO_ERROR;
 }
 
@@ -431,12 +420,12 @@
               void **file_baton)
 {
   struct dir_baton *db = (struct dir_baton *) parent_baton;
- struct edit_baton *eb = db->edit_baton;
+ struct edit_context *ec = db->edit_context;
 
- SVN_ERR(output_addreplace (eb, elem_replace, elem_file, name,
+ SVN_ERR(output_addreplace (ec, elem_replace, elem_file, name,
                              ancestor_path, ancestor_revision));
- *file_baton = make_file_baton (eb, elem_replace);
- eb->curfile = *file_baton;
+ *file_baton = make_file_baton (ec, elem_replace);
+ ec->curfile = *file_baton;
   return SVN_NO_ERROR;
 }
 
@@ -445,10 +434,10 @@
 output_svndiff_data (void *baton, const char *data, apr_size_t *len)
 {
   struct file_baton *fb = (struct file_baton *) baton;
- struct edit_baton *eb = fb->edit_baton;
+ struct edit_context *ec = fb->edit_context;
 
   /* Just pass through the write request to the editor's output stream. */
- return svn_stream_write (eb->output, data, len);
+ return svn_stream_write (ec->output, data, len);
 }
 
 
@@ -456,15 +445,15 @@
 finish_svndiff_data (void *baton)
 {
   struct file_baton *fb = (struct file_baton *) baton;
- struct edit_baton *eb = fb->edit_baton;
- apr_pool_t *subpool = svn_pool_create (eb->pool);
+ struct edit_context *ec = fb->edit_context;
+ apr_pool_t *subpool = svn_pool_create (ec->pool);
   svn_string_t *str = NULL;
   svn_error_t *err;
   apr_size_t slen;
 
   svn_xml_make_close_tag (&str, subpool, "text-delta");
   slen = str->len;
- err = svn_stream_write (eb->output, str->data, &slen);
+ err = svn_stream_write (ec->output, str->data, &slen);
   apr_destroy_pool (subpool);
   return err;
 }
@@ -476,9 +465,9 @@
                  void **handler_baton)
 {
   struct file_baton *fb = (struct file_baton *) file_baton;
- struct edit_baton *eb = fb->edit_baton;
+ struct edit_context *ec = fb->edit_context;
   svn_string_t *str = NULL;
- apr_pool_t *pool = svn_pool_create (eb->pool);
+ apr_pool_t *pool = svn_pool_create (ec->pool);
   svn_error_t *err;
   apr_size_t len;
   svn_stream_t *output, *encoder;
@@ -489,7 +478,7 @@
     {
       /* We are inside a file element (possibly in a prop-delta) and
          are outputting a text-delta inline. */
- str = get_to_elem (eb, elem_file, pool);
+ str = get_to_elem (ec, elem_file, pool);
     }
   else
     {
@@ -509,7 +498,7 @@
   fb->txdelta_id = -1;
 
   len = str->len;
- err = svn_stream_write (eb->output, str->data, &len);
+ err = svn_stream_write (ec->output, str->data, &len);
   apr_destroy_pool (pool);
 
   /* Set up a handler which will write base64-encoded svndiff data to
@@ -518,11 +507,11 @@
   svn_stream_set_write (output, output_svndiff_data);
   svn_stream_set_close (output, finish_svndiff_data);
 #ifdef QUOPRINT_SVNDIFFS
- encoder = svn_quoprint_encode (output, eb->pool);
+ encoder = svn_quoprint_encode (output, ec->pool);
 #else
- encoder = svn_base64_encode (output, eb->pool);
+ encoder = svn_base64_encode (output, ec->pool);
 #endif
- svn_txdelta_to_svndiff (encoder, eb->pool, handler, handler_baton);
+ svn_txdelta_to_svndiff (encoder, ec->pool, handler, handler_baton);
 
   return err;
 }
@@ -534,9 +523,9 @@
                   svn_string_t *value)
 {
   struct file_baton *fb = (struct file_baton *) file_baton;
- struct edit_baton *eb = fb->edit_baton;
+ struct edit_context *ec = fb->edit_context;
 
- return output_propset (eb, elem_file_prop_delta, name, value);
+ return output_propset (ec, elem_file_prop_delta, name, value);
 }
 
 
@@ -544,7 +533,7 @@
 close_file (void *file_baton)
 {
   struct file_baton *fb = (struct file_baton *) file_baton;
- struct edit_baton *eb = fb->edit_baton;
+ struct edit_context *ec = fb->edit_context;
   svn_string_t *str;
   svn_error_t *err = SVN_NO_ERROR;
   apr_size_t len;
@@ -553,41 +542,22 @@
   if (!fb->closed)
     {
       const char *outertag = (fb->addreplace == elem_add) ? "add" : "replace";
- str = get_to_elem (eb, elem_file, fb->pool);
+ str = get_to_elem (ec, elem_file, fb->pool);
       svn_xml_make_close_tag (&str, fb->pool, "file");
       svn_xml_make_close_tag (&str, fb->pool, outertag);
 
       len = str->len;
- err = svn_stream_write (eb->output, str->data, &len);
- eb->curfile = NULL;
- eb->elem = elem_tree_delta;
+ err = svn_stream_write (ec->output, str->data, &len);
+ ec->curfile = NULL;
+ ec->elem = elem_tree_delta;
     }
   apr_destroy_pool (fb->pool);
   return err;
 }
 
 
-static svn_error_t *
-close_edit (void *edit_baton)
-{
- struct edit_baton *eb = (struct edit_baton *) edit_baton;
- svn_error_t *err;
- svn_string_t *str = NULL;
- apr_size_t len;
-
- svn_xml_make_close_tag (&str, eb->pool, "delta-pkg");
- len = str->len;
- err = svn_stream_write (eb->output, str->data, &len);
- if (err == SVN_NO_ERROR)
- err = svn_stream_close (eb->output);
- apr_destroy_pool (eb->pool);
- return err;
-}
-
-
 static const svn_delta_edit_fns_t tree_editor =
 {
- replace_root,
   delete_item,
   add_directory,
   replace_directory,
@@ -598,28 +568,51 @@
   apply_textdelta,
   change_file_prop,
   close_file,
- close_edit
 };
 
 
 svn_error_t *
 svn_delta_get_xml_editor (svn_stream_t *output,
                           const svn_delta_edit_fns_t **editor,
- void **edit_baton,
+ void **root_dir_baton,
                           apr_pool_t *pool)
 {
- struct edit_baton *eb;
+ struct dir_baton *rb;
+ struct edit_context *ec;
   apr_pool_t *subpool = svn_pool_create (pool);
 
   *editor = &tree_editor;
- eb = apr_palloc (subpool, sizeof (*eb));
- eb->pool = subpool;
- eb->output = output;
- eb->curfile = NULL;
- eb->txdelta_id_counter = 1;
 
- *edit_baton = eb;
+ /* Set up an edit_context. */
+ ec = apr_palloc (subpool, sizeof (*ec));
+ ec->pool = subpool;
+ ec->output = output;
+ ec->curfile = NULL;
+ ec->txdelta_id_counter = 1;
+
+ /* Set up a root_dir_baton, initialized with that edit_context, and
+ output the start of the xml. */
+ {
+ svn_error_t *err;
+ svn_string_t *str;
+ apr_size_t len;
+ apr_pool_t *this_pool = svn_pool_create (subpool);
+
+ svn_xml_make_header (&str, pool);
+ svn_xml_make_open_tag (&str, pool, svn_xml_normal, "delta-pkg", NULL);
+
+ rb = make_dir_baton (ec, elem_delta_pkg);
+ ec->elem = elem_dir;
+
+ len = str->len;
+ err = svn_stream_write (ec->output, str->data, &len);
+ apr_destroy_pool (this_pool);
+
+ if (err)
+ return err;
+ }
 
+ *root_dir_baton = rb;
   return SVN_NO_ERROR;
 }
 
Index: libsvn_delta/xml_parse.c
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_delta/xml_parse.c,v
retrieving revision 1.141
diff -u -r1.141 xml_parse.c
--- libsvn_delta/xml_parse.c 2000/12/26 23:28:29 1.141
+++ libsvn_delta/xml_parse.c 2001/01/24 23:18:02
@@ -296,6 +296,10 @@
       if (new_frame->tag != svn_delta__XML_deltapkg)
         return xml_validation_error (pool, tagname, FALSE);
 
+ /* The first frame's baton is the root directory baton, which we
+ have in the digger already. */
+ new_frame->baton = digger->root_dir_baton;
+
       /* Do the append and get out */
       digger->stack = new_frame;
 
@@ -1012,31 +1016,8 @@
      <delta-pkg> frame, too. */
   if (new_frame->tag == svn_delta__XML_treedelta)
     {
- /* Always create frame's hashtable to hold dirent names. */
+ /* Frame's hashtable holds dirent names to check for uniqueness. */
       new_frame->namespace = apr_make_hash (my_digger->pool);
-
- /* If this is the FIRST tree-delta we've ever seen... */
- if (my_digger->stack->tag == svn_delta__XML_deltapkg)
- {
- /* Fetch the rootdir_baton by calling into the editor */
- if (my_digger->editor->replace_root)
- {
- void *rootdir_baton;
-
- err = my_digger->editor->replace_root
- (my_digger->edit_baton, &rootdir_baton);
- if (err)
- svn_xml_signal_bailout (err, my_digger->svn_parser);
-
- /* Place this rootdir_baton into the parent of the whole
- stack, our <delta-pkg> tag. Then, when we push the
- <tree-delta> frame to the stack, it will automatically
- "inherit" the baton as well. We end up with our top two
- stackframes both containing the root_baton, but that's
- harmless. */
- my_digger->stack->baton = rootdir_baton;
- }
- }
     }
 
   /* ---------- Append the new stackframe to the stack ------- */
@@ -1137,7 +1118,7 @@
       return;
     }
 
- /* EVENT: Are we setting a proeprty? */
+ /* EVENT: Are we setting a property? */
   if (new_frame->tag == svn_delta__XML_set)
     {
       err = do_begin_setprop (my_digger, new_frame);
@@ -1357,14 +1338,14 @@
 
 
 /* Given a precreated svn_delta_edit_fns_t EDITOR, return a custom xml
- PARSER that will call into it (and feed EDIT_BATON to its
+ PARSER that will call into it (and feed ROOT_DIR_BATON to its
    callbacks.) Additionally, this XML parser will use BASE_PATH and
    BASE_REVISION as default "context variables" when computing ancestry
    within a tree-delta. */
 svn_error_t *
 svn_delta_make_xml_parser (svn_delta_xml_parser_t **parser,
                            const svn_delta_edit_fns_t *editor,
- void *edit_baton,
+ void *root_dir_baton,
                            svn_string_t *base_path,
                            svn_revnum_t base_revision,
                            apr_pool_t *pool)
@@ -1386,8 +1367,7 @@
   digger->editor = editor;
   digger->base_path = base_path;
   digger->base_revision = base_revision;
- digger->edit_baton = edit_baton;
- digger->rootdir_baton = NULL;
+ digger->root_dir_baton = root_dir_baton;
   digger->dir_baton = NULL;
   digger->validation_error = SVN_NO_ERROR;
   digger->svndiff_parser = NULL;
@@ -1439,16 +1419,6 @@
 
   if (err)
     return err;
-
- /* Call `close_edit' callback if this is the final push */
- if (isFinal && delta_parser->digger->editor->close_edit)
- {
- err = delta_parser->digger->editor->close_edit
- (delta_parser->digger->edit_baton);
-
- if (err)
- return err;
- }
   
   return SVN_NO_ERROR;
 }
@@ -1458,7 +1428,7 @@
 svn_error_t *
 svn_delta_xml_auto_parse (svn_stream_t *source,
                           const svn_delta_edit_fns_t *editor,
- void *edit_baton,
+ void *root_dir_baton,
                           svn_string_t *base_path,
                           svn_revnum_t base_revision,
                           apr_pool_t *pool)
@@ -1472,7 +1442,7 @@
   /* Create a custom Subversion XML parser */
   err = svn_delta_make_xml_parser (&delta_parser,
                                     editor,
- edit_baton,
+ root_dir_baton,
                                     base_path,
                                     base_revision,
                                     pool);
cvs server: Diffing libsvn_delta/tests
Index: libsvn_delta/tests/deltaparse-test.c
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_delta/tests/deltaparse-test.c,v
retrieving revision 1.60
diff -u -r1.60 deltaparse-test.c
--- libsvn_delta/tests/deltaparse-test.c 2000/12/23 22:24:51 1.60
+++ libsvn_delta/tests/deltaparse-test.c 2001/01/24 23:18:02
@@ -35,7 +35,7 @@
   svn_error_t *err;
   apr_file_t *file = NULL;
   apr_status_t status;
- void *edit_baton;
+ void *root_dir_baton;
 
   svn_revnum_t base_revision;
   svn_string_t *base_path;
@@ -69,13 +69,13 @@
   base_path = svn_string_create ("/root", globalpool);
   
   /* Grab the "test" editor and baton */
- err = svn_test_get_editor (&editor, &edit_baton,
+ err = svn_test_get_editor (&editor, &root_dir_baton,
                              base_path, base_revision, globalpool);
   
   /* Fire up the XML parser */
   err = svn_delta_xml_auto_parse (svn_stream_from_aprfile (file, globalpool),
                                   editor,
- edit_baton,
+ root_dir_baton,
                                   base_path,
                                   base_revision,
                                   globalpool);
Index: libsvn_delta/tests/xml-output-test.c
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_delta/tests/xml-output-test.c,v
retrieving revision 1.9
diff -u -r1.9 xml-output-test.c
--- libsvn_delta/tests/xml-output-test.c 2000/12/24 10:35:23 1.9
+++ libsvn_delta/tests/xml-output-test.c 2001/01/24 23:18:02
@@ -32,7 +32,7 @@
   const svn_delta_edit_fns_t *editor;
   svn_txdelta_window_handler_t *handler;
   svn_txdelta_window_t window;
- void *edit_baton, *root_baton, *dir_baton, *file_baton, *handler_baton;
+ void *root_dir_baton, *dir_baton, *file_baton, *handler_baton;
   svn_string_t *foo_string;
   svn_string_t *bar_string;
   svn_string_t *baz_string;
@@ -61,9 +61,8 @@
   window.new_data = svn_string_create ("test delta", pool);
 
   svn_delta_get_xml_editor (svn_stream_from_stdio (stdout, pool),
- &editor, &edit_baton, pool);
- editor->replace_root (edit_baton, &root_baton);
- editor->replace_directory (foo_string, root_baton, aaa_string, 2,
+ &editor, &root_dir_baton, pool);
+ editor->replace_directory (foo_string, root_dir_baton, aaa_string, 2,
                              &dir_baton);
   editor->replace_file (bar_string, dir_baton, NULL, 0, &file_baton);
   editor->apply_textdelta (file_baton, &handler, &handler_baton);
@@ -75,10 +74,9 @@
   editor->change_file_prop (file_baton, aaa_string, NULL);
   editor->change_dir_prop (dir_baton, ccc_string, bbb_string);
   editor->close_directory (dir_baton);
- editor->close_directory (root_baton);
+ editor->close_directory (root_dir_baton);
   editor->apply_textdelta (file_baton, &handler, &handler_baton);
   handler (NULL, handler_baton);
   editor->close_file (file_baton);
- editor->close_edit (edit_baton);
   return 0;
 }
cvs server: Diffing libsvn_fs
Index: libsvn_fs/delta.c
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_fs/delta.c,v
retrieving revision 1.20
diff -u -r1.20 delta.c
--- libsvn_fs/delta.c 2000/12/23 22:38:46 1.20
+++ libsvn_fs/delta.c 2001/01/24 23:18:03
@@ -85,7 +85,7 @@
 svn_fs_dir_delta (svn_fs_dir_t *source,
                   svn_fs_dir_t *target,
                   svn_delta_edit_fns_t *editor,
- void *edit_baton,
+ void *root_dir_baton,
                   apr_pool_t *parent_pool)
 {
   svn_error_t *svn_err = 0;
@@ -96,16 +96,18 @@
 
   source_path.len = 0;
 
- svn_err = editor->replace_root (edit_baton, &root_baton);
- if (svn_err) goto error;
-
   c.editor = editor;
   c.pool = pool;
 
- svn_err = delta_dirs (&c, root_baton, source, &source_path, target);
+ svn_err = delta_dirs (&c, root_dir_baton, source, &source_path, target);
   if (svn_err) goto error;
 
- svn_err = editor->close_directory (root_baton);
+ /* kff todo: We could move this out to caller, who does have the
+ * root_dir_baton and who used to be responsible for calling
+ * close_edit().
+ * (By the way, this is the tie-in comment referred to in svn_fs.h.)
+ */
+ svn_err = editor->close_directory (root_dir_baton);
   if (svn_err) goto error;
 
  error:
cvs server: Diffing libsvn_fs/tests
cvs server: Diffing libsvn_ra_dav
Index: libsvn_ra_dav/commit.c
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_ra_dav/commit.c,v
retrieving revision 1.25
diff -u -r1.25 commit.c
--- libsvn_ra_dav/commit.c 2001/01/09 05:01:24 1.25
+++ libsvn_ra_dav/commit.c 2001/01/24 23:18:04
@@ -63,6 +63,7 @@
 
 typedef struct
 {
+ svn_boolean_t is_root;
   commit_ctx_t *cc;
   resource_t res;
   apr_hash_t *prop_changes;
@@ -308,22 +309,6 @@
 }
 
 static svn_error_t *
-commit_replace_root (void *edit_baton, void **root_baton)
-{
- commit_ctx_t *cc = edit_baton;
- dir_baton_t *root = apr_pcalloc(cc->ras->pool, sizeof(*root));
-
- root->cc = cc;
-
- root->res.url = cc->ras->root.path;
- /* ### fetch vsn_url from props */
-
- *root_baton = root;
-
- return NULL;
-}
-
-static svn_error_t *
 commit_delete_item (svn_string_t *name, void *parent_baton)
 {
   dir_baton_t *parent = parent_baton;
@@ -457,6 +442,26 @@
   printf("[close_dir] ");
   SVN_ERR( do_proppatch(dir->cc->ras, &dir->res, dir->prop_changes) );
 
+ /* kff todo: Greg, I didn't know of any other way to identify the
+ root directory baton, so I added an `is_root' flag to
+ dir_baton_t, I set it in svn_ra_dav__get_commit_editor(), and I
+ don't set it anywhere else. Undo this kluge as desired. :-) */
+ if (dir->is_root)
+ {
+ svn_revnum_t new_revision = SVN_INVALID_REVNUM;
+
+ /* ### MERGE the activity */
+ printf("[close_edit] MERGE: %s\n",
+ dir->cc->activity_url ? dir->cc->activity_url : "(activity)");
+
+ /* ### set new_revision according to response from server */
+ /* ### get the new version URLs for all affected resources */
+
+ /* Make sure the caller (most likely the working copy library, or
+ maybe its caller) knows the new revision. */
+ *dir->cc->new_revision = new_revision;
+ }
+
   return NULL;
 }
 
@@ -585,33 +590,12 @@
   return NULL;
 }
 
-static svn_error_t *
-commit_close_edit (void *edit_baton)
-{
- commit_ctx_t *cc = edit_baton;
- svn_revnum_t new_revision = SVN_INVALID_REVNUM;
-
- /* ### MERGE the activity */
- printf("[close_edit] MERGE: %s\n",
- cc->activity_url ? cc->activity_url : "(activity)");
-
- /* ### set new_revision according to response from server */
- /* ### get the new version URLs for all affected resources */
-
- /* Make sure the caller (most likely the working copy library, or
- maybe its caller) knows the new revision. */
- *cc->new_revision = new_revision;
-
- return NULL;
-}
-
 /*
 ** This structure is used during the commit process. An external caller
 ** uses these callbacks to describe all the changes in the working copy
 ** that must be committed to the server.
 */
 static const svn_delta_edit_fns_t commit_editor = {
- commit_replace_root,
   commit_delete_item,
   commit_add_dir,
   commit_rep_dir,
@@ -622,32 +606,35 @@
   commit_apply_txdelta,
   commit_change_file_prop,
   commit_close_file,
- commit_close_edit
 };
 
 svn_error_t * svn_ra_dav__get_commit_editor(
   void *session_baton,
   const svn_delta_edit_fns_t **editor,
- void **edit_baton,
+ void **root_dir_baton,
   svn_revnum_t *new_revision)
 {
+ svn_error_t *err;
   svn_ra_session_t *ras = session_baton;
   commit_ctx_t *cc = apr_pcalloc(ras->pool, sizeof(*cc));
- svn_error_t *err;
+ dir_baton_t *rb = apr_pcalloc(ras->pool, sizeof(*rb));
 
+ /* Construct a context. */
   cc->ras = ras;
   cc->resources = apr_make_hash(ras->pool);
   cc->vsn_url_name = svn_string_create(SVN_RA_DAV__LP_VSN_URL, ras->pool);
-
   err = create_activity(cc);
   if (err)
     return err;
-
- /* Record where the caller wants the new revision number stored. */
- cc->new_revision = new_revision;
+ cc->new_revision = new_revision; /* Where caller wants new rev stored. */
 
- *edit_baton = cc;
+ /* Construct a root directory baton. */
+ rb->is_root = 1;
+ rb->cc = cc;
+ rb->res.url = cc->ras->root.path;
+ /* ### fetch vsn_url from props */
 
+ *root_dir_baton = rb;
   *editor = &commit_editor;
 
   return NULL;
Index: libsvn_ra_dav/fetch.c
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_ra_dav/fetch.c,v
retrieving revision 1.32
diff -u -r1.32 fetch.c
--- libsvn_ra_dav/fetch.c 2001/01/09 04:54:39 1.32
+++ libsvn_ra_dav/fetch.c 2001/01/24 23:18:04
@@ -95,7 +95,7 @@
   apr_array_header_t *files; /* files to checkout (resource_t *) */
 
   const svn_delta_edit_fns_t *editor;
- void *edit_baton;
+ void *root_dir_baton;
 
   apr_pool_t *pool;
 
@@ -496,7 +496,7 @@
 
 svn_error_t * svn_ra_dav__checkout (void *session_baton,
                                     const svn_delta_edit_fns_t *editor,
- void *edit_baton)
+ void *root_dir_baton)
 {
   svn_ra_session_t *ras = session_baton;
   int recurse = 1; /* ### until it gets passed to us */
@@ -505,17 +505,12 @@
   fetch_ctx_t fc = { 0 };
   svn_string_t *ancestor_path;
   svn_revnum_t ancestor_revision;
- void *root_baton;
   svn_string_t *act_url_name;
   resource_t *rsrc;
   resource_t **prsrc;
 
- err = (*editor->replace_root)(edit_baton, &root_baton);
- if (err != SVN_NO_ERROR)
- return err;
-
   fc.editor = editor;
- fc.edit_baton = edit_baton;
+ fc.root_dir_baton = root_dir_baton;
   fc.pool = ras->pool;
   fc.subdirs = apr_make_array(ras->pool, 5, sizeof(resource_t *));
   fc.files = apr_make_array(ras->pool, 10, sizeof(resource_t *));
@@ -524,7 +519,7 @@
   /* Build a directory resource for the root. We'll pop this off and fetch
      the information for it. */
   rsrc = apr_pcalloc(ras->pool, sizeof(*rsrc));
- rsrc->parent_baton = root_baton;
+ rsrc->parent_baton = root_dir_baton;
 
   /* ### verify this the right place to start... */
   rsrc->url = ras->root.path;
@@ -583,7 +578,7 @@
       else
         {
           /* We are operating in the root of the repository */
- this_baton = root_baton;
+ this_baton = root_dir_baton;
         }
       fc.cur_baton = this_baton;
 
@@ -729,7 +724,6 @@
 ** the client to a specific version/latest/label/etc.
 */
 static const svn_delta_edit_fns_t update_editor = {
- NULL, /* update_replace_root */
   update_delete_item,
   update_add_dir,
   update_rep_dir,
@@ -740,14 +734,13 @@
   update_apply_txdelta,
   update_change_file_prop,
   update_close_file,
- NULL /* update_close_edit */
 };
 
 #if 0
 svn_error_t *
 svn_ra_dav__get_update_editor(void *session_baton,
                               const svn_delta_edit_fns_t **editor,
- void **edit_baton,
+ void **root_dir_baton,
                               const svn_delta_edit_fns_t *wc_update,
                               void *wc_update_baton,
                               svn_string_t *URL)
@@ -755,7 +748,7 @@
   /* shove the session and wc_* values into our baton */
 
   *editor = &update_editor;
- *edit_baton = NULL;
+ *root_dir_baton = NULL;
   return SVN_NO_ERROR;
 }
 #endif
Index: libsvn_ra_dav/ra_dav.h
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_ra_dav/ra_dav.h,v
retrieving revision 1.5
diff -u -r1.5 ra_dav.h
--- libsvn_ra_dav/ra_dav.h 2001/01/09 04:54:39 1.5
+++ libsvn_ra_dav/ra_dav.h 2001/01/24 23:18:05
@@ -47,11 +47,11 @@
 svn_error_t * svn_ra_dav__get_commit_editor(
   void *session_baton,
   const svn_delta_edit_fns_t **editor,
- void **edit_baton,
+ void **root_dir_baton,
   svn_revnum_t *new_revision);
 svn_error_t * svn_ra_dav__checkout (void *session_baton,
                                     const svn_delta_edit_fns_t *editor,
- void *edit_baton);
+ void *root_dir_baton);
 
 /*
 ** SVN_RA_DAV__LP_*: local properties for RA/DAV
cvs server: Diffing libsvn_ra_dav/tests
Index: libsvn_ra_dav/tests/ra-commit.c
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_ra_dav/tests/ra-commit.c,v
retrieving revision 1.1
diff -u -r1.1 ra-commit.c
--- libsvn_ra_dav/tests/ra-commit.c 2000/12/03 13:52:49 1.1
+++ libsvn_ra_dav/tests/ra-commit.c 2001/01/24 23:18:05
@@ -36,7 +36,7 @@
   void *session_baton;
   svn_string_t *url;
   const svn_delta_edit_fns_t *editor;
- void *edit_baton;
+ void *root_dir_baton;
   svn_revnum_t new_revision;
   const svn_ra_plugin_t *plugin;
   apr_hash_t *targets;
@@ -62,7 +62,7 @@
   if (err)
     goto error;
 
- err = (*plugin->get_commit_editor)(session_baton, &editor, &edit_baton,
+ err = (*plugin->get_commit_editor)(session_baton, &editor, &root_dir_baton,
                                      &new_revision);
   if (err)
     goto error;
@@ -71,7 +71,8 @@
   root_dir = svn_string_create(".", pool);
 
   printf("Beginning crawl...\n");
- err = svn_wc_crawl_local_mods(&targets, root_dir, editor, edit_baton, pool);
+ err = svn_wc_crawl_local_mods(&targets, root_dir,
+ editor, root_dir_baton, pool);
   if (err)
     goto error;
 
Index: libsvn_ra_dav/tests/ra-dav-test.c
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_ra_dav/tests/ra-dav-test.c,v
retrieving revision 1.21
diff -u -r1.21 ra-dav-test.c
--- libsvn_ra_dav/tests/ra-dav-test.c 2000/12/22 21:23:04 1.21
+++ libsvn_ra_dav/tests/ra-dav-test.c 2001/01/24 23:18:05
@@ -36,7 +36,7 @@
   svn_string_t *url;
   const char *dir;
   const svn_delta_edit_fns_t *editor;
- void *edit_baton;
+ void *root_dir_baton;
   svn_string_t *repos;
   svn_string_t *anc_path;
   svn_string_t *root_path;
@@ -74,18 +74,13 @@
 
   err = svn_wc_get_checkout_editor(svn_string_create(dir, pool),
                                    repos, anc_path, revision,
- &editor, &edit_baton, pool);
+ &editor, &root_dir_baton, pool);
   if (err)
     goto error;
 
   /* ### what is this path? */
   root_path = svn_string_create("", pool);
- err = (*plugin->do_checkout)(session_baton, editor, edit_baton);
- if (err)
- goto error;
-
- /* ### this should probably be inside of do_checkout */
- err = (*editor->close_edit)(edit_baton);
+ err = (*plugin->do_checkout)(session_baton, editor, root_dir_baton);
   if (err)
     goto error;
 
cvs server: Diffing libsvn_string
cvs server: Diffing libsvn_string/tests
cvs server: Diffing libsvn_subr
cvs server: Diffing libsvn_subr/tests
cvs server: Diffing libsvn_vcdiff
cvs server: Diffing libsvn_vcdiff/tests
cvs server: Diffing libsvn_wc
Index: libsvn_wc/adm_crawler.c
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_wc/adm_crawler.c,v
retrieving revision 1.70
diff -u -r1.70 adm_crawler.c
--- libsvn_wc/adm_crawler.c 2001/01/08 23:06:34 1.70
+++ libsvn_wc/adm_crawler.c 2001/01/24 23:18:06
@@ -196,7 +196,7 @@
 do_dir_replaces (void **newest_baton,
                  struct stack_object *stack,
                  const svn_delta_edit_fns_t *editor,
- void *edit_baton,
+ void *root_dir_baton,
                  apr_hash_t *locks,
                  apr_pool_t *top_pool,
                  apr_pool_t *pool)
@@ -216,18 +216,11 @@
       
       if (stackptr->previous)
         stackptr = stackptr->previous; /* descend. */
-
       else
         {
           /* Can't descend? We must be at stack bottom, fetch the
              root baton. */
- void *root_baton;
-
- err = editor->replace_root (edit_baton, &root_baton);
- if (err) return err;
-
- /* Store it */
- stackptr->baton = root_baton;
+ stackptr->baton = root_dir_baton;
           break;
         }
     }
@@ -610,7 +603,7 @@
 report_local_mods (svn_string_t *path,
                    void *dir_baton,
                    const svn_delta_edit_fns_t *editor,
- void *edit_baton,
+ void *root_dir_baton,
                    struct stack_object **stack,
                    apr_hash_t *affected_targets,
                    apr_hash_t *locks,
@@ -699,7 +692,7 @@
           if (! dir_baton)
             {
               err = do_dir_replaces (&dir_baton,
- *stack, editor, edit_baton,
+ *stack, editor, root_dir_baton,
                                      locks, top_pool, subpool);
               if (err) return err;
             }
@@ -735,7 +728,7 @@
           if (! dir_baton)
             {
               err = do_dir_replaces (&dir_baton,
- *stack, editor, edit_baton,
+ *stack, editor, root_dir_baton,
                                      locks, top_pool, subpool);
               if (err) return err;
             }
@@ -858,7 +851,7 @@
               if (! dir_baton)
                 {
                   err = do_dir_replaces (&dir_baton,
- *stack, editor, edit_baton,
+ *stack, editor, root_dir_baton,
                                          locks, top_pool, subpool);
                   if (err) return err;
                 }
@@ -913,7 +906,7 @@
              do_dir_replaces() and get the _correct_ dir baton for the
              child directory. */
           err = report_local_mods (full_path_to_entry, new_dir_baton,
- editor, edit_baton,
+ editor, root_dir_baton,
                                       stack, affected_targets, locks,
                                       top_pool);
           if (err) return err;
@@ -964,7 +957,7 @@
 svn_wc_crawl_local_mods (apr_hash_t **targets,
                          svn_string_t *root_directory,
                          const svn_delta_edit_fns_t *edit_fns,
- void *edit_baton,
+ void *root_dir_baton,
                          apr_pool_t *pool)
 {
   svn_error_t *err;
@@ -978,7 +971,7 @@
      Note that the first thing the crawler will do is push a new stack
      object onto the stack with PATH="root_directory" and BATON=NULL. */
   err = report_local_mods (root_directory, NULL,
- edit_fns, edit_baton,
+ edit_fns, root_dir_baton,
                            &stack, affected_targets, locks,
                            pool);
   if (err) return err;
@@ -996,7 +989,7 @@
      contain the root-dir baton. If so, close the editor. */
   if (stack->baton)
     {
- err = edit_fns->close_edit (edit_baton);
+ err = edit_fns->close_directory (root_dir_baton);
       if (err) return err;
     }
 
@@ -1012,7 +1005,7 @@
 svn_error_t *
 svn_wc_crawl_revisions (svn_string_t *root_directory,
                         const svn_delta_edit_fns_t *edit_fns,
- void *edit_baton,
+ void *root_dir_baton,
                         apr_pool_t *pool)
 {
   svn_error_t *err;
@@ -1032,19 +1025,13 @@
   master_revnum = root_entry->revision;
 
   /* Next, call replace_root() and push as first item on stack...? */
+ /* kff todo: Well, no, maybe replace_directory() now? Dunno. */
 
-
   /* Start the mini-crawler.
      err = report_revisions (root_directory, NULL,
- edit_fns, edit_baton,
+ edit_fns, root_dir_baton,
      &stack, master_revnum,
      pool); */
- if (err) return err;
-
-
- /* Close the edit, causing the update_editor to be driven. */
- err = edit_fns->close_edit (edit_baton);
- if (err) return err; /* pay attention to this return value!! */
 
   return SVN_NO_ERROR;
 
Index: libsvn_wc/get_editor.c
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_wc/get_editor.c,v
retrieving revision 1.158
diff -u -r1.158 get_editor.c
--- libsvn_wc/get_editor.c 2001/01/08 23:06:34 1.158
+++ libsvn_wc/get_editor.c 2001/01/24 23:18:08
@@ -42,7 +42,7 @@
 
 /*** batons ***/
 
-struct edit_baton
+struct edit_context
 {
   svn_string_t *dest_dir;
   svn_revnum_t target_revision;
@@ -74,7 +74,7 @@
   int ref_count;
 
   /* The global edit baton. */
- struct edit_baton *edit_baton;
+ struct edit_context *edit_context;
 
   /* Baton for this directory's parent, or NULL if this is the root
      directory. */
@@ -104,7 +104,7 @@
 };
 
 /* Create a new dir_baton for subdir NAME in PARENT_PATH with
- * EDIT_BATON, using a new subpool of POOL.
+ * EDIT_CONTEXT, using a new subpool of POOL.
  *
  * The new baton's ref_count is 1.
  *
@@ -112,21 +112,21 @@
  */
 static struct dir_baton *
 make_dir_baton (svn_string_t *name,
- struct edit_baton *edit_baton,
+ struct edit_context *edit_context,
                 struct dir_baton *parent_baton,
                 apr_pool_t *pool)
 {
   apr_pool_t *subpool = svn_pool_create (pool);
   struct dir_baton *d = apr_pcalloc (subpool, sizeof (*d));
   svn_string_t *parent_path
- = parent_baton ? parent_baton->path : edit_baton->dest_dir;
+ = parent_baton ? parent_baton->path : edit_context->dest_dir;
   svn_string_t *path = svn_string_dup (parent_path, subpool);
 
- if (name)
+ if (name) /* kff todo: yo, is this a bug?? */
     svn_path_add_component (path, name, svn_path_local_style);
 
   d->path = path;
- d->edit_baton = edit_baton;
+ d->edit_context = edit_context;
   d->parent_baton = parent_baton;
   d->ref_count = 1;
   d->pool = subpool;
@@ -155,7 +155,7 @@
   /* Bump this dir to the new revision. */
   err = svn_wc__entry_merge_sync (dir_baton->path,
                                   NULL,
- dir_baton->edit_baton->target_revision,
+ dir_baton->edit_context->target_revision,
                                   svn_node_dir,
                                   0,
                                   0,
@@ -177,6 +177,11 @@
       if (err)
         return err;
     }
+ else
+ {
+ /* This was the root directory, so the edit is over. */
+ apr_destroy_pool (dir_baton->edit_context->pool);
+ }
 
   return SVN_NO_ERROR;
 }
@@ -291,7 +296,7 @@
 
   /* Either we're done (window is NULL) or we had an error. In either
      case, clean up the handler. */
- if ((! fb->dir_baton->edit_baton->is_checkout) && hb->source)
+ if ((! fb->dir_baton->edit_context->is_checkout) && hb->source)
     {
       err2 = svn_wc__close_text_base (hb->source, fb->path, 0, fb->pool);
       if (err2 != SVN_NO_ERROR && err == SVN_NO_ERROR)
@@ -369,10 +374,10 @@
 /*** The callbacks we'll plug into an svn_delta_edit_fns_t structure. ***/
 
 static svn_error_t *
-replace_root (void *edit_baton,
+replace_root (void *edit_context,
               void **dir_baton)
 {
- struct edit_baton *eb = edit_baton;
+ struct edit_context *eb = edit_context;
   struct dir_baton *d;
   svn_error_t *err;
   svn_string_t *ancestor_path;
@@ -469,7 +474,7 @@
 
   struct dir_baton *this_dir_baton
     = make_dir_baton (name,
- parent_dir_baton->edit_baton,
+ parent_dir_baton->edit_context,
                       parent_dir_baton,
                       parent_dir_baton->pool);
 
@@ -490,7 +495,7 @@
 
 
   err = prep_directory (this_dir_baton->path,
- this_dir_baton->edit_baton->repository,
+ this_dir_baton->edit_context->repository,
                         ancestor_path,
                         ancestor_revision,
                         1, /* force */
@@ -519,7 +524,7 @@
 
   struct dir_baton *this_dir_baton
     = make_dir_baton (name,
- parent_dir_baton->edit_baton,
+ parent_dir_baton->edit_context,
                       parent_dir_baton,
                       parent_dir_baton->pool);
 
@@ -619,7 +624,7 @@
       /* Set revision. */
       revision_str = apr_psprintf (db->pool,
                                    "%d",
- db->edit_baton->target_revision);
+ db->edit_context->target_revision);
       
       /* Write a log entry to bump the directory's revision. */
       svn_xml_make_open_tag (&entry_accum,
@@ -797,7 +802,7 @@
 
   /* Open the text base for reading, unless this is a checkout. */
   hb->source = NULL;
- if (! fb->dir_baton->edit_baton->is_checkout)
+ if (! fb->dir_baton->edit_context->is_checkout)
     {
       /*
          kff todo: what we really need to do here is:
@@ -1204,7 +1209,7 @@
   /* Set revision. */
   revision_str = apr_psprintf (fb->pool,
                               "%d",
- fb->dir_baton->edit_baton->target_revision);
+ fb->dir_baton->edit_context->target_revision);
 
   /* Write log entry which will bump the revision number: */
   svn_xml_make_open_tag (&entry_accum,
@@ -1307,26 +1312,11 @@
 }
 
 
-static svn_error_t *
-close_edit (void *edit_baton)
-{
- struct edit_baton *eb = edit_baton;
-
- /* The edit is over, free its pool. */
- apr_destroy_pool (eb->pool);
-
- /* kff todo: Wow. Is there _anything_ else that needs to be done? */
-
- return SVN_NO_ERROR;
-}
-
-
 
 /*** Returning editors. ***/
 
 static const svn_delta_edit_fns_t tree_editor =
 {
- replace_root,
   delete_item,
   add_directory,
   replace_directory,
@@ -1337,7 +1327,6 @@
   apply_textdelta,
   change_file_prop,
   close_file,
- close_edit
 };
 
 
@@ -1349,31 +1338,46 @@
              svn_string_t *repos,
              svn_string_t *ancestor_path,
              const svn_delta_edit_fns_t **editor,
- void **edit_baton,
+ void **root_dir_baton,
              apr_pool_t *pool)
 {
- struct edit_baton *eb;
+ struct edit_context *ec;
+ struct dir_baton *rb;
   apr_pool_t *subpool = svn_pool_create (pool);
 
- /* Else nothing in the way, so continue. */
-
- *editor = &tree_editor;
-
   if (is_checkout)
     {
       assert (ancestor_path != NULL);
       assert (repos != NULL);
     }
 
- eb = apr_palloc (subpool, sizeof (*eb));
- eb->dest_dir = dest;
- eb->pool = subpool;
- eb->is_checkout = is_checkout;
- eb->ancestor_path = ancestor_path;
- eb->repository = repos;
- eb->target_revision = target_revision;
+ /* Construct an edit context. */
+ ec = apr_palloc (subpool, sizeof (*ec));
+ ec->pool = subpool;
+ ec->dest_dir = dest;
+ ec->is_checkout = is_checkout;
+ ec->ancestor_path = ancestor_path;
+ ec->repository = repos;
+ ec->target_revision = target_revision;
 
- *edit_baton = eb;
+ /* Construct root directory baton. */
+ rb = make_dir_baton (NULL, ec, NULL, ec->pool);
+
+ /* Prep root directory if this is a checkout. */
+ if (is_checkout)
+ {
+ err = prep_directory (d->path,
+ ec->repository,
+ ec->ancestor_path,
+ ec->ancestor_revision,
+ 1, /* force */
+ d->pool);
+ if (err)
+ return err;
+ }
+
+ *root_dir_baton = rb;
+ *editor = &tree_editor;
 
   return SVN_NO_ERROR;
 }
@@ -1383,13 +1387,13 @@
 svn_wc_get_update_editor (svn_string_t *dest,
                           svn_revnum_t target_revision,
                           const svn_delta_edit_fns_t **editor,
- void **edit_baton,
+ void **edit_context,
                           apr_pool_t *pool)
 {
   return
     make_editor (dest, target_revision,
                  0, NULL, NULL,
- editor, edit_baton, pool);
+ editor, edit_context, pool);
 }
 
 
@@ -1399,12 +1403,12 @@
                             svn_string_t *ancestor_path,
                             svn_revnum_t target_revision,
                             const svn_delta_edit_fns_t **editor,
- void **edit_baton,
+ void **edit_context,
                             apr_pool_t *pool)
 {
   return make_editor (dest, target_revision,
                       1, repos, ancestor_path,
- editor, edit_baton, pool);
+ editor, edit_context, pool);
 }
 
 
Index: libsvn_wc/status.c
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_wc/status.c,v
retrieving revision 1.24
diff -u -r1.24 status.c
--- libsvn_wc/status.c 2001/01/09 00:05:22 1.24
+++ libsvn_wc/status.c 2001/01/24 23:18:08
@@ -88,7 +88,13 @@
          "textual" in the sense that the "text" of a directory is
          a list of entries, which has now been changed? And would
          we then show that `M' in the first column? Ponder,
- ponder. */
+ ponder.
+
+ kff answers: I don't think we do. The fact that the
+ directory's "text" has been changed is an artifact of the
+ implementation, it's not how users actually think of it.
+ People think of the file as having been added or deleted, not
+ of its parent having an entry added or deleted. */
       
       /* Mark `M' in status structure based on tests above. */
       if (text_modified_p)
cvs server: Diffing libsvn_wc/tests
Index: libsvn_wc/tests/checkout-test.c
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_wc/tests/checkout-test.c,v
retrieving revision 1.37
diff -u -r1.37 checkout-test.c
--- libsvn_wc/tests/checkout-test.c 2000/12/23 22:24:51 1.37
+++ libsvn_wc/tests/checkout-test.c 2001/01/24 23:18:08
@@ -39,7 +39,7 @@
              apr_pool_t *pool)
 {
   const svn_delta_edit_fns_t *editor;
- void *edit_baton;
+ void *root_dir_baton;
   svn_error_t *err;
 
   /* Get the editor and friends... */
@@ -49,7 +49,7 @@
                                     svn_string_create ("", pool),
                                     revision,
                                     &editor,
- &edit_baton,
+ &root_dir_baton,
                                     pool);
   if (err)
     return err;
@@ -57,7 +57,7 @@
   /* ... and edit! */
   return svn_delta_xml_auto_parse (delta,
                                    editor,
- edit_baton,
+ root_dir_baton,
                                    svn_string_create ("", pool),
                                    revision,
                                    pool);
Index: libsvn_wc/tests/commit-test.c
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_wc/tests/commit-test.c,v
retrieving revision 1.15
diff -u -r1.15 commit-test.c
--- libsvn_wc/tests/commit-test.c 2000/12/24 10:35:24 1.15
+++ libsvn_wc/tests/commit-test.c 2001/01/24 23:18:08
@@ -41,7 +41,7 @@
   apr_hash_t *targets = NULL;
 
   const svn_delta_edit_fns_t *my_editor;
- void *my_edit_baton;
+ void *my_root_dir_baton;
 
   svn_string_t *rootdir;
 
@@ -77,7 +77,7 @@
       
       err = svn_delta_get_xml_editor (svn_stream_from_aprfile (stdout_handle,
                                                                globalpool),
- &my_editor, &my_edit_baton,
+ &my_editor, &my_root_dir_baton,
                                       globalpool);
       if (err)
         {
@@ -89,7 +89,7 @@
 
   else /* human-readable output */
     {
- err = svn_test_get_editor (&my_editor, &my_edit_baton,
+ err = svn_test_get_editor (&my_editor, &my_root_dir_baton,
                                  rootdir, 59, globalpool);
       if (err)
         {
@@ -100,7 +100,8 @@
     }
 
   /* Call the commit-crawler with the editor. */
- err = svn_wc_crawl_local_mods (&targets, rootdir, my_editor, my_edit_baton,
+ err = svn_wc_crawl_local_mods (&targets, rootdir,
+ my_editor, my_root_dir_baton,
                                  globalpool);
   if (err)
     {
Received on Sat Oct 21 14:36:19 2006

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.