[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] issue #3469: tree conflict under a directory external

From: Daniel Shahaf <danielsh_at_elego.de>
Date: Sun, 27 Mar 2011 01:30:45 +0200

Issue #3469 is about having merge pull in the addition of A/mu when A/
is an external. (File modifications work and raise a tree conflict.)

The following patch attempts to address it by having merge_file_added()
skip the addition of files under a directory external. Thoughts or +1's?

Daniel

[[[
Resolve issue #3469 (tree conflict under a directory external).

* subversion/libsvn_client/merge.c
  (merge_file_added):
    Skip files that belong to externals or to disjoint working copies.

TODO: wrap the comment
TODO: remove @XFail decorator
(from tree_conflict_tests.py 22)
]]]

[[[
Index: subversion/libsvn_client/merge.c
===================================================================
--- subversion/libsvn_client/merge.c (revision 1085436)
+++ subversion/libsvn_client/merge.c (working copy)
@@ -1531,6 +1531,10 @@ merge_file_added(const char *local_dir_abspath,
   int i;
   apr_hash_t *file_props;
 
+ SVN_DBG(("merge_file_added(): local_dir_abspath='%s'\n", local_dir_abspath));
+ SVN_DBG(("merge_file_added(): mine_abspath='%s'\n", mine_abspath));
+ SVN_DBG(("merge_file_added(): target_abspath='%s'\n", merge_b->target_abspath));
+
   SVN_ERR_ASSERT(svn_dirent_is_absolute(mine_abspath));
 
   /* Easy out: We are only applying mergeinfo differences. */
@@ -1555,6 +1559,21 @@ merge_file_added(const char *local_dir_abspath,
   if (tree_conflicted)
     *tree_conflicted = FALSE;
 
+ /* Easy out: not the same working copy. (So, a disjoint working copy or an external.) */
+ {
+ const char *mine_wcroot_abspath;
+ const char *target_wcroot_abspath;
+ SVN_ERR(svn_wc_get_wc_root(&mine_wcroot_abspath, merge_b->ctx->wc_ctx,
+ mine_abspath, scratch_pool, scratch_pool));
+ SVN_ERR(svn_wc_get_wc_root(&target_wcroot_abspath, merge_b->ctx->wc_ctx,
+ merge_b->target_abspath, scratch_pool, scratch_pool));
+ if (strcmp(mine_wcroot_abspath, target_wcroot_abspath))
+ {
+ *content_state = svn_wc_notify_state_obstructed;
+ return SVN_NO_ERROR;
+ }
+ }
+
   /* Apply the prop changes to a new hash table. */
   file_props = apr_hash_copy(subpool, original_props);
   for (i = 0; i < prop_changes->nelts; ++i)
]]]
Received on 2011-03-27 00:31:35 CET

This is an archived mail posted to the Subversion Dev mailing list.