subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1647756 - in /subversion/branches/fsx-id/subversion/libsvn_fs_x: cached_data.c id.c id.h transaction.c
Date Wed, 24 Dec 2014 09:55:56 GMT
Author: stefan2
Date: Wed Dec 24 09:55:55 2014
New Revision: 1647756

URL: http://svn.apache.org/r1647756
Log:
On the fsx-id branch:  Introduce ID utility functions that create / init
transaction and revision root noderev IDs.  Use them where appropriate.

* subversion/libsvn_fs_x/id.h
  (svn_fs_x__init_txn_root,
   svn_fs_x__init_rev_root): Declare the new functions.

* subversion/libsvn_fs_x/id.c
  (svn_fs_x__init_txn_root,
   svn_fs_x__init_rev_root): Implement them.

* subversion/libsvn_fs_x/cached_data.c
  (svn_fs_x__rev_get_root):  Call on of the new functions.

* subversion/libsvn_fs_x/transaction.c
  (create_new_txn_noderev_from_rev): Same.

Modified:
    subversion/branches/fsx-id/subversion/libsvn_fs_x/cached_data.c
    subversion/branches/fsx-id/subversion/libsvn_fs_x/id.c
    subversion/branches/fsx-id/subversion/libsvn_fs_x/id.h
    subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.c

Modified: subversion/branches/fsx-id/subversion/libsvn_fs_x/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-id/subversion/libsvn_fs_x/cached_data.c?rev=1647756&r1=1647755&r2=1647756&view=diff
==============================================================================
--- subversion/branches/fsx-id/subversion/libsvn_fs_x/cached_data.c (original)
+++ subversion/branches/fsx-id/subversion/libsvn_fs_x/cached_data.c Wed Dec 24 09:55:55 2014
@@ -454,9 +454,7 @@ svn_fs_x__rev_get_root(svn_fs_x__id_part
                        apr_pool_t *scratch_pool)
 {
   SVN_ERR(svn_fs_x__ensure_revision_exists(rev, fs, scratch_pool));
-
-  root_id->change_set = svn_fs_x__change_set_by_rev(rev);
-  root_id->number = SVN_FS_X__ITEM_INDEX_ROOT_NODE;
+  svn_fs_x__init_rev_root(root_id, rev);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/fsx-id/subversion/libsvn_fs_x/id.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-id/subversion/libsvn_fs_x/id.c?rev=1647756&r1=1647755&r2=1647756&view=diff
==============================================================================
--- subversion/branches/fsx-id/subversion/libsvn_fs_x/id.c (original)
+++ subversion/branches/fsx-id/subversion/libsvn_fs_x/id.c Wed Dec 24 09:55:55 2014
@@ -185,6 +185,22 @@ svn_fs_x__id_part_used(const svn_fs_x__i
   return part->change_set != SVN_FS_X__INVALID_CHANGE_SET;
 }
 
+void
+svn_fs_x__init_txn_root(svn_fs_x__noderev_id_t *noderev_id,
+                        svn_fs_x__txn_id_t txn_id)
+{
+  noderev_id->change_set = svn_fs_x__change_set_by_txn(txn_id);
+  noderev_id->number = SVN_FS_X__ITEM_INDEX_ROOT_NODE;
+}
+
+void
+svn_fs_x__init_rev_root(svn_fs_x__noderev_id_t *noderev_id,
+                        svn_revnum_t rev)
+{
+  noderev_id->change_set = svn_fs_x__change_set_by_rev(rev);
+  noderev_id->number = SVN_FS_X__ITEM_INDEX_ROOT_NODE;
+}
+
 
 
 /* Accessing ID Pieces.  */

Modified: subversion/branches/fsx-id/subversion/libsvn_fs_x/id.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-id/subversion/libsvn_fs_x/id.h?rev=1647756&r1=1647755&r2=1647756&view=diff
==============================================================================
--- subversion/branches/fsx-id/subversion/libsvn_fs_x/id.h (original)
+++ subversion/branches/fsx-id/subversion/libsvn_fs_x/id.h Wed Dec 24 09:55:55 2014
@@ -107,6 +107,16 @@ void svn_fs_x__id_part_reset(svn_fs_x__i
 /* Return TRUE if *PART is belongs to either a revision or transaction. */
 svn_boolean_t svn_fs_x__id_part_used(const svn_fs_x__id_part_t *part);
 
+/* Set *NODEREV_ID to the root node ID of transaction TXN_ID. */
+void
+svn_fs_x__init_txn_root(svn_fs_x__noderev_id_t *noderev_id,
+                        svn_fs_x__txn_id_t txn_id);
+
+/* Set *NODEREV_ID to the root node ID of revision REV. */
+void
+svn_fs_x__init_rev_root(svn_fs_x__noderev_id_t *noderev_id,
+                        svn_revnum_t rev);
+
 
 /*** ID accessor functions. ***/
 

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=1647756&r1=1647755&r2=1647756&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 09:55:55 2014
@@ -1173,9 +1173,7 @@ create_new_txn_noderev_from_rev(svn_fs_t
   noderev->copyfrom_rev = SVN_INVALID_REVNUM;
 
   /* For the transaction root, the copyroot never changes. */
-
-  noderev->noderev_id.change_set = svn_fs_x__change_set_by_txn(txn_id);
-  noderev->noderev_id.number = SVN_FS_X__ITEM_INDEX_ROOT_NODE;
+  svn_fs_x__init_txn_root(&noderev->noderev_id, txn_id);
 
   return svn_fs_x__put_node_revision(fs, noderev, TRUE, pool);
 }



Mime
View raw message