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/24 16:09:29 UTC

svn commit: r1647804 - in /subversion/branches/fsx-id/subversion/libsvn_fs_x: dag.c fs.h transaction.c transaction.h

Author: stefan2
Date: Wed Dec 24 15:09:29 2014
New Revision: 1647804

URL: http://svn.apache.org/r1647804
Log:
On the fsx-id:  Since the txn root noderev-ID is trivial to construct,
we don't need to store it in the transaction_t object. 

* subversion/libsvn_fs_x/fs.h
  (transaction_t): Remove root_id element.

* subversion/libsvn_fs_x/transaction.h
  (svn_fs_x__get_txn_ids): Don't return the root id anymore.

* subversion/libsvn_fs_x/transaction.c
  (svn_fs_x__get_txn): The root noderev ID is only a temporary now and
                       of our cheep internal ID type.
  (svn_fs_x__get_txn_ids): One value less to return.

* subversion/libsvn_fs_x/dag.c
  (svn_fs_x__dag_txn_base_root): Simplify caller.

Modified:
    subversion/branches/fsx-id/subversion/libsvn_fs_x/dag.c
    subversion/branches/fsx-id/subversion/libsvn_fs_x/fs.h
    subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.c
    subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.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=1647804&r1=1647803&r2=1647804&view=diff
==============================================================================
--- subversion/branches/fsx-id/subversion/libsvn_fs_x/dag.c (original)
+++ subversion/branches/fsx-id/subversion/libsvn_fs_x/dag.c Wed Dec 24 15:09:29 2014
@@ -711,9 +711,9 @@ svn_fs_x__dag_txn_base_root(dag_node_t *
                             svn_fs_x__txn_id_t txn_id,
                             apr_pool_t *pool)
 {
-  const svn_fs_id_t *base_root_id, *ignored;
+  const svn_fs_id_t *base_root_id;
 
-  SVN_ERR(svn_fs_x__get_txn_ids(&ignored, &base_root_id, fs, txn_id, pool));
+  SVN_ERR(svn_fs_x__get_txn_ids(&base_root_id, fs, txn_id, pool));
   return svn_fs_x__dag_get_node(node_p, fs,
                                 svn_fs_x__id_noderev_id(base_root_id), pool);
 }

Modified: subversion/branches/fsx-id/subversion/libsvn_fs_x/fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-id/subversion/libsvn_fs_x/fs.h?rev=1647804&r1=1647803&r2=1647804&view=diff
==============================================================================
--- subversion/branches/fsx-id/subversion/libsvn_fs_x/fs.h (original)
+++ subversion/branches/fsx-id/subversion/libsvn_fs_x/fs.h Wed Dec 24 15:09:29 2014
@@ -427,9 +427,6 @@ typedef struct transaction_t
      may be NULL if there are no properties.  */
   apr_hash_t *proplist;
 
-  /* node revision id of the root node.  */
-  const svn_fs_id_t *root_id;
-
   /* node revision id of the node which is the root of the revision
      upon which this txn is base.  (unfinished only) */
   const svn_fs_id_t *base_id;

Modified: subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.c?rev=1647804&r1=1647803&r2=1647804&view=diff
==============================================================================
--- subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.c (original)
+++ subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.c Wed Dec 24 15:09:29 2014
@@ -1412,16 +1412,15 @@ svn_fs_x__get_txn(transaction_t **txn_p,
 {
   transaction_t *txn;
   node_revision_t *noderev;
+  svn_fs_x__noderev_id_t root_id;
 
   txn = apr_pcalloc(pool, sizeof(*txn));
   txn->proplist = apr_hash_make(pool);
 
   SVN_ERR(get_txn_proplist(txn->proplist, fs, txn_id, pool));
-  txn->root_id = svn_fs_x__id_txn_create_root(txn_id, pool);
+  svn_fs_x__init_txn_root(&root_id, txn_id);
 
-  SVN_ERR(svn_fs_x__get_node_revision(&noderev, fs,
-                                      svn_fs_x__id_noderev_id(txn->root_id),
-                                      pool, pool));
+  SVN_ERR(svn_fs_x__get_node_revision(&noderev, fs, &root_id, pool, pool));
 
   txn->base_id = svn_fs_x__id_create(&noderev->node_id,
                                      &noderev->predecessor_id, pool);
@@ -3644,16 +3643,15 @@ svn_fs_x__delete_node_revision(svn_fs_t
 /*** Transactions ***/
 
 svn_error_t *
-svn_fs_x__get_txn_ids(const svn_fs_id_t **root_id_p,
-                      const svn_fs_id_t **base_root_id_p,
+svn_fs_x__get_txn_ids(const svn_fs_id_t **base_root_id_p,
                       svn_fs_t *fs,
                       svn_fs_x__txn_id_t txn_id,
                       apr_pool_t *pool)
 {
   transaction_t *txn;
   SVN_ERR(svn_fs_x__get_txn(&txn, fs, txn_id, pool));
-  *root_id_p = txn->root_id;
   *base_root_id_p = txn->base_id;
+
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.h?rev=1647804&r1=1647803&r2=1647804&view=diff
==============================================================================
--- subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.h (original)
+++ subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.h Wed Dec 24 15:09:29 2014
@@ -289,7 +289,6 @@ svn_fs_x__delete_node_revision(svn_fs_t
 
 /* Retrieve information about the Subversion transaction SVN_TXN from
    the `transactions' table of FS, allocating from POOL.  Set
-   *ROOT_ID_P to the ID of the transaction's root directory.  Set
    *BASE_ROOT_ID_P to the ID of the root directory of the
    transaction's base revision.
 
@@ -301,8 +300,7 @@ svn_fs_x__delete_node_revision(svn_fs_t
 
    Allocate *ROOT_ID_P and *BASE_ROOT_ID_P in POOL.  */
 svn_error_t *
-svn_fs_x__get_txn_ids(const svn_fs_id_t **root_id_p,
-                      const svn_fs_id_t **base_root_id_p,
+svn_fs_x__get_txn_ids(const svn_fs_id_t **base_root_id_p,
                       svn_fs_t *fs,
                       svn_fs_x__txn_id_t txn_id,
                       apr_pool_t *pool);