Author: rinrab
Date: Thu Dec 5 19:23:31 2024
New Revision: 1922334
URL: http://svn.apache.org/viewvc?rev=1922334&view=rev
Log:
On the 'apply-processor' branch: Manually merge r1922328 from 'trunk'.
* Cleanup some checks of the parent directory baton for NULL.
Modified:
subversion/branches/apply-processor/ (props changed)
subversion/branches/apply-processor/subversion/libsvn_client/merge_processor.c
Propchange: subversion/branches/apply-processor/
------------------------------------------------------------------------------
Merged /subversion/trunk:r1922328
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=1922334&r1=1922333&r2=1922334&view=diff
==============================================================================
---
subversion/branches/apply-processor/subversion/libsvn_client/merge_processor.c
(original)
+++
subversion/branches/apply-processor/subversion/libsvn_client/merge_processor.c
Thu Dec 5 19:23:31 2024
@@ -594,7 +594,7 @@ record_skip(merge_apply_processor_baton_
if (merge_b->record_only)
return SVN_NO_ERROR; /* ### Why? - Legacy compatibility */
- if (!(pdb && pdb->shadowed))
+ if (pdb->shadowed)
SVN_ERR(notify_skipped_path(merge_b, local_abspath, scratch_pool));
if (merge_b->notify_func)
@@ -647,8 +647,7 @@ record_tree_conflict(merge_apply_process
svn_wc_conflict_description2_t *conflict;
const svn_wc_conflict_version_t *left;
const svn_wc_conflict_version_t *right;
- apr_pool_t *result_pool = parent_baton ? parent_baton->pool
- : scratch_pool;
+ apr_pool_t *result_pool = parent_baton->pool;
svn_client__merge_source_t *source;
if (reason == svn_wc_conflict_reason_deleted)
@@ -712,15 +711,12 @@ record_tree_conflict(merge_apply_process
SVN_ERR(svn_wc__add_tree_conflict(merge_b->ctx->wc_ctx, conflict,
scratch_pool));
- if (parent_baton)
- {
- if (! parent_baton->new_tree_conflicts)
- parent_baton->new_tree_conflicts = apr_hash_make(result_pool);
+ if (! parent_baton->new_tree_conflicts)
+ parent_baton->new_tree_conflicts = apr_hash_make(result_pool);
- svn_hash_sets(parent_baton->new_tree_conflicts,
- apr_pstrdup(result_pool, local_abspath),
- conflict);
- }
+ svn_hash_sets(parent_baton->new_tree_conflicts,
+ apr_pstrdup(result_pool, local_abspath),
+ conflict);
/* ### TODO: Store in parent baton */
}
@@ -1062,12 +1058,9 @@ merge_file_opened(void **new_file_baton,
*new_file_baton = fb;
- if (pdb)
- {
- fb->parent_baton = pdb;
- fb->shadowed = pdb->shadowed;
- fb->skip_reason = pdb->skip_reason;
- }
+ fb->parent_baton = pdb;
+ fb->shadowed = pdb->shadowed;
+ fb->skip_reason = pdb->skip_reason;
if (fb->shadowed)
{
@@ -1116,9 +1109,8 @@ merge_file_opened(void **new_file_baton,
Non-inheritable mergeinfo will be recorded, allowing
future merges into non-shallow working copies to merge
changes we missed this time around. */
- if (pdb && (excluded
- || (parent_depth != svn_depth_unknown &&
- parent_depth < svn_depth_files)))
+ if (excluded || (parent_depth != svn_depth_unknown &&
+ parent_depth < svn_depth_files))
{
fb->shadowed = TRUE;
@@ -1168,8 +1160,7 @@ merge_file_opened(void **new_file_baton,
}
/* Comparison mode to verify for delete tree conflicts? */
- if (pdb && pdb->delete_state
- && pdb->delete_state->found_edit)
+ if (pdb->delete_state && pdb->delete_state->found_edit)
{
/* Earlier nodes found a conflict. Done. */
*skip = TRUE;
@@ -1184,7 +1175,7 @@ merge_file_opened(void **new_file_baton,
fb->added = TRUE;
fb->tree_conflict_action = svn_wc_conflict_action_add;
- if (pdb && pdb->pending_deletes
+ if (pdb->pending_deletes
&& svn_hash_gets(pdb->pending_deletes, local_abspath))
{
fb->add_is_replace = TRUE;
@@ -1193,8 +1184,7 @@ merge_file_opened(void **new_file_baton,
svn_hash_sets(pdb->pending_deletes, local_abspath, NULL);
}
- if (pdb
- && pdb->new_tree_conflicts
+ if (pdb->new_tree_conflicts
&& (old_tc = svn_hash_gets(pdb->new_tree_conflicts, local_abspath)))
{
fb->tree_conflict_action = svn_wc_conflict_action_replace;
@@ -1226,8 +1216,7 @@ merge_file_opened(void **new_file_baton,
return SVN_NO_ERROR;
}
}
- else if (! (merge_b->dry_run
- && ((pdb && pdb->added) || fb->add_is_replace)))
+ else if (! (merge_b->dry_run && (pdb->added || fb->add_is_replace)))
{
svn_wc_notify_state_t obstr_state;
svn_boolean_t is_deleted;
@@ -1438,7 +1427,7 @@ merge_file_changed(const char *relpath,
{
SVN_ERR(record_update_update(merge_b, local_abspath, svn_node_file,
text_state, property_state,
- fb->parent_baton && fb->parent_baton->added,
+ fb->parent_baton->added,
scratch_pool));
}
@@ -1578,7 +1567,7 @@ merge_file_added(const char *relpath,
SVN_ERR(record_update_add(merge_b, local_abspath, svn_node_file,
fb->add_is_replace,
- fb->parent_baton && fb->parent_baton->added,
+ fb->parent_baton->added,
scratch_pool));
return SVN_NO_ERROR;
@@ -1745,8 +1734,7 @@ merge_file_deleted(const char *relpath,
local_abspath, merge_b->ctx->wc_ctx,
scratch_pool));
- if (fb->parent_baton
- && fb->parent_baton->delete_state)
+ if (fb->parent_baton->delete_state)
{
if (same)
{
@@ -1866,12 +1854,9 @@ merge_dir_opened(void **new_dir_baton,
else
db->tree_conflict_merge_right_node_kind = svn_node_none;
- if (pdb)
- {
- db->parent_baton = pdb;
- db->shadowed = pdb->shadowed;
- db->skip_reason = pdb->skip_reason;
- }
+ db->parent_baton = pdb;
+ db->shadowed = pdb->shadowed;
+ db->skip_reason = pdb->skip_reason;
if (db->shadowed)
{
@@ -1945,9 +1930,8 @@ merge_dir_opened(void **new_dir_baton,
Non-inheritable mergeinfo will be recorded, allowing
future merges into non-shallow working copies to merge
changes we missed this time around. */
- if (pdb && (excluded
- || (parent_depth != svn_depth_unknown &&
- parent_depth < svn_depth_immediates)))
+ if (excluded || (parent_depth != svn_depth_unknown &&
+ parent_depth < svn_depth_immediates))
{
db->shadowed = TRUE;
@@ -2001,7 +1985,7 @@ merge_dir_opened(void **new_dir_baton,
return SVN_NO_ERROR; /* Already set a tree conflict */
}
- db->delete_state = (pdb != NULL) ? pdb->delete_state : NULL;
+ db->delete_state = pdb->delete_state;
if (db->delete_state && db->delete_state->found_edit)
{
@@ -2033,7 +2017,7 @@ merge_dir_opened(void **new_dir_baton,
db->added = TRUE;
db->tree_conflict_action = svn_wc_conflict_action_add;
- if (pdb && pdb->pending_deletes
+ if (pdb->pending_deletes
&& svn_hash_gets(pdb->pending_deletes, local_abspath))
{
db->add_is_replace = TRUE;
@@ -2042,8 +2026,7 @@ merge_dir_opened(void **new_dir_baton,
svn_hash_sets(pdb->pending_deletes, local_abspath, NULL);
}
- if (pdb
- && pdb->new_tree_conflicts
+ if (pdb->new_tree_conflicts
&& (old_tc = svn_hash_gets(pdb->new_tree_conflicts, local_abspath)))
{
db->tree_conflict_action = svn_wc_conflict_action_replace;
@@ -2077,8 +2060,7 @@ merge_dir_opened(void **new_dir_baton,
}
}
- if (! (merge_b->dry_run
- && ((pdb && pdb->added) || db->add_is_replace)))
+ if (! (merge_b->dry_run && (pdb->added || db->add_is_replace)))
{
svn_wc_notify_state_t obstr_state;
svn_boolean_t is_deleted;