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 2014/12/28 00:20:51 UTC

svn commit: r1648125 - in /subversion/branches/fsx-id/subversion/libsvn_fs_x: dag.c dag.h tree.c tree.h

Author: stefan2
Date: Sat Dec 27 23:20:50 2014
New Revision: 1648125

URL: http://svn.apache.org/r1648125
Log:
On the fsx-id branch: Some code cleanup.

* subversion/libsvn_fs_x/dag.h
  (svn_fs_x__dag_get_fs_id): Remove.

* subversion/libsvn_fs_x/dag.c
  (svn_fs_x__dag_get_fs_id): Remove.

* subversion/libsvn_fs_x/tree.h
  (svn_fs_x__node_id): Remove from header.

* subversion/libsvn_fs_x/tree.c
  (svn_fs_x__node_id): Rename to ...
  (x_node_id): ... this.  Construct the FS API ID here.
  (root_vtable): Update function reference.

Modified:
    subversion/branches/fsx-id/subversion/libsvn_fs_x/dag.c
    subversion/branches/fsx-id/subversion/libsvn_fs_x/dag.h
    subversion/branches/fsx-id/subversion/libsvn_fs_x/tree.c
    subversion/branches/fsx-id/subversion/libsvn_fs_x/tree.h

Modified: subversion/branches/fsx-id/subversion/libsvn_fs_x/dag.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-id/subversion/libsvn_fs_x/dag.c?rev=1648125&r1=1648124&r2=1648125&view=diff
==============================================================================
--- subversion/branches/fsx-id/subversion/libsvn_fs_x/dag.c (original)
+++ subversion/branches/fsx-id/subversion/libsvn_fs_x/dag.c Sat Dec 27 23:20:50 2014
@@ -193,19 +193,6 @@ svn_fs_x__dag_get_copy_id(svn_fs_x__id_p
   return SVN_NO_ERROR;
 }
 
-svn_error_t *
-svn_fs_x__dag_get_fs_id(const svn_fs_id_t **id,
-                        dag_node_t *node,
-                        apr_pool_t *result_pool)
-{
-  node_revision_t *noderev;
-  SVN_ERR(get_node_revision(&noderev, node));
-  *id = svn_fs_x__id_create(svn_fs_x__id_create_context(node->fs, result_pool),
-                            &noderev->noderev_id, result_pool);
-
-  return SVN_NO_ERROR;
-}
-
 /* Return the node ID of NODE.  The value returned is shared with NODE,
    and will be deallocated when NODE is.  */
 svn_error_t *

Modified: subversion/branches/fsx-id/subversion/libsvn_fs_x/dag.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-id/subversion/libsvn_fs_x/dag.h?rev=1648125&r1=1648124&r2=1648125&view=diff
==============================================================================
--- subversion/branches/fsx-id/subversion/libsvn_fs_x/dag.h (original)
+++ subversion/branches/fsx-id/subversion/libsvn_fs_x/dag.h Sat Dec 27 23:20:50 2014
@@ -127,13 +127,6 @@ svn_error_t *
 svn_fs_x__dag_get_copy_id(svn_fs_x__id_part_t *copy_id,
                           dag_node_t *node);
 
-/* Return the FS API node revision ID of NODE in *ID, allocated in
-   RESULT_POOL. */
-svn_error_t *
-svn_fs_x__dag_get_fs_id(const svn_fs_id_t **id,
-                        dag_node_t *node,
-                        apr_pool_t *result_pool);
-
 /* Set *SAME to TRUE, if nodes LHS and RHS have the same node ID. */
 svn_error_t *
 svn_fs_x__dag_related_node(svn_boolean_t *same,

Modified: subversion/branches/fsx-id/subversion/libsvn_fs_x/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-id/subversion/libsvn_fs_x/tree.c?rev=1648125&r1=1648124&r2=1648125&view=diff
==============================================================================
--- subversion/branches/fsx-id/subversion/libsvn_fs_x/tree.c (original)
+++ subversion/branches/fsx-id/subversion/libsvn_fs_x/tree.c Sat Dec 27 23:20:50 2014
@@ -1401,12 +1401,14 @@ add_change(svn_fs_t *fs,
 
 /* Get the id of a node referenced by path PATH in ROOT.  Return the
    id in *ID_P allocated in POOL. */
-svn_error_t *
-svn_fs_x__node_id(const svn_fs_id_t **id_p,
-                  svn_fs_root_t *root,
-                  const char *path,
-                  apr_pool_t *pool)
+static svn_error_t *
+x_node_id(const svn_fs_id_t **id_p,
+          svn_fs_root_t *root,
+          const char *path,
+          apr_pool_t *pool)
 {
+  const svn_fs_x__noderev_id_t *noderev_id;
+
   if ((! root->is_txn_root)
       && (path[0] == '\0' || ((path[0] == '/') && (path[1] == '\0'))))
     {
@@ -1415,15 +1417,19 @@ svn_fs_x__node_id(const svn_fs_id_t **id
          svn_fs_root_t object, and never changes when it's a revision
          root, so we can just reach in and grab it directly. */
       dag_node_t *root_dir = root->fsap_data;
-      SVN_ERR(svn_fs_x__dag_get_fs_id(id_p, root_dir, pool));
+      noderev_id = svn_fs_x__dag_get_id(root_dir);
     }
   else
     {
       dag_node_t *node;
 
       SVN_ERR(get_dag(&node, root, path, FALSE, pool));
-      SVN_ERR(svn_fs_x__dag_get_fs_id(id_p, node, pool));
+      noderev_id = svn_fs_x__dag_get_id(node);
     }
+
+  *id_p = svn_fs_x__id_create(svn_fs_x__id_create_context(root->fs, pool),
+                              noderev_id, pool);
+
   return SVN_NO_ERROR;
 }
 
@@ -4204,7 +4210,7 @@ static root_vtable_t root_vtable = {
   x_paths_changed,
   svn_fs_x__check_path,
   x_node_history,
-  svn_fs_x__node_id,
+  x_node_id,
   x_node_relation,
   svn_fs_x__node_created_rev,
   x_node_origin_rev,

Modified: subversion/branches/fsx-id/subversion/libsvn_fs_x/tree.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-id/subversion/libsvn_fs_x/tree.h?rev=1648125&r1=1648124&r2=1648125&view=diff
==============================================================================
--- subversion/branches/fsx-id/subversion/libsvn_fs_x/tree.h (original)
+++ subversion/branches/fsx-id/subversion/libsvn_fs_x/tree.h Sat Dec 27 23:20:50 2014
@@ -67,13 +67,6 @@ svn_fs_x__check_path(svn_node_kind_t *ki
                      const char *path,
                      apr_pool_t *pool);
 
-/* Implement root_vtable_t.node_id(). */
-svn_error_t *
-svn_fs_x__node_id(const svn_fs_id_t **id_p,
-                  svn_fs_root_t *root,
-                  const char *path,
-                  apr_pool_t *pool);
-
 /* Set *REVISION to the revision in which PATH under ROOT was created.
    Use POOL for any temporary allocations.  If PATH is in an
    uncommitted transaction, *REVISION will be set to