You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pb...@apache.org on 2011/12/08 19:12:56 UTC

svn commit: r1212015 - /subversion/trunk/subversion/libsvn_client/merge.c

Author: pburba
Date: Thu Dec  8 18:12:55 2011
New Revision: 1212015

URL: http://svn.apache.org/viewvc?rev=1212015&view=rev
Log:
Adjust the issue #4057 fix made in r1211620 to account for svn_ra_get_log2's
limitations when using a BDB backend.

This fixes the currently failing tests with --fs-type=bdb:

  FAIL:  merge_tests.py 120: reverse merge adds subtree
  FAIL:  merge_tests.py 124: shallow merge reaches all necessary subtrees

* subversion/libsvn_client/merge.c

  (log_find_operative_subtree_baton_t): Add a svn_wc_context_t * member.

  (log_find_operative_subtree_revs): Account for the fact 
   that the svn_log_changed_path2_t.node_kind members in in 
   log_entry->changed_paths2 may be set to svn_node_unknown (e.g. with a BDB
   backend).

  (get_operative_immediate_children): Initialize new
   log_find_operative_subtree_baton_t member.


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=1212015&r1=1212014&r2=1212015&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Thu Dec  8 18:12:55 2011
@@ -7197,6 +7197,7 @@ typedef struct log_find_operative_subtre
   const char *merge_source_fspath;
   const char *merge_target_abspath;
   svn_depth_t depth;
+  svn_wc_context_t *wc_ctx;
 
   /* A pool to allocate additions to the hashes in. */
   apr_pool_t *result_pool;
@@ -7245,10 +7246,39 @@ log_find_operative_subtree_revs(void *ba
           child = svn_relpath_dirname(rel_path, iterpool);
           if (child[0] == '\0')
             {
+              /* The svn_log_changed_path2_t.node_kind members in
+                 LOG_ENTRY->CHANGED_PATHS2 may be set to
+                 svn_node_unknown, see svn_log_changed_path2_t and
+                 svn_fs_paths_changed2.  In that case we check the
+                 type of the corresponding subtree in the merge
+                 target. */
+              svn_node_kind_t node_kind;
+
+              if (change->node_kind == svn_node_unknown)
+                {
+                  const char *wc_child_abspath =
+                    svn_dirent_join(log_baton->merge_target_abspath,
+                                    rel_path, iterpool);
+
+                  /* ### ptb - svn_wc_read_kind is very tolerant when we ask
+                     ### it about unversioned, non-existent, and missing WC
+                     ### paths, simply setting *NODE_KIND svn_kind_none in
+                     ### those cases.  Is there any legitimate error we
+                     ### might enocunter during a merge where we'd want
+                     ### to clear the error and continue? */
+                  SVN_ERR(svn_wc_read_kind(&node_kind, log_baton->wc_ctx,
+                                           wc_child_abspath, FALSE,
+                                           iterpool));
+                }
+              else
+                {
+                  node_kind = change->node_kind;
+                }
+
               /* We only care about immediate directory children if
                  DEPTH is svn_depth_files. */
               if (log_baton->depth == svn_depth_files
-                  && change->node_kind == svn_node_file)
+                  && node_kind != svn_node_dir)
                 continue;
 
               /* If depth is svn_depth_immediates, then we only care
@@ -7338,6 +7368,7 @@ get_operative_immediate_children(apr_has
   log_baton.merge_source_fspath = merge_source_fspath;
   log_baton.merge_target_abspath = merge_target_abspath;
   log_baton.depth = depth;
+  log_baton.wc_ctx = wc_ctx;
   log_baton.result_pool = result_pool;
   log_targets = apr_array_make(scratch_pool, 1, sizeof(const char *));
   APR_ARRAY_PUSH(log_targets, const char *) = "";