Author: rinrab
Date: Thu Nov 28 22:40:20 2024
New Revision: 1922204
URL: http://svn.apache.org/viewvc?rev=1922204&view=rev
Log:
On the 'apply-processor' branch: Factor-out notify_conflicted_path() function.
* subversion/libsvn_client/merge_processor.c
(notify_conflicted_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=1922204&r1=1922203&r2=1922204&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:40:20 2024
@@ -523,6 +523,24 @@ create_file_baton(apr_pool_t *result_poo
return fb;
}
+/* Wrapper around the merge_b->cb_table->conflicted_path() function */
+static svn_error_t *
+notify_conflicted_path(merge_apply_processor_baton_t *merge_b,
+ const char *local_abspath,
+ svn_boolean_t tree_conflict,
+ apr_pool_t *scratch_pool)
+{
+ 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,
+ tree_conflict,
+ scratch_pool));
+ }
+
+ return SVN_NO_ERROR;
+}
+
/* Record the skip for future processing and (later) produce the
skip notification */
static svn_error_t *
@@ -587,11 +605,7 @@ 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));
- }
+ SVN_ERR(notify_conflicted_path(merge_b, local_abspath, TRUE, scratch_pool));
if (!merge_b->dry_run)
{
@@ -1312,11 +1326,10 @@ 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)
+ if (property_state == svn_wc_notify_state_conflicted)
{
- SVN_ERR(merge_b->cb_table->conflicted_path(
- merge_b->cb_baton, local_abspath, FALSE, scratch_pool));
+ SVN_ERR(notify_conflicted_path(merge_b, local_abspath, FALSE,
+ scratch_pool));
}
}
@@ -1380,11 +1393,8 @@ merge_file_changed(const char *relpath,
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));
- }
+ SVN_ERR(notify_conflicted_path(merge_b, local_abspath, FALSE,
+ scratch_pool));
}
if (content_outcome == svn_wc_merge_conflict)
@@ -2259,11 +2269,11 @@ 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)
+ if (prop_state == svn_wc_notify_state_conflicted)
{
- SVN_ERR(merge_b->cb_table->conflicted_path(
- merge_b->cb_baton, local_abspath, FALSE, scratch_pool));
+ SVN_ERR(notify_conflicted_path(merge_b, local_abspath, FALSE,
+ scratch_pool));
+
}
if (prop_state == svn_wc_notify_state_conflicted
@@ -2422,11 +2432,10 @@ 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)
+ if (prop_state == svn_wc_notify_state_conflicted)
{
- SVN_ERR(merge_b->cb_table->conflicted_path(
- merge_b->cb_baton, local_abspath, FALSE, scratch_pool));
+ SVN_ERR(notify_conflicted_path(merge_b, local_abspath, FALSE,
+ scratch_pool));
}
}