You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2015/10/28 18:06:54 UTC

svn commit: r1711059 - /subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c

Author: julianfoad
Date: Wed Oct 28 17:06:54 2015
New Revision: 1711059

URL: http://svn.apache.org/viewvc?rev=1711059&view=rev
Log:
On the 'move-tracking-2' branch: Error rather than crash.

* subversion/libsvn_delta/branch.c
  (branch_state_alter): Return an error message rather than an assertion
    failure on some conditions which currently a merge can attempt to create.

Modified:
    subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c

Modified: subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c?rev=1711059&r1=1711058&r2=1711059&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c Wed Oct 28 17:06:54 2015
@@ -1023,6 +1023,16 @@ branch_state_alter(svn_branch_state_t *b
   /* NEW_PAYLOAD must be specified, either in full or by reference */
   SVN_ERR_ASSERT(new_payload);
 
+  if ((new_parent_eid == -1) != IS_BRANCH_ROOT_EID(branch, eid)
+      || (*new_name == '\0') != IS_BRANCH_ROOT_EID(branch, eid))
+    {
+      return svn_error_createf(SVN_ERR_BRANCHING, NULL,
+                               _("Cannot set e%d to (parent=e%d, name='%s'): "
+                                 "branch root is e%d"),
+                               eid, new_parent_eid, new_name,
+                               branch->priv->element_tree->root_eid);
+    }
+
   /* Insert the new version */
   branch_map_set(branch, eid, element);
   return SVN_NO_ERROR;