svn commit: r1922144 - in /subversion/branches/apply-processor/subversion/libsvn_client: client.h merge.c merge_processor.c

[email protected]
Newsgroups gmane.comp.version-control.subversion.svn
Message-ID <[email protected]>
Author: rinrab
Date: Wed Nov 27 00:08:10 2024
New Revision: 1922144

URL: http://svn.apache.org/viewvc?rev=1922144&view=rev
Log:
On the 'apply-processor' branch: Inline cb_table->conflicted_path callback,
but use the notification callback instead; This callback and its usages are
more complicated than updated_path and skipped_path, but it seems that they
could be inlined as well.

* subversion/libsvn_client/client.h
  (svn_client__apply_processor_callbacks_t::conflicted_path): Remove method.
* subversion/libsvn_client/merge.c
  (notify_merging): Handle svn_wc_notify_tree_conflict action, and this path
   in conflicted_paths and tree_conflicted_abspaths. If any of content or
   props are getting conflicted, add the path to conflicted_paths. This does
   logically the same as it did before the refactoring.
  (apply_processor_conflicted_paths): Remove function.
  (do_merge): Do not initialize cb_table.conflicted_paths.
* subversion/libsvn_client/merge_processor.c
  (): No longer invoke cb_table->conflicted_paths() callback, since we are
   removing it.

Modified:
    subversion/branches/apply-processor/subversion/libsvn_client/client.h
    subversion/branches/apply-processor/subversion/libsvn_client/merge.c
    subversion/branches/apply-processor/subversion/libsvn_client/merge_processor.c

Modified: subversion/branches/apply-processor/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/branches/apply-processor/subversion/libsvn_client/client.h?rev=1922144&r1=1922143&r2=1922144&view=diff
==============================================================================
--- subversion/branches/apply-processor/subversion/libsvn_client/client.h (original)
+++ subversion/branches/apply-processor/subversion/libsvn_client/client.h Wed Nov 27 00:08:10 2024
@@ -1282,11 +1282,6 @@ svn_client__compatible_wc_version_option
 
 typedef struct svn_client__apply_processor_callbacks_t
 {
-  svn_error_t *(*conflicted_path)(void *baton,
-                                  const char *path,
-                                  svn_boolean_t tree_conflict,
-                                  apr_pool_t *pool);
-
   svn_error_t *(*mergeinfo_changed)(void *baton,
                                     const char *local_abspath,
                                     const svn_string_t *old_mergeinfo,

Modified: subversion/branches/apply-processor/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/apply-processor/subversion/libsvn_client/merge.c?rev=1922144&r1=1922143&r2=1922144&view=diff
==============================================================================
--- subversion/branches/apply-processor/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/apply-processor/subversion/libsvn_client/merge.c Wed Nov 27 00:08:10 2024
@@ -1339,8 +1339,22 @@ notify_merging(void *baton,
         store_path(merge_b->skipped_abspaths, notify->path);
       }
     break;
+
+  case svn_wc_notify_tree_conflict:
+    alloc_and_store_path(&merge_b->conflicted_paths, notify->path,
+                         merge_b->pool);
+    alloc_and_store_path(&merge_b->tree_conflicted_abspaths, notify->path,
+                         merge_b->pool);
+    break;
   }
 
+  if (notify->content_state == svn_wc_notify_state_conflicted ||
+      notify->prop_state == svn_wc_notify_state_conflicted)
+    {
+      alloc_and_store_path(&merge_b->conflicted_paths, notify->path,
+                           merge_b->pool);
+    }
+
   notify_merge_begin(b, notify->path,
                      notify->action == svn_wc_notify_update_delete,
                      pool);
@@ -7298,24 +7312,6 @@ ensure_ra_session_url(svn_ra_session_t *
   return SVN_NO_ERROR;
 }
 
-/* Implements svn_client__apply_processor_callbacks_t::conflicted_path */
-static svn_error_t *
-apply_processor_conflicted_path(void *baton, const char *local_abspath,
-                                svn_boolean_t tree_conflict, apr_pool_t *pool)
-{
-  merge_cmd_baton_t *merge_b = baton;
-
-  alloc_and_store_path(&merge_b->conflicted_paths, local_abspath,
-                       merge_b->pool);
-
-  if (tree_conflict)
-    alloc_and_store_path(&merge_b->tree_conflicted_abspaths, 
-                         local_abspath,
-                         merge_b->pool);
-
-  return SVN_NO_ERROR;
-}
-
 /* Implements svn_client__apply_processor_callbacks_t::mergeinfo_changed */
 static svn_error_t *
 apply_processor_mergeinfo_changed(void *baton, const char *local_abspath,
@@ -7585,7 +7581,6 @@ do_merge(apr_hash_t **modified_subtrees,
       const svn_diff_tree_processor_t *processor;
       svn_client__apply_processor_callbacks_t cb_table = { 0 };
 
-      cb_table.conflicted_path = apply_processor_conflicted_path;
       cb_table.mergeinfo_changed = apply_processor_mergeinfo_changed;
       cb_table.adjust_mergeinfo = apply_processor_adjust_mergeinfo;
 

Modified: subversion/branches/apply-processor/subversion/libsvn_client/merge_processor.c
URL: http://svn.apache.org/viewvc/subversion/branches/apply-processor/subversion/libsvn_client/merge_processor.c?rev=1922144&r1=1922143&r2=1922144&view=diff
==============================================================================
--- subversion/branches/apply-processor/subversion/libsvn_client/merge_processor.c (original)
+++ subversion/branches/apply-processor/subversion/libsvn_client/merge_processor.c Wed Nov 27 00:08:10 2024
@@ -580,12 +580,6 @@ record_tree_conflict(merge_apply_process
   if (merge_b->record_only)
     return SVN_NO_ERROR;
 
-  if (merge_b->cb_table && merge_b->cb_table->conflicted_path)
-    {
-      SVN_ERR(merge_b->cb_table->conflicted_path(
-          merge_b->cb_baton, local_abspath, TRUE, scratch_pool));
-    }
-
   if (!merge_b->dry_run)
     {
        svn_wc_conflict_description2_t *conflict;
@@ -1292,12 +1286,6 @@ merge_file_changed(const char *relpath,
                                   NULL, NULL,
                                   ctx->cancel_func, ctx->cancel_baton,
                                   scratch_pool));
-      if (merge_b->cb_table && merge_b->cb_table->conflicted_path
-          && property_state == svn_wc_notify_state_conflicted)
-        {
-          SVN_ERR(merge_b->cb_table->conflicted_path(
-              merge_b->cb_baton, local_abspath, FALSE, scratch_pool));
-        }
     }
 
   /* Easy out: We are only applying mergeinfo differences. */
@@ -1357,16 +1345,6 @@ merge_file_changed(const char *relpath,
                             ctx->cancel_baton,
                             scratch_pool));
 
-      if (content_outcome == svn_wc_merge_conflict
-          || property_state == svn_wc_notify_state_conflicted)
-        {
-          if (merge_b->cb_table && merge_b->cb_table->conflicted_path)
-            {
-              SVN_ERR(merge_b->cb_table->conflicted_path(
-                  merge_b->cb_baton, local_abspath, FALSE, scratch_pool));
-            }
-        }
-
       if (content_outcome == svn_wc_merge_conflict)
         text_state = svn_wc_notify_state_conflicted;
       else if (has_local_mods
@@ -2234,13 +2212,6 @@ merge_dir_changed(const char *relpath,
                                   ctx->cancel_func, ctx->cancel_baton,
                                   scratch_pool));
 
-      if (merge_b->cb_table && merge_b->cb_table->conflicted_path &&
-          prop_state == svn_wc_notify_state_conflicted)
-        {
-          SVN_ERR(merge_b->cb_table->conflicted_path(
-              merge_b->cb_baton, local_abspath, FALSE, scratch_pool));
-        }
-
       if (prop_state == svn_wc_notify_state_conflicted
           || prop_state == svn_wc_notify_state_merged
           || prop_state == svn_wc_notify_state_changed)
@@ -2387,12 +2358,6 @@ merge_dir_added(const char *relpath,
                                   merge_b->ctx->cancel_func,
                                   merge_b->ctx->cancel_baton,
                                   scratch_pool));
-      if (merge_b->cb_table && merge_b->cb_table->conflicted_path &&
-          prop_state == svn_wc_notify_state_conflicted)
-        {
-          SVN_ERR(merge_b->cb_table->conflicted_path(
-              merge_b->cb_baton, local_abspath, FALSE, scratch_pool));
-        }
     }
 
   return SVN_NO_ERROR;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.