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/16 06:44:03 UTC

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

Author: stefan2
Date: Tue Dec 16 05:44:03 2014
New Revision: 1645848

URL: http://svn.apache.org/r1645848
Log:
On the fsx-id branch:  Getting the commit rev from a DAG node is much
easier these days, so remove unused parts the respective private API.

* subversion/libsvn_fs_x/dag.h
  (svn_fs_x__dag_get_revision): Simplify signature.

* subversion/libsvn_fs_x/dag.c
  (svn_fs_x__dag_get_revision): Update implementation.

* subversion/libsvn_fs_x/tree.c
  (try_match_last_node,
   svn_fs_x__node_created_rev,
   x_closest_copy,
   history_prev): Update callers.

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

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=1645848&r1=1645847&r2=1645848&view=diff
==============================================================================
--- subversion/branches/fsx-id/subversion/libsvn_fs_x/dag.c (original)
+++ subversion/branches/fsx-id/subversion/libsvn_fs_x/dag.c Tue Dec 16 05:44:03 2014
@@ -285,10 +285,8 @@ svn_fs_x__dag_get_node(dag_node_t **node
 }
 
 
-svn_error_t *
-svn_fs_x__dag_get_revision(svn_revnum_t *rev,
-                           dag_node_t *node,
-                           apr_pool_t *pool)
+svn_revnum_t
+svn_fs_x__dag_get_revision(const dag_node_t *node)
 {
   /* In the special case that this is an unmodified transaction root,
      we need to actually get the revision of the noderev's predecessor
@@ -299,9 +297,7 @@ svn_fs_x__dag_get_revision(svn_revnum_t
         : &node->id;
 
   /* Look up the committed revision from the Node-ID. */
-  *rev = svn_fs_x__get_revnum(correct_id->change_set);
-
-  return SVN_NO_ERROR;
+  return svn_fs_x__get_revnum(correct_id->change_set);
 }
 
 

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=1645848&r1=1645847&r2=1645848&view=diff
==============================================================================
--- subversion/branches/fsx-id/subversion/libsvn_fs_x/dag.h (original)
+++ subversion/branches/fsx-id/subversion/libsvn_fs_x/dag.h Tue Dec 16 05:44:03 2014
@@ -104,12 +104,9 @@ svn_fs_t *svn_fs_x__dag_get_fs(dag_node_
 void svn_fs_x__dag_set_fs(dag_node_t *node, svn_fs_t *fs);
 
 
-/* Set *REV to NODE's revision number, allocating in POOL.  If NODE
-   has never been committed as part of a revision, set *REV to
-   SVN_INVALID_REVNUM.  */
-svn_error_t *svn_fs_x__dag_get_revision(svn_revnum_t *rev,
-                                        dag_node_t *node,
-                                        apr_pool_t *pool);
+/* Return NODE's revision number.  If NODE has never been committed as
+   part of a revision, set *REV to SVN_INVALID_REVNUM.  */
+svn_revnum_t svn_fs_x__dag_get_revision(const dag_node_t *node);
 
 
 /* Return the node revision ID of NODE.  The value returned is shared

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=1645848&r1=1645847&r2=1645848&view=diff
==============================================================================
--- subversion/branches/fsx-id/subversion/libsvn_fs_x/tree.c (original)
+++ subversion/branches/fsx-id/subversion/libsvn_fs_x/tree.c Tue Dec 16 05:44:03 2014
@@ -960,8 +960,7 @@ try_match_last_node(dag_node_t **node_p,
          the right lookup result irrespective of how we found it. */
       const char *created_path
         = svn_fs_x__dag_get_created_path(node);
-      svn_revnum_t revision;
-      SVN_ERR(svn_fs_x__dag_get_revision(&revision, node, scratch_pool));
+      svn_revnum_t revision = svn_fs_x__dag_get_revision(node);
 
       /* Is it an exact match? */
       if (revision == root->rev && strcmp(created_path, path) == 0)
@@ -1497,7 +1496,9 @@ svn_fs_x__node_created_rev(svn_revnum_t
   dag_node_t *node;
 
   SVN_ERR(get_dag(&node, root, path, FALSE, pool));
-  return svn_fs_x__dag_get_revision(revision, node, pool);
+  *revision = svn_fs_x__dag_get_revision(node);
+
+  return SVN_NO_ERROR;
 }
 
 
@@ -3439,7 +3440,7 @@ svn_error_t *x_closest_copy(svn_fs_root_
      created-rev is COPY_DST_REV, and that node-revision has no
      predecessors, then there is no relevant closest copy.
   */
-  SVN_ERR(svn_fs_x__dag_get_revision(&created_rev, copy_dst_node, pool));
+  created_rev = svn_fs_x__dag_get_revision(copy_dst_node);
   if (created_rev == copy_dst_rev)
     {
       const svn_fs_id_t *pred;
@@ -3517,7 +3518,7 @@ history_prev(svn_fs_history_t **prev_his
   SVN_ERR(open_path(&parent_path, root, path, 0, FALSE, scratch_pool));
   node = parent_path->node;
   commit_path = svn_fs_x__dag_get_created_path(node);
-  SVN_ERR(svn_fs_x__dag_get_revision(&commit_rev, node, scratch_pool));
+  commit_rev = svn_fs_x__dag_get_revision(node);
 
   /* The Subversion filesystem is written in such a way that a given
      line of history may have at most one interesting history point
@@ -3552,7 +3553,7 @@ history_prev(svn_fs_history_t **prev_his
              predecessor. */
           SVN_ERR(svn_fs_x__dag_get_node(&node, fs, pred_id, scratch_pool));
           commit_path = svn_fs_x__dag_get_created_path(node);
-          SVN_ERR(svn_fs_x__dag_get_revision(&commit_rev, node, scratch_pool));
+          commit_rev = svn_fs_x__dag_get_revision(node);
         }
     }