Author: stefan2
Date: Tue Jul 23 22:04:26 2013
New Revision: 1506321

URL: http://svn.apache.org/r1506321
Log:
On the fsfs-improvements branch:  More preliminary FSFS ID API.

* subversion/libsvn_fs_fs/id.h
  (svn_fs_fs__id_part_is_root): remove one indirection
  (svn_fs_fs__id_txn_create_root): new ID API function with preliminary
                                   signature

* subversion/libsvn_fs_fs/id.c
  (svn_fs_fs__id_part_is_root): update
  (svn_fs_fs__id_txn_create_root): implement

* subversion/libsvn_fs_fs/transaction.c
  (svn_fs_fs__get_txn,
   commit_body): use new private API

* subversion/libsvn_fs_fs/tree.c
  (get_copy_inheritance): use changed private API

Modified:
    subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/id.c
    subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/id.h
    subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/transaction.c
    subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/tree.c

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/id.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/id.c?rev=1506321&r1=1506320&r2=1506321&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/id.c 
(original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/id.c Tue Jul 
23 22:04:26 2013
@@ -42,9 +42,9 @@ typedef struct id_private_t {
 /* Operations on ID parts */
 
 svn_boolean_t
-svn_fs_fs__id_part_is_root(const char * const* part)
+svn_fs_fs__id_part_is_root(const char * part)
 {
-  return strcmp(*part, "0") == 0;
+  return strcmp(part, "0") == 0;
 }
 
 svn_boolean_t
@@ -220,6 +220,13 @@ static id_vtable_t id_vtable = {
   svn_fs_fs__id_compare
 };
 
+svn_fs_id_t *
+svn_fs_fs__id_txn_create_root(const char *txn_id,
+                              apr_pool_t *pool)
+{
+  return svn_fs_fs__id_txn_create("0", "0", txn_id, pool);
+}
+
 
 svn_fs_id_t *
 svn_fs_fs__id_txn_create(const char *node_id,

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/id.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/id.h?rev=1506321&r1=1506320&r2=1506321&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/id.h 
(original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/id.h Tue Jul 
23 22:04:26 2013
@@ -33,7 +33,7 @@ extern "C" {
 
 /* Return TRUE, if both elements of the PART is 0, i.e. this is the default
  * value if e.g. no copies were made of this node. */
-svn_boolean_t svn_fs_fs__id_part_is_root(const char * const *part);
+svn_boolean_t svn_fs_fs__id_part_is_root(const char *part);
 
 /* Return TRUE, if all element values of *LHS and *RHS match. */
 svn_boolean_t svn_fs_fs__id_part_eq(const char * lhs,
@@ -89,6 +89,10 @@ svn_boolean_t svn_fs_fs__id_check_relate
 int svn_fs_fs__id_compare(const svn_fs_id_t *a,
                           const svn_fs_id_t *b);
 
+/* Create the txn root ID for transaction TXN_ID.  Allocate it in POOL. */
+svn_fs_id_t *svn_fs_fs__id_txn_create_root(const char *txn_id,
+                                           apr_pool_t *pool);
+
 /* Create an ID within a transaction based on NODE_ID, COPY_ID, and
    TXN_ID, allocated in POOL. */
 svn_fs_id_t *svn_fs_fs__id_txn_create(const char *node_id,

Modified: 
subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/transaction.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/transaction.c?rev=1506321&r1=1506320&r2=1506321&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/transaction.c 
(original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/transaction.c 
Tue Jul 23 22:04:26 2013
@@ -1178,7 +1178,7 @@ svn_fs_fs__get_txn(transaction_t **txn_p
   txn->proplist = apr_hash_make(pool);
 
   SVN_ERR(get_txn_proplist(txn->proplist, fs, txn_id, pool));
-  root_id = svn_fs_fs__id_txn_create("0", "0", txn_id, pool);
+  root_id = svn_fs_fs__id_txn_create_root(txn_id, pool);
 
   SVN_ERR(svn_fs_fs__get_node_revision(&noderev, fs, root_id, pool));
 
@@ -2874,7 +2874,7 @@ commit_body(void *baton, apr_pool_t *poo
   SVN_ERR(svn_fs_fs__get_file_offset(&initial_offset, proto_file, pool));
 
   /* Write out all the node-revisions and directory contents. */
-  root_id = svn_fs_fs__id_txn_create("0", "0", txn_id, pool);
+  root_id = svn_fs_fs__id_txn_create_root(txn_id, pool);
   SVN_ERR(write_final_rev(&new_root_id, proto_file, new_rev, cb->fs, root_id,
                           start_node_id, start_copy_id, initial_offset,
                           cb->reps_to_cache, cb->reps_hash, cb->reps_pool,

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/tree.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/tree.c?rev=1506321&r1=1506320&r2=1506321&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/tree.c 
(original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/tree.c Tue 
Jul 23 22:04:26 2013
@@ -828,7 +828,7 @@ get_copy_inheritance(copy_id_inherit_t *
 
   /* Special case: if the child's copy ID is '0', use the parent's
      copy ID. */
-  if (strcmp(child_copy_id, "0") == 0)
+  if (svn_fs_fs__id_part_is_root(child_copy_id))
     return SVN_NO_ERROR;
 
   /* Compare the copy IDs of the child and its parent.  If they are


Reply via email to