Author: cmpilato
Date: Tue Mar 29 20:06:34 2011
New Revision: 1086707

URL: http://svn.apache.org/viewvc?rev=1086707&view=rev
Log:
Fix issue #3843 ("file externals cause non-inheritable mergeinfo") on
trunk.  (A fix was already made for the 1.6.x line.)

* subversion/include/private/svn_wc_private.h
  (svn_wc__path_switched): Remove as unused.
  (svn_wc__get_mergeinfo_walk_info): Add 'is_switched' and
    'is_file_external' return parameters.

* subversion/libsvn_wc/lock.c
  (svn_wc__path_switched): Remove as unused.

* subversion/libsvn_wc/node.c
  (svn_wc__get_mergeinfo_walk_info): Add 'is_switched' and
    'is_file_external' return parameters (and do the needful to return
    them accurately).

* subversion/libsvn_client/merge.c
  (get_mergeinfo_walk_cb): Update call to svn_wc__get_mergeinfo_walk_info(), 
    losing logic that's now encapsulated in that function and making
    use of its is-file-external determination.

* subversion/tests/cmdline/externals_tests.py
  (merge_target_with_externals): Drop @XFail() decorator.

Modified:
    subversion/trunk/subversion/include/private/svn_wc_private.h
    subversion/trunk/subversion/libsvn_client/merge.c
    subversion/trunk/subversion/libsvn_wc/lock.c
    subversion/trunk/subversion/libsvn_wc/node.c
    subversion/trunk/subversion/tests/cmdline/externals_tests.py

Modified: subversion/trunk/subversion/include/private/svn_wc_private.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_wc_private.h?rev=1086707&r1=1086706&r2=1086707&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_wc_private.h Tue Mar 29 
20:06:34 2011
@@ -44,17 +44,6 @@ extern "C" {
 #endif /* __cplusplus */
 
 
-/** Given a @a local_abspath with a @a wc_ctx, set @a *switched to
- * TRUE if @a local_abspath is switched, otherwise set @a *switched to FALSE.
- * All temporary allocations are done in * @a scratch_pool.
- */
-svn_error_t *
-svn_wc__path_switched(svn_boolean_t *switched,
-                      svn_wc_context_t *wc_ctx,
-                      const char *local_abspath,
-                      apr_pool_t *scratch_pool);
-
-
 /* Return TRUE iff CLHASH (a hash whose keys are const char *
    changelist names) is NULL or if LOCAL_ABSPATH is part of a changelist in
    CLHASH. */
@@ -743,6 +732,8 @@ svn_error_t *
 svn_wc__get_mergeinfo_walk_info(svn_boolean_t *is_present,
                                 svn_boolean_t *is_deleted,
                                 svn_boolean_t *is_absent,
+                                svn_boolean_t *is_switched,
+                                svn_boolean_t *is_file_external,
                                 svn_depth_t *depth,
                                 svn_wc_context_t *wc_ctx,
                                 const char *local_abspath,

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1086707&r1=1086706&r2=1086707&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Tue Mar 29 20:06:34 2011
@@ -5549,8 +5549,7 @@ get_mergeinfo_walk_cb(const char *local_
                       apr_pool_t *scratch_pool)
 {
   struct get_mergeinfo_walk_baton *wb = walk_baton;
-  const svn_string_t *propval;
-  svn_boolean_t switched = FALSE;
+  const svn_string_t *propval = NULL;
   svn_boolean_t has_mergeinfo = FALSE;
   svn_boolean_t path_is_merge_target =
     !svn_path_compare_paths(local_abspath, wb->merge_target_abspath);
@@ -5560,12 +5559,14 @@ get_mergeinfo_walk_cb(const char *local_
   svn_boolean_t is_present;
   svn_boolean_t deleted;
   svn_boolean_t absent;
+  svn_boolean_t switched;
+  svn_boolean_t file_external;
   svn_boolean_t immediate_child_dir;
 
   /* TODO(#2843) How to deal with a excluded item on merge? */
 
   SVN_ERR(svn_wc__get_mergeinfo_walk_info(&is_present, &deleted, &absent,
-                                          &depth,
+                                          &switched, &file_external, &depth,
                                           wb->ctx->wc_ctx, local_abspath,
                                           scratch_pool));
 
@@ -5574,38 +5575,25 @@ get_mergeinfo_walk_cb(const char *local_
   if (!is_present)
     return SVN_NO_ERROR;
 
-   if (deleted || absent)
-    {
-      propval = NULL;
-      switched = FALSE;
-    }
-  else
+  if (! (deleted || absent))
     {
       SVN_ERR(svn_wc_prop_get2(&propval, wb->ctx->wc_ctx, local_abspath,
                                SVN_PROP_MERGEINFO, scratch_pool, 
scratch_pool));
       if (propval)
         has_mergeinfo = TRUE;
-
-      /* Regardless of whether PATH has explicit mergeinfo or not, we must
-         determine if PATH is switched.  This is so get_mergeinfo_paths()
-         can later tweak PATH's parent to reflect a missing child (implying it
-         needs non-inheritable mergeinfo ranges) and PATH's siblings so they
-         get their own complete set of mergeinfo. */
-      SVN_ERR(svn_wc__path_switched(&switched, wb->ctx->wc_ctx, local_abspath,
-                                    scratch_pool));
+      
+      /* Make sure what the WC thinks is present on disk really is. */
+      SVN_ERR(record_missing_subtree_roots(local_abspath, kind,
+                                           wb->subtree_dirents,
+                                           wb->missing_subtrees,
+                                           wb->cb_pool,
+                                           scratch_pool));
     }
 
   immediate_child_dir = ((wb->depth == svn_depth_immediates)
                          &&(kind == svn_node_dir)
                          && (strcmp(abs_parent_path,
                                     wb->merge_target_abspath) == 0));
-  /* Make sure what the WC thinks is present on disk really is. */
-   if (!absent && !deleted)
-    SVN_ERR(record_missing_subtree_roots(local_abspath, kind,
-                                         wb->subtree_dirents,
-                                         wb->missing_subtrees,
-                                         wb->cb_pool,
-                                         scratch_pool));
 
   /* Store PATHs with explict mergeinfo, which are switched, are missing
      children due to a sparse checkout, are scheduled for deletion are absent
@@ -5615,7 +5603,7 @@ get_mergeinfo_walk_cb(const char *local_
   if (path_is_merge_target
       || has_mergeinfo
       || deleted
-      || switched
+      || (switched && !file_external)
       || depth == svn_depth_empty
       || depth == svn_depth_files
       || absent

Modified: subversion/trunk/subversion/libsvn_wc/lock.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/lock.c?rev=1086707&r1=1086706&r2=1086707&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/lock.c (original)
+++ subversion/trunk/subversion/libsvn_wc/lock.c Tue Mar 29 20:06:34 2011
@@ -1640,16 +1640,5 @@ svn_wc__call_with_write_lock(svn_wc__wit
   return svn_error_compose_create(err1, err2);
 }
 
-svn_error_t *
-svn_wc__path_switched(svn_boolean_t *switched,
-                      svn_wc_context_t *wc_ctx,
-                      const char *local_abspath,
-                      apr_pool_t *scratch_pool)
-{
-  svn_boolean_t wc_root;
-
-  return svn_wc__check_wc_root(&wc_root, NULL, switched, wc_ctx->db,
-                               local_abspath, scratch_pool);
-}
 
 

Modified: subversion/trunk/subversion/libsvn_wc/node.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/node.c?rev=1086707&r1=1086706&r2=1086707&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/node.c (original)
+++ subversion/trunk/subversion/libsvn_wc/node.c Tue Mar 29 20:06:34 2011
@@ -1498,6 +1498,8 @@ svn_error_t *
 svn_wc__get_mergeinfo_walk_info(svn_boolean_t *is_present,
                                 svn_boolean_t *is_deleted,
                                 svn_boolean_t *is_absent,
+                                svn_boolean_t *is_switched,
+                                svn_boolean_t *is_file_external,
                                 svn_depth_t *depth,
                                 svn_wc_context_t *wc_ctx,
                                 const char *local_abspath,
@@ -1516,6 +1518,28 @@ svn_wc__get_mergeinfo_walk_info(svn_bool
   *is_present = (status != svn_wc__db_status_not_present);
   *is_deleted = (status == svn_wc__db_status_deleted);
   *is_absent = (status == svn_wc__db_status_absent);
+  *is_switched = FALSE;
+  *is_file_external = FALSE;
+
+  if (*is_present && (! (*is_deleted || *is_absent)))
+    {
+      svn_boolean_t wc_root;
+
+      SVN_ERR(svn_wc__check_wc_root(&wc_root, NULL, is_switched, wc_ctx->db,
+                                    local_abspath, scratch_pool));
+
+      /* File externals appear switched. */
+      if (is_switched)
+        {
+          const char *serialized_file_ext;
+
+          SVN_ERR(svn_wc__db_temp_get_file_external(&serialized_file_ext,
+                                                    wc_ctx->db, local_abspath,
+                                                    scratch_pool,
+                                                    scratch_pool));
+          *is_file_external = (serialized_file_ext != NULL);
+        }
+    }
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/tests/cmdline/externals_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/externals_tests.py?rev=1086707&r1=1086706&r2=1086707&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/externals_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/externals_tests.py Tue Mar 29 
20:06:34 2011
@@ -1478,7 +1478,6 @@ def wc_repos_file_externals(sbox):
 
 #----------------------------------------------------------------------
 @Issue(3843)
-@XFail()
 def merge_target_with_externals(sbox):
   "merge target with externals"
 


Reply via email to