Author: rinrab
Date: Fri Dec  6 15:15:00 2024
New Revision: 1922347

URL: http://svn.apache.org/viewvc?rev=1922347&view=rev
Log:
In the trunk, at the merge: Revert changes in record_skip() and
record_tree_conflict() functions, since we cannot rely that the parent
baton passed is not NULL. We do only in tree-processor implementation,
where we explicitly check for that.

This is a follow-up to r1922328 (Cleanup some checks of the parent directory
baton for NULL).

A problem somehow reproduced in the 'apply-processor' branch after
merging r1922328, but unfortunately hasn't failed in trunk before.

* subversion/libsvn_client/merge.c
  (record_skip, record_tree_conflict): Ditto. 

Modified:
    subversion/trunk/subversion/libsvn_client/merge.c

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1922347&r1=1922346&r2=1922347&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Fri Dec  6 15:15:00 2024
@@ -1338,7 +1338,7 @@ record_skip(merge_cmd_baton_t *merge_b,
     return SVN_NO_ERROR; /* ### Why? - Legacy compatibility */
 
   if ((merge_b->merge_source.ancestral || merge_b->reintegrate_merge)
-      && !pdb->shadowed)
+      && !(pdb && pdb->shadowed))
     {
       store_path(merge_b->skipped_abspaths, local_abspath);
     }
@@ -1409,7 +1409,8 @@ record_tree_conflict(merge_cmd_baton_t *
       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->pool;
+      apr_pool_t *result_pool = parent_baton ? parent_baton->pool
+                                             : scratch_pool;
 
       if (reason == svn_wc_conflict_reason_deleted)
         {
@@ -1498,12 +1499,15 @@ record_tree_conflict(merge_cmd_baton_t *
       SVN_ERR(svn_wc__add_tree_conflict(merge_b->ctx->wc_ctx, conflict,
                                         scratch_pool));
 
-      if (! parent_baton->new_tree_conflicts)
-        parent_baton->new_tree_conflicts = apr_hash_make(result_pool);
+      if (parent_baton)
+        {
+          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 */
     }


Reply via email to