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 2015/09/11 10:40:42 UTC

svn commit: r1702397 - in /subversion/trunk/subversion: libsvn_client/merge.c tests/cmdline/merge_automatic_tests.py

Author: rhuijben
Date: Fri Sep 11 08:40:42 2015
New Revision: 1702397

URL: http://svn.apache.org/r1702397
Log:
Following up on r1388302 and r1702300, handle automatic merging to a local
addition as an error instead of a segfault.

* subversion/libsvn_client/merge.c
  (client_find_automatic_merge): Properly handle error condition.
    Remove ### comment that mentioned this as a todo.

* subversion/tests/cmdline/merge_automatic_tests.py
  (merge_to_copy_and_add): Remove XFail. Update expected error.

Modified:
    subversion/trunk/subversion/libsvn_client/merge.c
    subversion/trunk/subversion/tests/cmdline/merge_automatic_tests.py

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1702397&r1=1702396&r2=1702397&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Fri Sep 11 08:40:42 2015
@@ -12571,6 +12571,14 @@ client_find_automatic_merge(automatic_me
                          allow_switched_subtrees,
                          ctx, result_pool, scratch_pool));
 
+  if (!s_t->target->loc.url)
+    return svn_error_createf(SVN_ERR_CLIENT_UNRELATED_RESOURCES, NULL,
+                             _("Can't perform automatic merge into '%s' "
+                               "because it is locally added and therefore "
+                               "not related to the merge source"),
+                             svn_dirent_local_style(target_abspath,
+                                                    scratch_pool));
+
   /* Open RA sessions to the source and target trees. */
   SVN_ERR(svn_client_open_ra_session2(&s_t->target_ra_session,
                                       s_t->target->loc.url,

Modified: subversion/trunk/subversion/tests/cmdline/merge_automatic_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/merge_automatic_tests.py?rev=1702397&r1=1702396&r2=1702397&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/merge_automatic_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/merge_automatic_tests.py Fri Sep 11 08:40:42 2015
@@ -1327,7 +1327,6 @@ def reintegrate_subtree_not_updated(sbox
   sbox.simple_commit()
   sbox.simple_update()
 
-@XFail()
 def merge_to_copy_and_add(sbox):
   "merge peg to a copy and add"
 
@@ -1344,7 +1343,8 @@ def merge_to_copy_and_add(sbox):
   sbox.simple_mkdir('A3')
   # And this case currently segfaults, because merge doesn't check
   # if the path has a repository location
-  svntest.actions.run_and_verify_svn(None, [],
+  expected_err = ".*svn: E195012: Can't perform .*A3'.*added.*"
+  svntest.actions.run_and_verify_svn(None, expected_err,
                                      'merge', '^/A', sbox.ospath('A3'))
 
 ########################################################################