You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2013/01/30 22:37:26 UTC

svn commit: r1440688 - in /subversion/trunk/subversion: include/private/svn_wc_private.h libsvn_client/client.h libsvn_client/diff.c libsvn_client/repos_diff.c libsvn_wc/diff_editor.c

Author: rhuijben
Date: Wed Jan 30 21:37:25 2013
New Revision: 1440688

URL: http://svn.apache.org/viewvc?rev=1440688&view=rev
Log:
Remove the output state handling from the diff callback wrapper in libsvn_wc.

Since the merge code is now handling its own state, we don't have to stay
compatible with this previously only privately available api.

* subversion/include/private/svn_wc_private.h
  (svn_wc__wrap_diff_callbacks): Remove state arguments.

* subversion/libsvn_client/client.h
  (svn_client__get_diff_editor): Remove function, which would now just
    wrap svn_wc__wrap_diff_callbacks.

* subversion/libsvn_client/diff.c
  (diff_repos_repos): Wrap processor locally. Update caller.

* subversion/libsvn_client/repos_diff.c
  (svn_client__get_diff_editor): Remove function.

* subversion/libsvn_wc/diff_editor.c
  (wc_diff_wrap_baton_t): Remove unused variables.
  (wrap_dir_opened,
   wrap_dir_added,
   wrap_dir_deleted,
   wrap_dir_closed,
   wrap_dir_changed,
   wrap_file_added,
   wrap_file_deleted,
   wrap_file_changed): Remove calls to state handler.

  (wrap_node_absent): Remove function.

  (svn_wc__wrap_diff_callbacks): Remove unneeded initialization.

Modified:
    subversion/trunk/subversion/include/private/svn_wc_private.h
    subversion/trunk/subversion/libsvn_client/client.h
    subversion/trunk/subversion/libsvn_client/diff.c
    subversion/trunk/subversion/libsvn_client/repos_diff.c
    subversion/trunk/subversion/libsvn_wc/diff_editor.c

Modified: subversion/trunk/subversion/include/private/svn_wc_private.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_wc_private.h?rev=1440688&r1=1440687&r2=1440688&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_wc_private.h Wed Jan 30 21:37:25 2013
@@ -1713,18 +1713,13 @@ typedef svn_error_t *
                                        apr_pool_t *scratch_pool);
 
 /** Obtains a diff processor that will drive the diff callbacks when it
- * is invoked. The state arguments will be handled by the state processor
- * or ignored if STATE_HANDLER is NULL
+ * is invoked.
  */
 svn_error_t *
 svn_wc__wrap_diff_callbacks(const svn_diff_tree_processor_t **diff_processor,
                             const svn_wc_diff_callbacks4_t *callbacks,
                             void *callback_baton,
                             svn_boolean_t walk_deleted_dirs,
-                            svn_wc__diff_state_handle_t state_handle,
-                            svn_wc__diff_state_close_t state_close,
-                            svn_wc__diff_state_absent_t state_absent,
-                            void *state_baton,
                             apr_pool_t *result_pool,
                             apr_pool_t *scratch_pool);
 

Modified: subversion/trunk/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/client.h?rev=1440688&r1=1440687&r2=1440688&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/client.h (original)
+++ subversion/trunk/subversion/libsvn_client/client.h Wed Jan 30 21:37:25 2013
@@ -732,32 +732,6 @@ svn_client__get_diff_editor2(const svn_d
                              void *cancel_baton,
                              apr_pool_t *result_pool);
 
-/* Like svn_client__get_diff_editor2 but calls DIFF_CALLBACKS with
-   DIFF_CMD_BATON. 
-
-   For each deleted directory, if WALK_DELETED_DIRS is true then just call
-   the 'dir_deleted' callback once, otherwise call the 'file_deleted' or
-   'dir_deleted' callback for each individual node in that subtree.
-
-   If ABSENT_RELPATHS is non-null, collect const char * keys in it with
-   the relative paths marked as absent by the diff driver.
- */
-svn_error_t *
-svn_client__get_diff_editor(const svn_delta_editor_t **editor,
-                            void **edit_baton,
-                            svn_depth_t depth,
-                            svn_ra_session_t *ra_session,
-                            svn_revnum_t revision,
-                            svn_boolean_t walk_deleted_dirs,
-                            svn_boolean_t text_deltas,
-                            apr_hash_t *absent_relpaths,
-                            const svn_wc_diff_callbacks4_t *diff_callbacks,
-                            void *diff_cmd_baton,
-                            svn_cancel_func_t cancel_func,
-                            void *cancel_baton,
-                            apr_pool_t *result_pool);
-
-
 /* ---------------------------------------------------------------- */
 
 /*** Editor for diff summary ***/

Modified: subversion/trunk/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/diff.c?rev=1440688&r1=1440687&r2=1440688&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/diff.c (original)
+++ subversion/trunk/subversion/libsvn_client/diff.c Wed Jan 30 21:37:25 2013
@@ -1954,6 +1954,8 @@ diff_repos_repos(const svn_wc_diff_callb
   const svn_delta_editor_t *diff_editor;
   void *diff_edit_baton;
 
+  const svn_diff_tree_processor_t *diff_processor;
+
   const char *url1;
   const char *url2;
   const char *base_path;
@@ -2010,13 +2012,18 @@ diff_repos_repos(const svn_wc_diff_callb
 
   /* Set up the repos_diff editor on BASE_PATH, if available.
      Otherwise, we just use "". */
-  SVN_ERR(svn_client__get_diff_editor(
+
+  SVN_ERR(svn_wc__wrap_diff_callbacks(&diff_processor,
+                                      callbacks, callback_baton,
+                                      TRUE /* walk_deleted_dirs */,
+                                      pool, pool));
+
+  SVN_ERR(svn_client__get_diff_editor2(
                 &diff_editor, &diff_edit_baton,
-                depth,
-                extra_ra_session, rev1, TRUE /* walk_deleted_dirs */,
+                extra_ra_session, depth,
+                rev1, 
                 TRUE /* text_deltas */,
-                NULL /* absent relpaths */,
-                callbacks, callback_baton,
+                diff_processor,
                 ctx->cancel_func, ctx->cancel_baton,
                 pool));
 
@@ -2645,6 +2652,8 @@ diff_summarize_repos_repos(svn_client_di
   const svn_delta_editor_t *diff_editor;
   void *diff_edit_baton;
 
+  const svn_diff_tree_processor_t *diff_processor;
+
   const char *url1;
   const char *url2;
   const char *base_path;
@@ -2697,14 +2706,20 @@ diff_summarize_repos_repos(svn_client_di
                                                TRUE, ctx, pool));
 
   /* Set up the repos_diff editor. */
-  SVN_ERR(svn_client__get_diff_editor(&diff_editor, &diff_edit_baton,
-            depth,
-            extra_ra_session, rev1, TRUE /* walk_deleted_dirs */,
-            FALSE /* text_deltas */,
-            NULL /* absent relpaths */,
-            callbacks, callback_baton,
-            ctx->cancel_func, ctx->cancel_baton,
-            pool));
+
+  SVN_ERR(svn_wc__wrap_diff_callbacks(&diff_processor,
+                                      callbacks, callback_baton,
+                                      TRUE /* walk_deleted_dirs */,
+                                      pool, pool));
+
+  SVN_ERR(svn_client__get_diff_editor2(&diff_editor, &diff_edit_baton,
+                                       extra_ra_session,
+                                       depth,
+                                       rev1,
+                                       FALSE /* text_deltas */,
+                                       diff_processor,
+                                       ctx->cancel_func, ctx->cancel_baton,
+                                       pool));
 
   /* We want to switch our txn into URL2 */
   SVN_ERR(svn_ra_do_diff3

Modified: subversion/trunk/subversion/libsvn_client/repos_diff.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/repos_diff.c?rev=1440688&r1=1440687&r2=1440688&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/repos_diff.c (original)
+++ subversion/trunk/subversion/libsvn_client/repos_diff.c Wed Jan 30 21:37:25 2013
@@ -1356,45 +1356,3 @@ svn_client__get_diff_editor2(const svn_d
 
   return SVN_NO_ERROR;
 }
-
-svn_error_t *
-svn_client__get_diff_editor(const svn_delta_editor_t **editor,
-                            void **edit_baton,
-                            svn_depth_t depth,
-                            svn_ra_session_t *ra_session,
-                            svn_revnum_t revision,
-                            svn_boolean_t walk_deleted_dirs,
-                            svn_boolean_t text_deltas,
-                            apr_hash_t *absent_relpaths,
-                            const svn_wc_diff_callbacks4_t *diff_callbacks,
-                            void *diff_cmd_baton,
-                            svn_cancel_func_t cancel_func,
-                            void *cancel_baton,
-                            apr_pool_t *result_pool)
-{
-  const svn_diff_tree_processor_t *processor;
-  struct diff_notify_baton_t *dnb = apr_pcalloc(result_pool, sizeof(*dnb));
-
-  dnb->absent_relpaths = absent_relpaths;
-
-  SVN_ERR(svn_wc__wrap_diff_callbacks(&processor,
-                                      diff_callbacks, diff_cmd_baton,
-                                      walk_deleted_dirs,
-                                      NULL,
-                                      NULL,
-                                      diff_state_absent,
-                                      dnb,
-                                      result_pool, result_pool));
-
-  SVN_ERR(svn_client__get_diff_editor2(editor,
-                                       edit_baton,
-                                       ra_session,
-                                       depth,
-                                       revision,
-                                       text_deltas,
-                                       processor,
-                                       cancel_func, cancel_baton,
-                                       result_pool));
-
-  return SVN_NO_ERROR;
-}

Modified: subversion/trunk/subversion/libsvn_wc/diff_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/diff_editor.c?rev=1440688&r1=1440687&r2=1440688&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/diff_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/diff_editor.c Wed Jan 30 21:37:25 2013
@@ -1970,11 +1970,6 @@ typedef struct wc_diff_wrap_baton_t
 
   svn_boolean_t walk_deleted_dirs;
 
-  svn_wc__diff_state_handle_t state_handle;
-  svn_wc__diff_state_close_t state_close;
-  svn_wc__diff_state_absent_t state_absent;
-  void *state_baton;
-
   apr_pool_t *result_pool;
   const char *empty_file;
 
@@ -2026,15 +2021,6 @@ wrap_dir_opened(void **new_dir_baton,
                                         wb->callback_baton,
                                         scratch_pool));
 
-      if (wb->state_handle)
-        SVN_ERR(wb->state_handle(tree_conflicted, NULL, NULL,
-                                 relpath, svn_kind_dir,
-                                 TRUE /* before operation */,
-                                 FALSE /* for_add */,
-                                 (right_source == NULL) /* for_delete */,
-                                 wb->state_baton,
-                                 scratch_pool));
-
       if (! right_source && !wb->walk_deleted_dirs)
         *skip_children = TRUE;
     }
@@ -2053,13 +2039,6 @@ wrap_dir_opened(void **new_dir_baton,
                                             : SVN_INVALID_REVNUM,
                                        wb->callback_baton,
                                        scratch_pool));
-
-      if (wb->state_handle)
-        SVN_ERR(wb->state_handle(tree_conflicted, &state, NULL,
-                                 relpath, svn_kind_dir,
-                                 TRUE, TRUE, FALSE,
-                                 wb->state_baton,
-                                 scratch_pool));
     }
 
   *new_dir_baton = NULL;
@@ -2108,15 +2087,6 @@ wrap_dir_added(const char *relpath,
                                    TRUE /* dir_was_added */,
                                    wb->callback_baton,
                                    scratch_pool));
-
-  if (wb->state_handle)
-    SVN_ERR(wb->state_handle(tree_conflicted, &state, &prop_state,
-                             relpath, svn_kind_dir,
-                             FALSE /* before operation */,
-                             TRUE /* for_add */, FALSE /* for_delete */,
-                             wb->state_baton,
-                             scratch_pool));
-
   return SVN_NO_ERROR;
 }
 
@@ -2133,24 +2103,11 @@ wrap_dir_deleted(const char *relpath,
   svn_boolean_t tree_conflicted = FALSE;
   svn_wc_notify_state_t state = svn_wc_notify_state_inapplicable;
 
-  if (wb->state_close)
-    SVN_ERR(wb->state_close(relpath, svn_kind_dir,
-                            wb->state_baton,
-                            scratch_pool));
-
   SVN_ERR(wb->callbacks->dir_deleted(&state, &tree_conflicted,
                                      relpath,
                                      wb->callback_baton,
                                      scratch_pool));
 
-  if (wb->state_handle)
-    SVN_ERR(wb->state_handle(tree_conflicted, &state, NULL,
-                             relpath, svn_kind_dir,
-                             FALSE /* before operation */,
-                             FALSE /* for_add */, TRUE /* for_delete */,
-                             wb->state_baton,
-                             scratch_pool));
-
   return SVN_NO_ERROR;
 }
 
@@ -2165,12 +2122,8 @@ wrap_dir_closed(const char *relpath,
 {
   wc_diff_wrap_baton_t *wb = processor->baton;
 
-  if (wb->state_close)
-    SVN_ERR(wb->state_close(relpath, svn_kind_dir,
-                            wb->state_baton, scratch_pool));
-
   /* No previous implementations provided these arguments, so we
-     are not doing with them either */
+     are not providing them either */
   SVN_ERR(wb->callbacks->dir_closed(NULL, NULL, NULL,
                                     relpath,
                                     (left_source == NULL) /* added */,
@@ -2204,15 +2157,6 @@ wrap_dir_changed(const char *relpath,
                                            wb->callback_baton,
                                            scratch_pool));
 
-  if (wb->state_handle)
-    SVN_ERR(wb->state_handle(tree_conflicted, NULL, &prop_state,
-                             relpath, svn_kind_dir,
-                             FALSE /* before operation */,
-                             FALSE /* for_add */, FALSE /* for_delete */,
-                             wb->state_baton,
-                             scratch_pool));
-
-
   /* And call dir_closed, etc */
   SVN_ERR(wrap_dir_closed(relpath, left_source, right_source,
                           dir_baton, processor,
@@ -2301,15 +2245,6 @@ wrap_file_added(const char *relpath,
                                     prop_changes, copyfrom_props,
                                     wb->callback_baton,
                                     scratch_pool));
-
-  if (wb->state_handle)
-    SVN_ERR(wb->state_handle(tree_conflicted, &state, &prop_state,
-                             relpath, svn_kind_file,
-                             FALSE /* before operation */,
-                             TRUE, FALSE,
-                             wb->state_baton,
-                             scratch_pool));
-
   return SVN_NO_ERROR;
 }
 
@@ -2339,14 +2274,6 @@ wrap_file_deleted(const char *relpath,
                                       left_props,
                                       wb->callback_baton,
                                       scratch_pool));
-
-  if (wb->state_handle)
-    SVN_ERR(wb->state_handle(tree_conflicted, &state, NULL,
-                             relpath, svn_kind_file,
-                             FALSE /* before operation */,
-                             FALSE, TRUE,
-                             wb->state_baton,
-                             scratch_pool));
   return SVN_NO_ERROR;
 }
 
@@ -2389,41 +2316,14 @@ wrap_file_changed(const char *relpath,
                                       left_props,
                                       wb->callback_baton,
                                       scratch_pool));
-
-  if (wb->state_handle)
-    SVN_ERR(wb->state_handle(tree_conflicted, &state, &prop_state,
-                             relpath, svn_kind_file,
-                             FALSE /* before operation */,
-                             FALSE, FALSE,
-                             wb->state_baton,
-                             scratch_pool));
-  return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-wrap_node_absent(const char *relpath,
-                 void *dir_baton,
-                 const svn_diff_tree_processor_t *processor,
-                 apr_pool_t *scratch_pool)
-{
-  wc_diff_wrap_baton_t *wb = processor->baton;
-  if (wb->state_absent)
-    SVN_ERR(wb->state_absent(relpath,
-                             wb->state_baton,
-                             scratch_pool));
   return SVN_NO_ERROR;
 }
 
-
 svn_error_t *
 svn_wc__wrap_diff_callbacks(const svn_diff_tree_processor_t **diff_processor,
                             const svn_wc_diff_callbacks4_t *callbacks,
                             void *callback_baton,
                             svn_boolean_t walk_deleted_dirs,
-                            svn_wc__diff_state_handle_t state_handler,
-                            svn_wc__diff_state_close_t state_close,
-                            svn_wc__diff_state_absent_t state_absent,
-                            void *state_baton,
                             apr_pool_t *result_pool,
                             apr_pool_t *scratch_pool)
 {
@@ -2435,10 +2335,6 @@ svn_wc__wrap_diff_callbacks(const svn_di
   wrap_baton->result_pool = result_pool;
   wrap_baton->callbacks = callbacks;
   wrap_baton->callback_baton = callback_baton;
-  wrap_baton->state_handle = state_handler;
-  wrap_baton->state_close = state_close;
-  wrap_baton->state_absent = state_absent;
-  wrap_baton->state_baton = state_baton;
   wrap_baton->empty_file = NULL;
   wrap_baton->walk_deleted_dirs = walk_deleted_dirs;
 
@@ -2456,8 +2352,6 @@ svn_wc__wrap_diff_callbacks(const svn_di
   processor->file_changed  = wrap_file_changed;
   /*processor->file_closed   = wrap_file_closed*/; /* Not needed */
 
-  processor->node_absent   = wrap_node_absent;
-
   *diff_processor = processor;
   return SVN_NO_ERROR;
 }