Author: cmpilato
Date: Fri Jul 30 00:43:02 2010
New Revision: 980620

URL: http://svn.apache.org/viewvc?rev=980620&view=rev
Log:
Sync with trunk changes. (Merged /subversion/trunk:r980543-980617)

Modified:
    subversion/branches/issue-2779-dev/   (props changed)
    subversion/branches/issue-2779-dev/subversion/include/svn_wc.h
    subversion/branches/issue-2779-dev/subversion/libsvn_client/patch.c
    subversion/branches/issue-2779-dev/subversion/libsvn_wc/adm_crawler.c
    subversion/branches/issue-2779-dev/subversion/svn/notify.c
    subversion/branches/issue-2779-dev/subversion/svnrdump/dumpfile_parser.c
    subversion/branches/issue-2779-dev/subversion/svnrdump/load_editor.c
    subversion/branches/issue-2779-dev/subversion/svnrdump/load_editor.h
    subversion/branches/issue-2779-dev/subversion/svnrdump/svnrdump.c

Propchange: subversion/branches/issue-2779-dev/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 30 00:43:02 2010
@@ -34,4 +34,4 @@
 /subversion/branches/tc_url_rev:874351-874483
 /subversion/branches/tree-conflicts:868291-873154
 /subversion/branches/tree-conflicts-notify:873926-874008
-/subversion/trunk:965496-980542
+/subversion/trunk:965496-980617

Modified: subversion/branches/issue-2779-dev/subversion/include/svn_wc.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/include/svn_wc.h?rev=980620&r1=980619&r2=980620&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/include/svn_wc.h (original)
+++ subversion/branches/issue-2779-dev/subversion/include/svn_wc.h Fri Jul 30 
00:43:02 2010
@@ -1271,10 +1271,6 @@ typedef struct svn_wc_notify_t {
    * @since New in 1.7 */
   int hunk_fuzz;
 
-  /** If @c action relates to hunks, specifies whether the hunk is a
-   * property hunk or not. */
-  svn_boolean_t is_prop_hunk;
-
   /* NOTE: Add new fields at the end to preserve binary compatibility.
      Also, if you add fields here, you have to update svn_wc_create_notify
      and svn_wc_dup_notify. */

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_client/patch.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_client/patch.c?rev=980620&r1=980619&r2=980620&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/libsvn_client/patch.c 
(original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_client/patch.c Fri Jul 
30 00:43:02 2010
@@ -1519,8 +1519,7 @@ send_patch_notification(const patch_targ
             svn_diff_hunk_get_modified_length(hi->hunk);
           notify->hunk_matched_line = hi->matched_line;
           notify->hunk_fuzz = hi->fuzz;
-          /* ### Should is_prop_hunk be a field in hunk_info_t? */
-          notify->is_prop_hunk = FALSE;
+          notify->prop_name = NULL;
 
           (*ctx->notify_func2)(ctx->notify_baton2, notify, pool);
         }
@@ -1563,8 +1562,7 @@ send_patch_notification(const patch_targ
                 svn_diff_hunk_get_modified_length(hi->hunk);
               notify->hunk_matched_line = hi->matched_line;
               notify->hunk_fuzz = hi->fuzz;
-              /* ### Should is_prop_hunk be a field in hunk_info_t? */
-              notify->is_prop_hunk = TRUE;
+              notify->prop_name = apr_pstrdup(pool, prop_target->name);
 
               (*ctx->notify_func2)(ctx->notify_baton2, notify, pool);
             }

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_wc/adm_crawler.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_wc/adm_crawler.c?rev=980620&r1=980619&r2=980620&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/libsvn_wc/adm_crawler.c 
(original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_wc/adm_crawler.c Fri 
Jul 30 00:43:02 2010
@@ -419,14 +419,19 @@ report_revisions_and_depths(svn_wc__db_t
                                              db, this_abspath,
                                              iterpool, iterpool));
 
-          if (restore_files
-              && wrk_status != svn_wc__db_status_added
 #ifndef SVN_WC__SINGLE_DB
-              && wrk_status != svn_wc__db_status_obstructed_add
-              && wrk_status != svn_wc__db_status_obstructed_delete
+          if (wrk_status == svn_wc__db_status_obstructed
+              || wrk_status == svn_wc__db_status_obstructed_add
+              || wrk_status == svn_wc__db_status_obstructed_delete)
+            missing = TRUE;
+          else
 #endif
-              && wrk_status != svn_wc__db_status_deleted)
-              
+          if (restore_files
+              && wrk_status != svn_wc__db_status_added
+              && wrk_status != svn_wc__db_status_deleted
+              && wrk_status != svn_wc__db_status_excluded
+              && wrk_status != svn_wc__db_status_not_present
+              && wrk_status != svn_wc__db_status_absent)
             {
               svn_node_kind_t dirent_kind;
 
@@ -448,9 +453,6 @@ report_revisions_and_depths(svn_wc__db_t
                 }
             }
 #ifndef SVN_WC__SINGLE_DB
-          else
-            missing = TRUE;
-
           /* If a node is still missing from disk here, we have no way to
              recreate it locally, so report as missing and move along.
              Again, don't bother if we're reporting everything, because the
@@ -761,6 +763,7 @@ svn_wc_crawl_revisions5(svn_wc_context_t
   const char *repos_relpath=NULL, *repos_root=NULL;
   svn_depth_t target_depth = svn_depth_unknown;
   svn_wc__db_lock_t *target_lock = NULL;
+  svn_node_kind_t disk_kind;
   svn_boolean_t explicit_rev;
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
@@ -888,45 +891,69 @@ svn_wc_crawl_revisions5(svn_wc_context_t
   if (target_depth == svn_depth_unknown)
     target_depth = svn_depth_infinity;
 
-  /* The first call to the reporter merely informs it that the
-     top-level directory being updated is at BASE_REV.  Its PATH
-     argument is ignored. */
-  SVN_ERR(reporter->set_path(report_baton, "", target_rev, target_depth,
-                             start_empty, NULL, scratch_pool));
+  SVN_ERR(svn_io_check_path(local_abspath, &disk_kind, scratch_pool));
 
-  /* ### status can NEVER be deleted. should examine why this was
-     ### ever here. we may have remapped into wc-ng incorrectly.  */
-  if (status != svn_wc__db_status_deleted)
+  /* Determine if there is a missing node that should be restored */
+  if (disk_kind == svn_node_none)
     {
-      apr_finfo_t info;
-      err = svn_io_stat(&info, local_abspath, APR_FINFO_MIN, scratch_pool);
-      if (err)
+      svn_wc__db_status_t wrk_status;
+      err = svn_wc__db_read_info(&wrk_status, NULL, NULL, NULL, NULL, NULL,
+                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                                 NULL, NULL, NULL, NULL,
+                                 db, local_abspath,
+                                 scratch_pool, scratch_pool);
+
+
+      if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
         {
-          if (APR_STATUS_IS_ENOENT(err->apr_err))
-            missing = TRUE;
           svn_error_clear(err);
-          err = NULL;
+          wrk_status = svn_wc__db_status_not_present;
         }
-    }
+      else
+        SVN_ERR(err);
 
-  if (missing && restore_files)
-    {
-      svn_boolean_t restored;
+      if (wrk_status == svn_wc__db_status_added)
+        SVN_ERR(svn_wc__db_scan_addition(&wrk_status, NULL, NULL, NULL, NULL,
+                                         NULL, NULL, NULL, NULL,
+                                         db, local_abspath,
+                                         scratch_pool, scratch_pool));
 
-      err = restore_node(&restored, wc_ctx->db, local_abspath,
-                         target_kind, use_commit_times,
-                         notify_func, notify_baton,
-                         scratch_pool);
+#ifndef SVN_WC__SINGLE_DB
+      if (wrk_status == svn_wc__db_status_obstructed
+          || wrk_status == svn_wc__db_status_obstructed_add
+          || wrk_status == svn_wc__db_status_obstructed_delete)
+        missing = TRUE;
+      else
+#endif
+      if (restore_files
+          && wrk_status != svn_wc__db_status_added
+          && wrk_status != svn_wc__db_status_deleted
+          && wrk_status != svn_wc__db_status_excluded
+          && wrk_status != svn_wc__db_status_not_present
+          && wrk_status != svn_wc__db_status_absent)
+        {
+          svn_boolean_t restored;
 
-      if (err)
-          goto abort_report;
+          SVN_ERR(restore_node(&restored, wc_ctx->db, local_abspath,
+                               target_kind, use_commit_times,
+                               notify_func, notify_baton,
+                               scratch_pool));
 
-      if (restored)
-        missing = FALSE;
+          if (!restored)
+            missing = TRUE;
+        }
     }
 
+  /* The first call to the reporter merely informs it that the
+     top-level directory being updated is at BASE_REV.  Its PATH
+     argument is ignored. */
+  SVN_ERR(reporter->set_path(report_baton, "", target_rev, target_depth,
+                             start_empty, NULL, scratch_pool));
+
   if (target_kind == svn_wc__db_kind_dir)
     {
+#ifndef SVN_WC__SINGLE_DB
       if (missing)
         {
           /* Report missing directories as deleted to retrieve them
@@ -935,7 +962,9 @@ svn_wc_crawl_revisions5(svn_wc_context_t
           if (err)
             goto abort_report;
         }
-      else if (depth != svn_depth_empty)
+      else
+#endif
+      if (depth != svn_depth_empty)
         {
           /* Recursively crawl ROOT_DIRECTORY and report differing
              revisions. */

Modified: subversion/branches/issue-2779-dev/subversion/svn/notify.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/svn/notify.c?rev=980620&r1=980619&r2=980620&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/svn/notify.c (original)
+++ subversion/branches/issue-2779-dev/subversion/svn/notify.c Fri Jul 30 
00:43:02 2010
@@ -310,60 +310,96 @@ notify(void *baton, const svn_wc_notify_
               minus = "-";
             }
 
-          /* ### APR_INT64_T_FMT isn't translator-friendly */
+          /* ### We're creating the localized strings without
+           * ### APR_INT64_T_FMT since it isn't translator-friendly */
           if (n->hunk_fuzz)
             {
-              if (n->is_prop_hunk)
-                s = _(">         applied hunk ## -%lu,%lu +%lu,%lu ## "
-                      "with offset %s");
+
+              if (n->prop_name)
+                {
+                  s = _(">         applied hunk ## -%lu,%lu +%lu,%lu ## "
+                        "with offset %s");
+
+                  err = svn_cmdline_printf(pool,
+                                           apr_pstrcat(pool, s,
+                                                       "%"APR_UINT64_T_FMT
+                                                       " and fuzz %d (%s)\n",
+                                                       NULL),
+                                           n->hunk_original_start,
+                                           n->hunk_original_length,
+                                           n->hunk_modified_start,
+                                           n->hunk_modified_length,
+                                           minus, off, n->hunk_fuzz,
+                                           n->prop_name);
+                }
               else
-                s = _(">         applied hunk @@ -%lu,%lu +%lu,%lu @@ "
-                      "with offset %s");
+                {
+                  s = _(">         applied hunk @@ -%lu,%lu +%lu,%lu @@ "
+                        "with offset %s");
+
+                  err = svn_cmdline_printf(pool,
+                                           apr_pstrcat(pool, s,
+                                                       "%"APR_UINT64_T_FMT
+                                                       " and fuzz %d\n",
+                                                       NULL),
+                                           n->hunk_original_start,
+                                           n->hunk_original_length,
+                                           n->hunk_modified_start,
+                                           n->hunk_modified_length,
+                                           minus, off, n->hunk_fuzz);
+                }
 
-              if ((err = svn_cmdline_printf(pool,
-                                            apr_pstrcat(pool, s,
-                                                        "%"APR_UINT64_T_FMT
-                                                        " and fuzz %d\n",
-                                                        NULL),
-                                            n->hunk_original_start,
-                                            n->hunk_original_length,
-                                            n->hunk_modified_start,
-                                            n->hunk_modified_length,
-                                            minus, off, n->hunk_fuzz)))
+              if (err)
                 goto print_error;
             }
           else
             {
-              if (n->is_prop_hunk)
-                s = _(">         applied hunk ## -%lu,%lu +%lu,%lu ## "
-                      "with offset %s");
-              else
-                s = _(">         applied hunk @@ -%lu,%lu +%lu,%lu @@ "
-                      "with offset %s");
 
-              if ((err = svn_cmdline_printf(pool,
+              if (n->prop_name)
+                {
+                  s = _(">         applied hunk ## -%lu,%lu +%lu,%lu ## "
+                        "with offset %s");
+                  err = svn_cmdline_printf(pool,
                                             apr_pstrcat(pool, s,
-                                                        
"%"APR_UINT64_T_FMT"\n",
+                                                        "%"APR_UINT64_T_FMT" 
(%s)\n",
                                                         NULL),
                                             n->hunk_original_start,
                                             n->hunk_original_length,
                                             n->hunk_modified_start,
                                             n->hunk_modified_length,
-                                            minus, off)))
+                                            minus, off, n->prop_name);
+                }
+              else
+                {
+                  s = _(">         applied hunk @@ -%lu,%lu +%lu,%lu @@ "
+                        "with offset %s");
+                  err = svn_cmdline_printf(pool,
+                                           apr_pstrcat(pool, s,
+                                                       "%"APR_UINT64_T_FMT"\n",
+                                                       NULL),
+                                           n->hunk_original_start,
+                                           n->hunk_original_length,
+                                           n->hunk_modified_start,
+                                           n->hunk_modified_length,
+                                           minus, off);
+                }
+
+              if (err)
                 goto print_error;
             }
         }
       else if (n->hunk_fuzz)
         {
-          if (n->is_prop_hunk)
+          if (n->prop_name)
             err = svn_cmdline_printf(pool,
                           _(">         applied hunk ## -%lu,%lu +%lu,%lu ## "
-                                        "with fuzz %d\n"),
+                                        "with fuzz %d (%s)\n"),
                                         n->hunk_original_start,
                                         n->hunk_original_length,
                                         n->hunk_modified_start,
                                         n->hunk_modified_length,
-                                        n->hunk_fuzz);
+                                        n->hunk_fuzz,
+                                        n->prop_name);
           else
             err = svn_cmdline_printf(pool,
                           _(">         applied hunk @@ -%lu,%lu +%lu,%lu @@ "
@@ -382,14 +418,15 @@ notify(void *baton, const svn_wc_notify_
     case svn_wc_notify_patch_rejected_hunk:
       nb->received_some_change = TRUE;
 
-      if (n->is_prop_hunk)
+      if (n->prop_name)
         err = svn_cmdline_printf(pool,
                                  _(">         rejected hunk "
-                                   "## -%lu,%lu +%lu,%lu ##\n"),
+                                   "## -%lu,%lu +%lu,%lu ## (%s)\n"),
                                  n->hunk_original_start,
                                  n->hunk_original_length,
                                  n->hunk_modified_start,
-                                 n->hunk_modified_length);
+                                 n->hunk_modified_length,
+                                 n->prop_name);
       else
         err = svn_cmdline_printf(pool,
                                  _(">         rejected hunk "
@@ -404,15 +441,16 @@ notify(void *baton, const svn_wc_notify_
 
     case svn_wc_notify_patch_hunk_already_applied:
       nb->received_some_change = TRUE;
-      if (n->is_prop_hunk)
+      if (n->prop_name)
         err = svn_cmdline_printf(pool,
                                  _(">         hunk "
-                                   "@@ -%lu,%lu +%lu,%lu @@ "
-                                   "already applied\n"),
+                                   "## -%lu,%lu +%lu,%lu ## "
+                                   "already applied (%s)\n"),
                                  n->hunk_original_start,
                                  n->hunk_original_length,
                                  n->hunk_modified_start,
-                                 n->hunk_modified_length);
+                                 n->hunk_modified_length,
+                                 n->prop_name);
       else
         err = svn_cmdline_printf(pool,
                                  _(">         hunk "

Modified: 
subversion/branches/issue-2779-dev/subversion/svnrdump/dumpfile_parser.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/svnrdump/dumpfile_parser.c?rev=980620&r1=980619&r2=980620&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/svnrdump/dumpfile_parser.c 
(original)
+++ subversion/branches/issue-2779-dev/subversion/svnrdump/dumpfile_parser.c 
Fri Jul 30 00:43:02 2010
@@ -6,21 +6,160 @@
 
 #include "load_editor.h"
 
+static svn_error_t *
+new_revision_record(void **revision_baton,
+                   apr_hash_t *headers,
+                   void *parse_baton,
+                   apr_pool_t *pool)
+{
+  struct revision_baton *rb;
+  rb = apr_pcalloc(pool, sizeof(*rb));
+  rb->pb = parse_baton;
+
+  fprintf(stderr, "new_revision_record called\n");
+
+  *revision_baton = rb;
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+uuid_record(const char *uuid,
+            void *parse_baton,
+            apr_pool_t *pool)
+{
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+new_node_record(void **node_baton,
+                apr_hash_t *headers,
+                void *revision_baton,
+                apr_pool_t *pool)
+{
+  struct node_baton *nb;
+  nb = apr_pcalloc(pool, sizeof(*nb));
+  nb->rb = revision_baton;
+
+  fprintf(stderr, "new_node_record called\n");
+
+  *node_baton = nb;
+  return SVN_NO_ERROR;
+}
+
+
+static svn_error_t *
+set_revision_property(void *baton,
+                      const char *name,
+                      const svn_string_t *value)
+{
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+set_node_property(void *baton,
+                  const char *name,
+                  const svn_string_t *value)
+{
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+delete_node_property(void *baton,
+                     const char *name)
+{
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+remove_node_props(void *baton)
+{
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+set_fulltext(svn_stream_t **stream,
+             void *node_baton)
+{
+  return SVN_NO_ERROR;
+}
+
+#if 0
+static svn_error_t *
+apply_window(svn_txdelta_window_t *window, void *baton)
+{
+  struct apply_baton *apply_baton;
+  apr_size_t tlen;
+  apply_baton = baton;
+  if (window == NULL)
+    return SVN_NO_ERROR;
+
+  tlen = window->tview_len;
+  apply_baton->target = apr_pcalloc(apply_baton->pool, tlen);
+  svn_txdelta_apply_instructions(window, apply_baton->source,
+                                 apply_baton->target, &tlen);
+  return SVN_NO_ERROR;
+}
+#endif
+
+static svn_error_t *
+apply_window(svn_txdelta_window_t *window, void *baton)
+{
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+apply_textdelta(svn_txdelta_window_handler_t *handler,
+                void **handler_baton,
+                void *node_baton)
+{
+  struct node_baton *nb;
+  nb = node_baton;
+  *handler = apply_window;
+  *handler_baton = nb->rb->pb->ab;
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+close_node(void *baton)
+{
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+close_revision(void *baton)
+{
+  return SVN_NO_ERROR;
+}
+
 svn_error_t *
 build_dumpfile_parser(const svn_repos_parse_fns2_t **parser,
                       void **parse_baton,
-                      svn_stream_t *stream,
                       apr_pool_t *pool)
 {
   svn_repos_parse_fns2_t *pf;
+  struct parse_baton *pb;
+  struct apply_baton *ab;
 
   pf = apr_pcalloc(pool, sizeof(*pf));
-
-  SVN_ERR(svn_repos_parse_dumpstream2(stream, pf, NULL,
-                                      NULL, NULL, pool));
+  pf->new_revision_record = new_revision_record;
+  pf->uuid_record = uuid_record;
+  pf->new_node_record = new_node_record;
+  pf->set_revision_property = set_revision_property;
+  pf->set_node_property = set_node_property;
+  pf->delete_node_property = delete_node_property;
+  pf->remove_node_props = remove_node_props;
+  pf->set_fulltext = set_fulltext;
+  pf->apply_textdelta = apply_textdelta;
+  pf->close_node = close_node;
+  pf->close_revision = close_revision;
+
+  pb = apr_pcalloc(pool, sizeof(*pb));
+  ab = apr_pcalloc(pool, sizeof(struct apply_baton));
+  ab->source = apr_pstrmemdup(pool, " ", sizeof(" "));
+  pb->ab = ab;
 
   *parser = pf;
-  *parse_baton = NULL;
+  *parse_baton = pb;
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/issue-2779-dev/subversion/svnrdump/load_editor.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/svnrdump/load_editor.c?rev=980620&r1=980619&r2=980620&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/svnrdump/load_editor.c 
(original)
+++ subversion/branches/issue-2779-dev/subversion/svnrdump/load_editor.c Fri 
Jul 30 00:43:02 2010
@@ -44,10 +44,18 @@ commit_callback(const svn_commit_info_t 
 }
 
 svn_error_t *
-drive_load_editor(struct operation *operation,
-                  const svn_delta_editor_t *editor,
+drive_load_editor(const svn_delta_editor_t *editor,
+                  void *edit_baton,
+                  struct operation *operation,
+                  svn_stream_t *stream,
                   apr_pool_t *pool)
 {
+  const svn_repos_parse_fns2_t *parser;
+  void *pb;
+  SVN_ERR(build_dumpfile_parser(&parser, &pb, pool));
+  SVN_ERR(svn_repos_parse_dumpstream2(stream, parser, pb,
+                                      NULL, NULL, pool));
+
   return SVN_NO_ERROR;
 }
 
@@ -57,25 +65,30 @@ svn_error_t *
 get_load_editor(const svn_delta_editor_t **editor,
                 void **edit_baton,
                 struct operation **root_operation,
-                svn_stream_t *stream,
                 svn_ra_session_t *session,
                 apr_pool_t *pool)
 {
-  const svn_repos_parse_fns2_t *parser;
-  void *pb = NULL;
   const svn_delta_editor_t *de;
   struct operation *root;
+  struct commit_dir_baton *db;
+  apr_hash_t *revprop_table;
+  void *cb;
 
   root = apr_pcalloc(pool, sizeof(*root));
+  db = apr_pcalloc(pool, sizeof(*db));
+  root->baton = db;
+  revprop_table = apr_hash_make(pool);
 
   SVN_ERR(svn_ra_get_latest_revnum(session, &(root->revision), pool));
-  SVN_ERR(build_dumpfile_parser(&parser, &pb, stream, pool));
-  SVN_ERR(svn_ra_get_commit_editor3(session, &de, NULL, NULL,
+ 
+  /* Call the commit editor and get back a delta_editor and
+     commit_baton to use for performing the actual commit */
+  SVN_ERR(svn_ra_get_commit_editor3(session, &de, &cb, revprop_table,
                                     commit_callback, NULL, NULL, FALSE, pool));
-  SVN_ERR(de->open_root(NULL, root->revision, pool, root->baton));
+  SVN_ERR(de->open_root(cb, root->revision, pool, root->baton));
 
   *editor = de;
-  *edit_baton = NULL;
+  *edit_baton = cb;
   *root_operation = root;
 
   return SVN_NO_ERROR;

Modified: subversion/branches/issue-2779-dev/subversion/svnrdump/load_editor.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/svnrdump/load_editor.h?rev=980620&r1=980619&r2=980620&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/svnrdump/load_editor.h 
(original)
+++ subversion/branches/issue-2779-dev/subversion/svnrdump/load_editor.h Fri 
Jul 30 00:43:02 2010
@@ -29,6 +29,60 @@
 #define LOAD_EDITOR_H_
 
 /**
+ * Baton used by the txdelta applier.
+ */
+struct apply_baton
+{
+  const char *source;
+  char *target;
+  apr_pool_t *pool;
+};
+
+/**
+ * General baton used by the parser functions. Contains a link to
+ * apply baton.
+ */
+struct parse_baton
+{
+  struct apply_baton *ab;
+};
+
+/**
+ * Baton used to represent a node; to be used by the parser
+ * functions. Contains a link to the revision baton.
+ */
+struct node_baton
+{
+  const char *path;
+  svn_node_kind_t kind;
+
+  svn_revnum_t copyfrom_rev;
+  const char *copyfrom_path;
+
+  struct revision_baton *rb;
+  apr_pool_t *pool;
+};
+
+/**
+ * Baton used to represet a revision; used by the parser
+ * functions. Contains a link to the parser baton.
+ */
+struct revision_baton
+{
+  svn_revnum_t rev;
+
+  svn_fs_txn_t *txn;
+  svn_fs_root_t *txn_root;
+
+  const svn_string_t *datestamp;
+
+  apr_int32_t rev_offset;
+
+  struct parse_baton *pb;
+  apr_pool_t *pool;
+};
+
+/**
  * Used to represent an operation to perform while driving the load
  * editor.
  */
@@ -41,10 +95,22 @@ struct operation {
     OP_PROPSET
   } operation;
 
-  svn_revnum_t revision; /* The revision on which the operation is being 
performed */
-  void *baton;           /* as returned by the commit editor */
+  svn_revnum_t revision;        /* The revision on which the operation is 
being performed */
+  void *baton;                  /* Represents a commit_dir_baton object */
 };
 
+/**
+ * A directory baton from commit.c.
+ */
+struct commit_dir_baton
+{
+  struct commit_baton *edit_baton;
+  struct commit_dir_baton *parent;
+  const char *path; /* the -absolute- path to this dir in the fs */
+  svn_revnum_t base_rev;        /* the revision I'm based on  */
+  svn_boolean_t was_copied; /* was this directory added with history? */
+  apr_pool_t *pool; /* my personal pool, in which I am allocated. */
+};
 
 /**
  * Build up a @a parser for parsing a dumpfile stream from @a stream
@@ -54,30 +120,29 @@ struct operation {
 svn_error_t *
 build_dumpfile_parser(const svn_repos_parse_fns2_t **parser,
                       void **parse_baton,
-                      svn_stream_t *stream,
                       apr_pool_t *pool);
 
 /**
- * Drive the load editor @a editor to perform the @a operation on
- * @a revison using @a pool for all memory allocations.
+ * Drive the load editor @a editor using the data in @a stream using
+ * @a pool for all memory allocations.
  */
 svn_error_t *
-drive_load_editor(struct operation *operation,
-                  const svn_delta_editor_t *editor,
+drive_load_editor(const svn_delta_editor_t *editor,
+                  void *edit_baton,
+                  struct operation *operation,
+                  svn_stream_t *stream,
                   apr_pool_t *pool);
 
 /**
  * Get a load editor @a editor along with an @a edit_baton and an
  * operation @a root_operation corresponding to open_root, all
- * allocated in @a pool. The editor will read a dumpstream from @a
- * stream and load it into @a session when driven using
- * drive_load_editor().
+ * allocated in @a pool. The load editor will commit revisions to @a
+ * session when driven using drive_load_editor().
  */
 svn_error_t *
 get_load_editor(const svn_delta_editor_t **editor,
                 void **edit_baton,
                 struct operation **root_operation,
-                svn_stream_t *stream,
                 svn_ra_session_t *session,
                 apr_pool_t *pool);
 

Modified: subversion/branches/issue-2779-dev/subversion/svnrdump/svnrdump.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/svnrdump/svnrdump.c?rev=980620&r1=980619&r2=980620&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/svnrdump/svnrdump.c (original)
+++ subversion/branches/issue-2779-dev/subversion/svnrdump/svnrdump.c Fri Jul 
30 00:43:02 2010
@@ -299,8 +299,9 @@ load_revisions(svn_ra_session_t *session
   stdin_stream = svn_stream_from_aprfile2(stdin_file, FALSE, pool);
 
   SVN_ERR(get_load_editor(&load_editor, &load_baton, &root_operation,
-                          stdin_stream, session, pool));
-  SVN_ERR(drive_load_editor(root_operation, load_editor, pool));
+                          session, pool));
+  SVN_ERR(drive_load_editor(load_editor, load_baton, root_operation,
+                            stdin_stream, pool));
 
   svn_stream_close(stdin_stream);
 


Reply via email to