subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1527344 - 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
Date Sun, 29 Sep 2013 16:28:59 GMT
Author: stefan2
Date: Sun Sep 29 16:28:58 2013
New Revision: 1527344

URL: http://svn.apache.org/r1527344
Log:
Eliminate ineffective code from dag_clone_child and simplify callers
in FSFS and FSX.  BDB uses different code.

* subversion/libsvn_fs_fs/dag.h
  (svn_fs_fs__dag_clone_child): drop is_parent_copyroot parameter

* subversion/libsvn_fs_x/dag.h
  (svn_fs_x__dag_clone_child): ditto

* subversion/libsvn_fs_fs/dag.c
  (svn_fs_fs__dag_clone_child): remove the ineffective copy-from assignment

* subversion/libsvn_fs_x/dag.c
  (svn_fs_x__dag_clone_child): ditto

* subversion/libsvn_fs_fs/tree.c
  (make_path_mutable): update & simplify caller

* subversion/libsvn_fs_x/tree.c
  (make_path_mutable): ditto

Found by: rassilon

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=1527344&r1=1527343&r2=1527344&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/dag.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/dag.c Sun Sep 29 16:28:58 2013
@@ -663,7 +663,6 @@ 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 */
@@ -695,19 +694,11 @@ svn_fs_fs__dag_clone_child(dag_node_t **
     }
   else
     {
-      node_revision_t *noderev, *parent_noderev;
+      node_revision_t *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=1527344&r1=1527343&r2=1527344&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/dag.h (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/dag.h Sun Sep 29 16:28:58 2013
@@ -327,7 +327,6 @@ 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=1527344&r1=1527343&r2=1527344&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/tree.c Sun Sep 29 16:28:58 2013
@@ -1139,15 +1139,11 @@ 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, *child_id, *copyroot_id;
+      const svn_fs_id_t *parent_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, *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;
+      const char *clone_path;
 
       /* We're trying to clone somebody's child.  Make sure our parent
          is mutable.  */
@@ -1176,20 +1172,6 @@ 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,
@@ -1197,7 +1179,6 @@ 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=1527344&r1=1527343&r2=1527344&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/dag.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/dag.c Sun Sep 29 16:28:58 2013
@@ -662,7 +662,6 @@ 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 */
@@ -694,19 +693,11 @@ svn_fs_x__dag_clone_child(dag_node_t **c
     }
   else
     {
-      node_revision_t *noderev, *parent_noderev;
+      node_revision_t *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=1527344&r1=1527343&r2=1527344&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/dag.h (original)
+++ subversion/trunk/subversion/libsvn_fs_x/dag.h Sun Sep 29 16:28:58 2013
@@ -327,7 +327,6 @@ 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=1527344&r1=1527343&r2=1527344&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/tree.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/tree.c Sun Sep 29 16:28:58 2013
@@ -1117,15 +1117,11 @@ 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, *child_id, *copyroot_id;
+      const svn_fs_id_t *parent_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, *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;
+      const char *clone_path;
 
       /* We're trying to clone somebody's child.  Make sure our parent
          is mutable.  */
@@ -1154,20 +1150,6 @@ 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,
@@ -1175,7 +1157,6 @@ 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. */



Mime
View raw message