You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2011/04/26 17:27:04 UTC

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

Author: rhuijben
Date: Tue Apr 26 15:27:04 2011
New Revision: 1096785

URL: http://svn.apache.org/viewvc?rev=1096785&view=rev
Log:
Remove more former access baton available checks which are now replaced by
wc-ng compatible obstruction checks.

* subversion/libsvn_client/merge.c
  (merge_props_changed): Move obstruction check from this helper to ...
  (merge_dir_props_changed): ... here, the directory specific variant.
  (merge_file_changed): Properly initialize optional setting to allow setting
    only when encountering tree conflicts.
  (merge_dir_opened): Remove former access baton available check.

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=1096785&r1=1096784&r2=1096785&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Tue Apr 26 15:27:04 2011
@@ -1052,8 +1052,7 @@ filter_self_referential_mergeinfo(apr_ar
   return SVN_NO_ERROR;
 }
 
-/* An svn_wc_diff_callbacks4_t function.  Used for both file and directory
-   property merges. */
+/* Used for both file and directory property merges. */
 static svn_error_t *
 merge_props_changed(const char *local_dir_abspath,
                     svn_wc_notify_state_t *state,
@@ -1072,29 +1071,6 @@ merge_props_changed(const char *local_di
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
-  if (tree_conflicted)
-    *tree_conflicted = FALSE;
-
-  /* Check for an obstructed or missing node on disk. */
-  {
-    svn_wc_notify_state_t obstr_state;
-
-    SVN_ERR(perform_obstruction_check(&obstr_state, NULL, NULL, NULL, NULL,
-                                      NULL,
-                                      merge_b, local_abspath, svn_node_unknown,
-                                      scratch_pool));
-
-    if (obstr_state != svn_wc_notify_state_inapplicable)
-      {
-        if (state)
-          *state = obstr_state;
-        svn_pool_destroy(subpool);
-        return SVN_NO_ERROR;
-      }
-  }
-
-  /* ### TODO check tree-conflicts! */
-
   SVN_ERR(svn_categorize_props(propchanges, NULL, NULL, &props, subpool));
 
   /* If we are only applying mergeinfo changes then we need to do
@@ -1218,17 +1194,33 @@ static svn_error_t *
 merge_dir_props_changed(const char *local_dir_abspath,
                         svn_wc_notify_state_t *state,
                         svn_boolean_t *tree_conflicted,
-                        const char *path,
+                        const char *local_abspath,
                         svn_boolean_t dir_was_added,
                         const apr_array_header_t *propchanges,
                         apr_hash_t *original_props,
                         void *diff_baton,
                         apr_pool_t *scratch_pool)
 {
+  merge_cmd_baton_t *merge_b = diff_baton;
+  svn_wc_notify_state_t obstr_state;
+  svn_node_kind_t kind;
+
+  SVN_ERR(perform_obstruction_check(&obstr_state, NULL, NULL, NULL, NULL,
+                                    NULL,
+                                    merge_b, local_abspath, svn_node_dir,
+                                    scratch_pool));
+
+  if (obstr_state != svn_wc_notify_state_inapplicable)
+    {
+      if (state)
+        *state = obstr_state;
+      return SVN_NO_ERROR;
+    }
+
   return svn_error_return(merge_props_changed(local_dir_abspath,
                                               state,
                                               tree_conflicted,
-                                              path,
+                                              local_abspath,
                                               propchanges,
                                               original_props,
                                               diff_baton,
@@ -1424,7 +1416,7 @@ merge_file_changed(const char *local_dir
      into account the new property values. */
   if (prop_changes->nelts > 0)
     {
-      svn_boolean_t tree_conflicted2;
+      svn_boolean_t tree_conflicted2 = FALSE;
 
       SVN_ERR(merge_props_changed(local_dir_abspath, prop_state,
                                   &tree_conflicted2,
@@ -2390,26 +2382,6 @@ merge_dir_opened(const char *local_dir_a
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
-  if (tree_conflicted)
-    *tree_conflicted = FALSE;
-  if (skip_children)
-    *skip_children = FALSE;
-
-  if (local_dir_abspath == NULL)
-    {
-      /* Trying to open a directory at a non-existing path.
-       * Although this is a tree-conflict, it will already have been
-       * raised by the merge_dir_opened() callback on the topmost nonexisting
-       * ancestor, where an adm_access was still present. Not raising
-       * additional tree conflicts for the child nodes inside. */
-      /* ### TODO: Verify that this holds true for explicit targets that
-       * # point deep into a nonexisting subtree. */
-      if (skip_children)
-        *skip_children = TRUE;
-      svn_pool_destroy(subpool);
-      return SVN_NO_ERROR;
-    }
-
   /* Check for an obstructed or missing node on disk. */
   SVN_ERR(perform_obstruction_check(&obstr_state, NULL, NULL, NULL, NULL,
                                     NULL,
@@ -2420,6 +2392,7 @@ merge_dir_opened(const char *local_dir_a
     {
       if (skip_children)
         *skip_children = TRUE;
+      /* But don't skip THIS, to allow a skip notification */
       svn_pool_destroy(subpool);
       return SVN_NO_ERROR;
     }