You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/09/30 13:08:43 UTC

svn commit: r1527512 - in /subversion/trunk/subversion: libsvn_fs_fs/dag.c libsvn_fs_fs/dag.h libsvn_fs_fs/tree.c libsvn_fs_x/dag.c libsvn_fs_x/dag.h libsvn_fs_x/tree.c

Author: stefan2
Date: Mon Sep 30 11:08:43 2013
New Revision: 1527512

URL: http://svn.apache.org/r1527512
Log:
Revert r1527344.

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/dag.c
    subversion/trunk/subversion/libsvn_fs_fs/dag.h
    subversion/trunk/subversion/libsvn_fs_fs/tree.c
    subversion/trunk/subversion/libsvn_fs_x/dag.c
    subversion/trunk/subversion/libsvn_fs_x/dag.h
    subversion/trunk/subversion/libsvn_fs_x/tree.c

Modified: subversion/trunk/subversion/libsvn_fs_fs/dag.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/dag.c?rev=1527512&r1=1527511&r2=1527512&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/dag.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/dag.c Mon Sep 30 11:08:43 2013
@@ -663,6 +663,7 @@ svn_fs_fs__dag_clone_child(dag_node_t **
                            const char *name,
                            const svn_fs_fs__id_part_t *copy_id,
                            const svn_fs_fs__id_part_t *txn_id,
+                           svn_boolean_t is_parent_copyroot,
                            apr_pool_t *pool)
 {
   dag_node_t *cur_entry; /* parent's current entry named NAME */
@@ -694,11 +695,19 @@ svn_fs_fs__dag_clone_child(dag_node_t **
     }
   else
     {
-      node_revision_t *noderev;
+      node_revision_t *noderev, *parent_noderev;
 
       /* Go get a fresh NODE-REVISION for current child node. */
       SVN_ERR(get_node_revision(&noderev, cur_entry));
 
+      if (is_parent_copyroot)
+        {
+          SVN_ERR(get_node_revision(&parent_noderev, parent));
+          noderev->copyroot_rev = parent_noderev->copyroot_rev;
+          noderev->copyroot_path = apr_pstrdup(pool,
+                                               parent_noderev->copyroot_path);
+        }
+
       noderev->copyfrom_path = NULL;
       noderev->copyfrom_rev = SVN_INVALID_REVNUM;
 

Modified: subversion/trunk/subversion/libsvn_fs_fs/dag.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/dag.h?rev=1527512&r1=1527511&r2=1527512&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/dag.h (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/dag.h Mon Sep 30 11:08:43 2013
@@ -327,6 +327,7 @@ svn_error_t *svn_fs_fs__dag_clone_child(
                                         const char *name,
                                         const svn_fs_fs__id_part_t *copy_id,
                                         const svn_fs_fs__id_part_t *txn_id,
+                                        svn_boolean_t is_parent_copyroot,
                                         apr_pool_t *pool);
 
 

Modified: subversion/trunk/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/tree.c?rev=1527512&r1=1527511&r2=1527512&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/tree.c Mon Sep 30 11:08:43 2013
@@ -1139,11 +1139,15 @@ make_path_mutable(svn_fs_root_t *root,
   /* Are we trying to clone the root, or somebody's child node?  */
   if (parent_path->parent)
     {
-      const svn_fs_id_t *parent_id;
+      const svn_fs_id_t *parent_id, *child_id, *copyroot_id;
       svn_fs_fs__id_part_t copy_id = { SVN_INVALID_REVNUM, 0 };
       svn_fs_fs__id_part_t *copy_id_ptr = &copy_id;
       copy_id_inherit_t inherit = parent_path->copy_inherit;
-      const char *clone_path;
+      const char *clone_path, *copyroot_path;
+      svn_revnum_t copyroot_rev;
+      svn_boolean_t is_parent_copyroot = FALSE;
+      svn_fs_root_t *copyroot_root;
+      dag_node_t *copyroot_node;
 
       /* We're trying to clone somebody's child.  Make sure our parent
          is mutable.  */
@@ -1172,6 +1176,20 @@ make_path_mutable(svn_fs_root_t *root,
                       inheritance data. */
         }
 
+      /* Determine what copyroot our new child node should use. */
+      SVN_ERR(svn_fs_fs__dag_get_copyroot(&copyroot_rev, &copyroot_path,
+                                          parent_path->node));
+      SVN_ERR(svn_fs_fs__revision_root(&copyroot_root, root->fs,
+                                       copyroot_rev, pool));
+      SVN_ERR(get_dag(&copyroot_node, copyroot_root, copyroot_path,
+                      FALSE, pool));
+
+      child_id = svn_fs_fs__dag_get_id(parent_path->node);
+      copyroot_id = svn_fs_fs__dag_get_id(copyroot_node);
+      if (!svn_fs_fs__id_part_eq(svn_fs_fs__id_node_id(child_id),
+                                 svn_fs_fs__id_node_id(copyroot_id)))
+        is_parent_copyroot = TRUE;
+
       /* Now make this node mutable.  */
       clone_path = parent_path_path(parent_path->parent, pool);
       SVN_ERR(svn_fs_fs__dag_clone_child(&clone,
@@ -1179,6 +1197,7 @@ make_path_mutable(svn_fs_root_t *root,
                                          clone_path,
                                          parent_path->entry,
                                          copy_id_ptr, txn_id,
+                                         is_parent_copyroot,
                                          pool));
 
       /* Update the path cache. */

Modified: subversion/trunk/subversion/libsvn_fs_x/dag.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/dag.c?rev=1527512&r1=1527511&r2=1527512&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/dag.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/dag.c Mon Sep 30 11:08:43 2013
@@ -662,6 +662,7 @@ svn_fs_x__dag_clone_child(dag_node_t **c
                           const char *name,
                           const svn_fs_x__id_part_t *copy_id,
                           const svn_fs_x__id_part_t *txn_id,
+                          svn_boolean_t is_parent_copyroot,
                           apr_pool_t *pool)
 {
   dag_node_t *cur_entry; /* parent's current entry named NAME */
@@ -693,11 +694,19 @@ svn_fs_x__dag_clone_child(dag_node_t **c
     }
   else
     {
-      node_revision_t *noderev;
+      node_revision_t *noderev, *parent_noderev;
 
       /* Go get a fresh NODE-REVISION for current child node. */
       SVN_ERR(get_node_revision(&noderev, cur_entry));
 
+      if (is_parent_copyroot)
+        {
+          SVN_ERR(get_node_revision(&parent_noderev, parent));
+          noderev->copyroot_rev = parent_noderev->copyroot_rev;
+          noderev->copyroot_path = apr_pstrdup(pool,
+                                               parent_noderev->copyroot_path);
+        }
+
       noderev->copyfrom_path = NULL;
       noderev->copyfrom_rev = SVN_INVALID_REVNUM;
 

Modified: subversion/trunk/subversion/libsvn_fs_x/dag.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/dag.h?rev=1527512&r1=1527511&r2=1527512&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/dag.h (original)
+++ subversion/trunk/subversion/libsvn_fs_x/dag.h Mon Sep 30 11:08:43 2013
@@ -327,6 +327,7 @@ svn_error_t *svn_fs_x__dag_clone_child(d
                                        const char *name,
                                        const svn_fs_x__id_part_t *copy_id,
                                        const svn_fs_x__id_part_t *txn_id,
+                                       svn_boolean_t is_parent_copyroot,
                                        apr_pool_t *pool);
 
 

Modified: subversion/trunk/subversion/libsvn_fs_x/tree.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/tree.c?rev=1527512&r1=1527511&r2=1527512&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/tree.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/tree.c Mon Sep 30 11:08:43 2013
@@ -1117,11 +1117,15 @@ make_path_mutable(svn_fs_root_t *root,
   /* Are we trying to clone the root, or somebody's child node?  */
   if (parent_path->parent)
     {
-      const svn_fs_id_t *parent_id;
+      const svn_fs_id_t *parent_id, *child_id, *copyroot_id;
       svn_fs_x__id_part_t copy_id = { SVN_INVALID_REVNUM, 0 };
       svn_fs_x__id_part_t *copy_id_ptr = &copy_id;
       copy_id_inherit_t inherit = parent_path->copy_inherit;
-      const char *clone_path;
+      const char *clone_path, *copyroot_path;
+      svn_revnum_t copyroot_rev;
+      svn_boolean_t is_parent_copyroot = FALSE;
+      svn_fs_root_t *copyroot_root;
+      dag_node_t *copyroot_node;
 
       /* We're trying to clone somebody's child.  Make sure our parent
          is mutable.  */
@@ -1150,6 +1154,20 @@ make_path_mutable(svn_fs_root_t *root,
                       inheritance data. */
         }
 
+      /* Determine what copyroot our new child node should use. */
+      SVN_ERR(svn_fs_x__dag_get_copyroot(&copyroot_rev, &copyroot_path,
+                                          parent_path->node));
+      SVN_ERR(svn_fs_x__revision_root(&copyroot_root, root->fs,
+                                      copyroot_rev, pool));
+      SVN_ERR(get_dag(&copyroot_node, copyroot_root, copyroot_path,
+                      FALSE, pool));
+
+      child_id = svn_fs_x__dag_get_id(parent_path->node);
+      copyroot_id = svn_fs_x__dag_get_id(copyroot_node);
+      if (!svn_fs_x__id_part_eq(svn_fs_x__id_node_id(child_id),
+                                svn_fs_x__id_node_id(copyroot_id)))
+        is_parent_copyroot = TRUE;
+
       /* Now make this node mutable.  */
       clone_path = parent_path_path(parent_path->parent, pool);
       SVN_ERR(svn_fs_x__dag_clone_child(&clone,
@@ -1157,6 +1175,7 @@ make_path_mutable(svn_fs_root_t *root,
                                         clone_path,
                                         parent_path->entry,
                                         copy_id_ptr, txn_id,
+                                        is_parent_copyroot,
                                         pool));
 
       /* Update the path cache. */