Author: rinrab
Date: Thu Nov 28 22:52:04 2024
New Revision: 1922206

URL: http://svn.apache.org/viewvc?rev=1922206&view=rev
Log:
On the 'apply-processor' branch: Factor-out notify_skipped_path() function.

* subversion/libsvn_client/merge_processor.c
  (notify_skipped_path): New function.
  (): Use the new function instead of manually checking for this callback
   and invoking it.

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

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=1922206&r1=1922205&r2=1922206&view=diff
==============================================================================
--- 
subversion/branches/apply-processor/subversion/libsvn_client/merge_processor.c 
(original)
+++ 
subversion/branches/apply-processor/subversion/libsvn_client/merge_processor.c 
Thu Nov 28 22:52:04 2024
@@ -541,6 +541,22 @@ notify_conflicted_path(merge_apply_proce
   return SVN_NO_ERROR;
 }
 
+/* Wrapper around the merge_b->cb_table->skipped_path() function */
+static svn_error_t *
+notify_skipped_path(merge_apply_processor_baton_t *merge_b,
+                    const char *local_abspath,
+                    apr_pool_t *scratch_pool)
+{
+  if (merge_b->cb_table && merge_b->cb_table->skipped_path)
+    {
+      SVN_ERR(merge_b->cb_table->skipped_path(merge_b->cb_baton,
+                                              local_abspath,
+                                              scratch_pool));
+    }
+
+  return SVN_NO_ERROR;
+}
+
 /* Record the skip for future processing and (later) produce the
    skip notification */
 static svn_error_t *
@@ -555,12 +571,8 @@ record_skip(merge_apply_processor_baton_
   if (merge_b->record_only)
     return SVN_NO_ERROR; /* ### Why? - Legacy compatibility */
 
-  if (merge_b->cb_table && merge_b->cb_table->skipped_path
-      && !(pdb && pdb->shadowed))
-    {
-      SVN_ERR(merge_b->cb_table->skipped_path(merge_b->cb_baton, local_abspath,
-                                              scratch_pool));
-    }
+  if (!(pdb && pdb->shadowed))
+    SVN_ERR(notify_skipped_path(merge_b, local_abspath, scratch_pool));
 
   if (merge_b->notify_func)
     {
@@ -903,11 +915,7 @@ mark_dir_edited(merge_apply_processor_ba
                                scratch_pool);
         }
 
-      if (merge_b->cb_table && merge_b->cb_table->skipped_path)
-        {
-          SVN_ERR(merge_b->cb_table->skipped_path(
-              merge_b->cb_baton, local_abspath, scratch_pool));
-        }
+        SVN_ERR(notify_skipped_path(merge_b, local_abspath, scratch_pool));
     }
   else if (db->tree_conflict_reason != CONFLICT_REASON_NONE)
     {
@@ -982,11 +990,7 @@ mark_file_edited(merge_apply_processor_b
                                scratch_pool);
         }
 
-      if (merge_b->cb_table && merge_b->cb_table->skipped_path)
-        {
-          SVN_ERR(merge_b->cb_table->skipped_path(
-              merge_b->cb_baton, local_abspath, scratch_pool));
-        }
+      SVN_ERR(notify_skipped_path(merge_b, local_abspath, scratch_pool));
     }
   else if (fb->tree_conflict_reason != CONFLICT_REASON_NONE)
     {


Reply via email to