subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1670644 - /subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c
Date Wed, 01 Apr 2015 13:38:27 GMT
Author: julianfoad
Date: Wed Apr  1 13:38:26 2015
New Revision: 1670644

URL: http://svn.apache.org/r1670644
Log:
On the 'move-tracking-2' branch: When moving by branch-and-delete,
allow 'moving' a whole branch in this way. This is useful for combining
disjoint subtree branches back into a bigger tree, the opposite of
branching from a subtree.

* subversion/svnmover/svnmover.c
  (move_by_branch_and_delete): If the source is itself a branch root, then
    delete it by deleting from the outer branch instead of from within itself.

Modified:
    subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c

Modified: subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c?rev=1670644&r1=1670643&r2=1670644&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c (original)
+++ subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c Wed Apr  1 13:38:26
2015
@@ -1231,8 +1231,18 @@ move_by_branch_and_delete(svn_editor3_t
   SVN_ERR_ASSERT(! BRANCH_IS_SAME_BRANCH(el_rev->branch, to_branch,
                                          scratch_pool));
 
-  SVN_ERR(svn_editor3_delete(editor, el_rev->rev,
-                             el_rev->branch, el_rev->eid));
+  /* Delete the source subtree. If it's a whole branch, do so by deleting
+     its root from the outer branch instead. */
+  if (el_rev->eid != el_rev->branch->sibling_defn->root_eid)
+    {
+      SVN_ERR(svn_editor3_delete(editor, el_rev->rev,
+                                 el_rev->branch, el_rev->eid));
+    }
+  else
+    {
+      SVN_ERR(svn_editor3_delete(editor, el_rev->rev,
+                                 el_rev->branch->outer_branch, el_rev->branch->outer_eid));
+    }
   SVN_ERR(svn_branch_instantiate_subtree(to_branch,
                                          to_parent_eid, to_name, subtree,
                                          scratch_pool));



Mime
View raw message