subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1646800 - in /subversion/branches/fsx-id/subversion/libsvn_fs_x: changes.c id.c id.h low_level.c noderevs.c transaction.c
Date Fri, 19 Dec 2014 17:26:09 GMT
Author: stefan2
Date: Fri Dec 19 17:26:09 2014
New Revision: 1646800

URL: http://svn.apache.org/r1646800
Log:
On the fsx-id branch:  Remove the copy-ID member from the svn_fs_id_t.
The copy ID remains being stored in the noderev record but we don't
need it to be immediately accessible from the FS API level ID object.

This allows / requires our containers to change their internal ID
representation.  Changes only need noderev and node ID.  The noderevs
container will store the separate ID parts now just like the noderev
struct itself.  It also represents the predecessor as a single noderev
ID because the node-ID remains the same and the copy ID is no longer
required for constructing svn_fs_id_t.

* subversion/libsvn_fs_x/id.h
  (svn_fs_x__id_copy_id): Remove.
  (svn_fs_x__id_txn_create,
   svn_fs_x__id_create): Drop the copy-ID parameter.

* subversion/libsvn_fs_x/id.c
  (fs_x__id_t): Remove the copy-ID element.
  (svn_fs_x__id_copy_id): Remove.
  (svn_fs_x__id_unparse): Omit copy-ID in string.
  (svn_fs_x__id_txn_create): Drop the copy-ID parameter.
  (svn_fs_x__id_create): Same. Also return NULL for and "unused" noderev.
  (id_parse): No copy-ID to parse anymore.

* subversion/libsvn_fs_x/changes.c
  (binary_change_t): Remove copy-ID member.
  (append_change,
   svn_fs_x__changes_get_list,
   svn_fs_x__write_changes_container,
   svn_fs_x__read_changes_container,
   svn_fs_x__changes_get_list_func): Remove all references to it. 

* subversion/libsvn_fs_x/low_level.c
  (svn_fs_x__read_noderev): Update caller.

* subversion/libsvn_fs_x/noderevs.c
  (binary_id_t): Drop. We now store ID parts individually.
  (binary_noderev_t): Add elements for node and copy ID.
  (svn_fs_x__noderevs_create): There are more ID parts that IDs.
  (store_id): Instead of whole FS API IDs, store just an ID part. 
  (svn_fs_x__noderevs_add): Store ID parts individually and convert
                            the predecessor ID to an ID part as well.
  (svn_fs_x__noderevs_estimate_size): Update estimates.
  (get_id): Return ID parts now.
  (svn_fs_x__noderevs_get): Read ID parts individually and construct
                            FS API level IDs from that.
  (svn_fs_x__write_noderevs_container,
   svn_fs_x__read_noderevs_container): Adapt (de-)serializer to struct
                                       changes.
  (svn_fs_x__noderevs_get_func): Update similarly to svn_fs_x__noderevs_get.

* subversion/libsvn_fs_x/transaction.c
  (svn_fs_x__create_node,
   svn_fs_x__add_change,
   svn_fs_x__create_successor,
   write_final_rev): Update callers.

Modified:
    subversion/branches/fsx-id/subversion/libsvn_fs_x/changes.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/low_level.c
    subversion/branches/fsx-id/subversion/libsvn_fs_x/noderevs.c
    subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.c

Modified: subversion/branches/fsx-id/subversion/libsvn_fs_x/changes.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-id/subversion/libsvn_fs_x/changes.c?rev=1646800&r1=1646799&r2=1646800&view=diff
==============================================================================
--- subversion/branches/fsx-id/subversion/libsvn_fs_x/changes.c (original)
+++ subversion/branches/fsx-id/subversion/libsvn_fs_x/changes.c Fri Dec 19 17:26:09 2014
@@ -80,7 +80,6 @@ typedef struct binary_change_t
   /* Relevant parts of the node revision ID of the change.
    * Empty, if REV_ID is not "used". */
   svn_fs_x__id_part_t node_id;
-  svn_fs_x__id_part_t copy_id;
   svn_fs_x__id_part_t noderev_id;
 
 } binary_change_t;
@@ -180,7 +179,6 @@ append_change(svn_fs_x__changes_t *chang
   if (info->node_rev_id)
     {
       binary_change.node_id = *svn_fs_x__id_node_id(info->node_rev_id);
-      binary_change.copy_id = *svn_fs_x__id_copy_id(info->node_rev_id);
       binary_change.noderev_id = *svn_fs_x__id_noderev_id(info->node_rev_id);
     }
   else
@@ -275,7 +273,6 @@ svn_fs_x__changes_get_list(apr_array_hea
 
       if (binary_change->noderev_id.change_set != SVN_FS_X__INVALID_CHANGE_SET)
         info->node_rev_id = svn_fs_x__id_create(&binary_change->node_id,
-                                                &binary_change->copy_id,
                                                 &binary_change->noderev_id,
                                                 pool);
 
@@ -332,8 +329,6 @@ svn_fs_x__write_changes_container(svn_st
   svn_packed__create_int_substream(changes_stream, TRUE, FALSE);
   svn_packed__create_int_substream(changes_stream, TRUE, TRUE);
   svn_packed__create_int_substream(changes_stream, TRUE, FALSE);
-  svn_packed__create_int_substream(changes_stream, TRUE, TRUE);
-  svn_packed__create_int_substream(changes_stream, TRUE, FALSE);
   
   /* serialize offsets array */
   for (i = 0; i < changes->offsets->nelts; ++i)
@@ -354,8 +349,6 @@ svn_fs_x__write_changes_container(svn_st
 
       svn_packed__add_int(changes_stream, change->node_id.change_set);
       svn_packed__add_uint(changes_stream, change->node_id.number);
-      svn_packed__add_int(changes_stream, change->copy_id.change_set);
-      svn_packed__add_uint(changes_stream, change->copy_id.number);
       svn_packed__add_int(changes_stream, change->noderev_id.change_set);
       svn_packed__add_uint(changes_stream, change->noderev_id.number);
     }
@@ -414,8 +407,6 @@ svn_fs_x__read_changes_container(svn_fs_
 
       change.node_id.change_set = svn_packed__get_int(changes_stream);
       change.node_id.number = svn_packed__get_uint(changes_stream);
-      change.copy_id.change_set = svn_packed__get_int(changes_stream);
-      change.copy_id.number = svn_packed__get_uint(changes_stream);
       change.noderev_id.change_set = svn_packed__get_int(changes_stream);
       change.noderev_id.number = svn_packed__get_uint(changes_stream);
 
@@ -540,7 +531,6 @@ svn_fs_x__changes_get_list_func(void **o
 
       if (binary_change->noderev_id.change_set != SVN_FS_X__INVALID_CHANGE_SET)
         info->node_rev_id = svn_fs_x__id_create(&binary_change->node_id,
-                                                &binary_change->copy_id,
                                                 &binary_change->noderev_id,
                                                 pool);
 

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=1646800&r1=1646799&r2=1646800&view=diff
==============================================================================
--- subversion/branches/fsx-id/subversion/libsvn_fs_x/id.c (original)
+++ subversion/branches/fsx-id/subversion/libsvn_fs_x/id.c Fri Dec 19 17:26:09 2014
@@ -40,7 +40,6 @@ typedef struct fs_x__id_t
 
   /* private members */
   svn_fs_x__id_part_t node_id;
-  svn_fs_x__id_part_t copy_id;
   svn_fs_x__id_part_t noderev_id;
 
   apr_pool_t *pool; /* pool that was used to allocate this struct */
@@ -200,15 +199,6 @@ svn_fs_x__id_node_id(const svn_fs_id_t *
 }
 
 
-const svn_fs_x__id_part_t *
-svn_fs_x__id_copy_id(const svn_fs_id_t *fs_id)
-{
-  const fs_x__id_t *id = (const fs_x__id_t *)fs_id;
-
-  return &id->copy_id;
-}
-
-
 svn_fs_x__txn_id_t
 svn_fs_x__id_txn_id(const svn_fs_id_t *fs_id)
 {
@@ -255,13 +245,11 @@ svn_string_t *
 svn_fs_x__id_unparse(const svn_fs_id_t *fs_id,
                      apr_pool_t *pool)
 {
-  char string[6 * SVN_INT64_BUFFER_SIZE + 10];
+  char string[4 * SVN_INT64_BUFFER_SIZE + 4];
   const fs_x__id_t *id = (const fs_x__id_t *)fs_id;
 
   char *p = part_unparse(string, &id->node_id);
   *(p++) = '.';
-  p = part_unparse(p, &id->copy_id);
-  *(p++) = '.';
   p = part_unparse(p, &id->noderev_id);
 
   return svn_string_ncreate(string, p - string, pool);
@@ -370,7 +358,6 @@ svn_fs_id_t *svn_fs_x__id_create_root(co
 
 svn_fs_id_t *
 svn_fs_x__id_txn_create(const svn_fs_x__id_part_t *node_id,
-                        const svn_fs_x__id_part_t *copy_id,
                         svn_fs_x__txn_id_t txn_id,
                         apr_uint64_t item,
                         apr_pool_t *pool)
@@ -378,7 +365,6 @@ svn_fs_x__id_txn_create(const svn_fs_x__
   fs_x__id_t *id = apr_pcalloc(pool, sizeof(*id));
 
   id->node_id = *node_id;
-  id->copy_id = *copy_id;
 
   id->noderev_id.change_set = svn_fs_x__change_set_by_txn(txn_id);
   id->noderev_id.number = item;
@@ -393,14 +379,16 @@ svn_fs_x__id_txn_create(const svn_fs_x__
 
 svn_fs_id_t *
 svn_fs_x__id_create(const svn_fs_x__id_part_t *node_id,
-                    const svn_fs_x__id_part_t *copy_id,
                     const svn_fs_x__id_part_t *noderev_id,
                     apr_pool_t *pool)
 {
-  fs_x__id_t *id = apr_pcalloc(pool, sizeof(*id));
+  fs_x__id_t *id;
+  if (!svn_fs_x__id_part_used(noderev_id))
+    return NULL;
+
+  id = apr_pcalloc(pool, sizeof(*id));
 
   id->node_id = *node_id;
-  id->copy_id = *copy_id;
   id->noderev_id = *noderev_id;
 
   id->generic_id.vtable = &id_vtable;
@@ -451,13 +439,6 @@ id_parse(char *data,
   if (! part_parse(&id->node_id, str))
     return NULL;
 
-  /* Copy Id */
-  str = svn_cstring_tokenize(".", &data);
-  if (str == NULL)
-    return NULL;
-  if (! part_parse(&id->copy_id, str))
-    return NULL;
-
   /* NodeRev Id */
   str = svn_cstring_tokenize(".", &data);
   if (str == NULL)

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=1646800&r1=1646799&r2=1646800&view=diff
==============================================================================
--- subversion/branches/fsx-id/subversion/libsvn_fs_x/id.h (original)
+++ subversion/branches/fsx-id/subversion/libsvn_fs_x/id.h Fri Dec 19 17:26:09 2014
@@ -113,9 +113,6 @@ svn_boolean_t svn_fs_x__id_part_used(con
 /* Get the "node id" portion of ID. */
 const svn_fs_x__id_part_t *svn_fs_x__id_node_id(const svn_fs_id_t *id);
 
-/* Get the "copy id" portion of ID. */
-const svn_fs_x__id_part_t *svn_fs_x__id_copy_id(const svn_fs_id_t *id);
-
 /* Get the "txn id" portion of ID,
  * or SVN_FS_X__INVALID_TXN_ID if it is a permanent ID. */
 svn_fs_x__txn_id_t svn_fs_x__id_txn_id(const svn_fs_id_t *id);
@@ -162,18 +159,16 @@ svn_fs_id_t *svn_fs_x__id_txn_create_roo
 svn_fs_id_t *svn_fs_x__id_create_root(const svn_revnum_t revision,
                                       apr_pool_t *pool);
 
-/* Create an ID within a transaction based on NODE_ID, COPY_ID, TXN_ID
-   and ITEM number, allocated in POOL. */
+/* Create an ID within a transaction based on NODE_ID, TXN_ID and ITEM
+   number, allocated in POOL. */
 svn_fs_id_t *svn_fs_x__id_txn_create(const svn_fs_x__id_part_t *node_id,
-                                     const svn_fs_x__id_part_t *copy_id,
                                      svn_fs_x__txn_id_t txn_id,
                                      apr_uint64_t item,
                                      apr_pool_t *pool);
 
-/* Create a permanent ID based on NODE_ID, COPY_ID and NODEREV_ID,
-   allocated in POOL. */
+/* Create a permanent ID based on NODE_ID and NODEREV_ID, allocated in
+   POOL.  Return NULL, if the NODEREV_ID is "unused". */
 svn_fs_id_t *svn_fs_x__id_create(const svn_fs_x__id_part_t *node_id,
-                                 const svn_fs_x__id_part_t *copy_id,
                                  const svn_fs_x__id_part_t *noderev_id,
                                  apr_pool_t *pool);
 

Modified: subversion/branches/fsx-id/subversion/libsvn_fs_x/low_level.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-id/subversion/libsvn_fs_x/low_level.c?rev=1646800&r1=1646799&r2=1646800&view=diff
==============================================================================
--- subversion/branches/fsx-id/subversion/libsvn_fs_x/low_level.c (original)
+++ subversion/branches/fsx-id/subversion/libsvn_fs_x/low_level.c Fri Dec 19 17:26:09 2014
@@ -446,8 +446,8 @@ svn_fs_x__read_noderev(node_revision_t *
   SVN_ERR(read_id_part(&noderev->node_id, headers, HEADER_NODE));
   SVN_ERR(read_id_part(&noderev->copy_id, headers, HEADER_COPY));
 
-  noderev->id = svn_fs_x__id_create(&noderev->node_id, &noderev->copy_id,
-                                    &noderev->noderev_id, result_pool);
+  noderev->id = svn_fs_x__id_create(&noderev->node_id, &noderev->noderev_id,
+                                    result_pool);
 
   /* Read the type. */
   value = svn_hash_gets(headers, HEADER_TYPE);

Modified: subversion/branches/fsx-id/subversion/libsvn_fs_x/noderevs.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-id/subversion/libsvn_fs_x/noderevs.c?rev=1646800&r1=1646799&r2=1646800&view=diff
==============================================================================
--- subversion/branches/fsx-id/subversion/libsvn_fs_x/noderevs.c (original)
+++ subversion/branches/fsx-id/subversion/libsvn_fs_x/noderevs.c Fri Dec 19 17:26:09 2014
@@ -49,16 +49,6 @@
 /* the noderev has copy-root path and revision */
 #define NODEREV_HAS_CPATH    0x00040
 
-/* Our internal representation of an id
- * (basically, strip off the txn_id and the fs-agnostic header)
- */
-typedef struct binary_id_t
-{
-  svn_fs_x__id_part_t node_id;
-  svn_fs_x__id_part_t copy_id;
-  svn_fs_x__id_part_t noderev_id;
-} binary_id_t;
-
 /* Our internal representation of an representation.
  */
 typedef struct binary_representation_t
@@ -93,9 +83,15 @@ typedef struct binary_noderev_t
   /* node type and presence indicators */
   apr_uint32_t flags;
 
-  /* Index+1 of the node-id for this node-rev. */
+  /* Index+1 of the noderev-id for this node-rev. */
   int id;
 
+  /* Index+1 of the node-id for this node-rev. */
+  int node_id;
+
+  /* Index+1 of the copy-id for this node-rev. */
+  int copy_id;
+
   /* Index+1 of the predecessor node revision id, or 0 if there is no
      predecessor for this node revision */
   int predecessor_id;
@@ -181,7 +177,7 @@ svn_fs_x__noderevs_create(int initial_co
   noderevs->paths = NULL;
 
   noderevs->ids
-    = apr_array_make(pool, initial_count, sizeof(binary_id_t));
+    = apr_array_make(pool, 2 * initial_count, sizeof(svn_fs_x__id_part_t));
   noderevs->reps
     = apr_array_make(pool, 2 * initial_count, sizeof(binary_representation_t));
   noderevs->noderevs
@@ -196,24 +192,19 @@ svn_fs_x__noderevs_create(int initial_co
 static int
 store_id(apr_array_header_t *ids,
          apr_hash_t *dict,
-         const svn_fs_id_t *id)
+         const svn_fs_x__id_part_t *id)
 {
-  binary_id_t bin_id = { { 0 } };
   int idx;
   void *idx_void;
 
-  if (id == NULL)
+  if (!svn_fs_x__id_part_used(id))
     return 0;
-  
-  bin_id.node_id = *svn_fs_x__id_node_id(id);
-  bin_id.copy_id = *svn_fs_x__id_copy_id(id);
-  bin_id.noderev_id = *svn_fs_x__id_noderev_id(id);
 
-  idx_void = apr_hash_get(dict, &bin_id, sizeof(bin_id));
+  idx_void = apr_hash_get(dict, &id, sizeof(id));
   idx = (int)(apr_uintptr_t)idx_void;
   if (idx == 0)
     {
-      APR_ARRAY_PUSH(ids, binary_id_t) = bin_id;
+      APR_ARRAY_PUSH(ids, svn_fs_x__id_part_t) = *id;
       idx = ids->nelts;
       apr_hash_set(dict, ids->elts + (idx-1) * ids->elt_size,
                    ids->elt_size, (void*)(apr_uintptr_t)idx);
@@ -270,9 +261,26 @@ svn_fs_x__noderevs_add(svn_fs_x__noderev
                        | (int)noderev->kind;
 
   binary_noderev.id
-    = store_id(container->ids, container->ids_dict, noderev->id);
-  binary_noderev.predecessor_id
-    = store_id(container->ids, container->ids_dict, noderev->predecessor_id);
+    = store_id(container->ids, container->ids_dict, &noderev->noderev_id);
+  binary_noderev.node_id
+    = store_id(container->ids, container->ids_dict, &noderev->node_id);
+  binary_noderev.copy_id
+    = store_id(container->ids, container->ids_dict, &noderev->copy_id);
+
+  if (noderev->predecessor_id)
+    {
+      binary_noderev.predecessor_id
+        = store_id(container->ids, container->ids_dict,
+                  svn_fs_x__id_noderev_id(noderev->predecessor_id));
+    }
+  else
+    {
+      svn_fs_x__id_part_t unused;
+      svn_fs_x__id_part_reset(&unused);
+
+      binary_noderev.predecessor_id
+        = store_id(container->ids, container->ids_dict, &unused);
+    }
 
   if (noderev->copyfrom_path)
     {
@@ -322,48 +330,39 @@ svn_fs_x__noderevs_estimate_size(const s
 
   /* string table code makes its own prediction,
    * noderevs should be < 16 bytes each,
-   * ids < 10 bytes each,
+   * id parts < 4 bytes each,
    * data representations < 40 bytes each,
    * property representations < 30 bytes each,
    * some static overhead should be assumed */
   return svn_fs_x__string_table_builder_estimate_size(container->builder)
        + container->noderevs->nelts * 16
-       + container->ids->nelts * 10
+       + container->ids->nelts * 4
        + container->reps->nelts * 40
        + 100;
 }
 
-/* Create an svn_fs_id_t in *ID, allocated in POOL based on the id stored
- * at index IDX in IDS.
+/* Set *ID to the ID part stored at index IDX in IDS.
  */
 static svn_error_t *
-get_id(const svn_fs_id_t **id,
+get_id(svn_fs_x__id_part_t *id,
        const apr_array_header_t *ids,
-       int idx,
-       apr_pool_t *pool)
+       int idx)
 {
-  binary_id_t *binary_id;
-
   /* handle NULL IDs  */
   if (idx == 0)
     {
-      *id = NULL;
+      svn_fs_x__id_part_reset(id);
       return SVN_NO_ERROR;
     }
 
   /* check for corrupted data */
   if (idx < 0 || idx > ids->nelts)
     return svn_error_createf(SVN_ERR_FS_CONTAINER_INDEX, NULL,
-                             _("Node revision ID index %d" 
-                               " exceeds container size %d"),
+                             _("ID part index %d exceeds container size %d"),
                              idx, ids->nelts);
 
-  /* create a svn_fs_id_t from stored info */
-  binary_id = &APR_ARRAY_IDX(ids, idx - 1, binary_id_t);
-  *id = svn_fs_x__id_create(&binary_id->node_id,
-                            &binary_id->copy_id,
-                            &binary_id->noderev_id,
-                            pool);
+  /* Return the requested ID. */
+  *id = APR_ARRAY_IDX(ids, idx - 1, svn_fs_x__id_part_t);
 
   return SVN_NO_ERROR;
 }
@@ -417,7 +416,8 @@ svn_fs_x__noderevs_get(node_revision_t *
 {
   node_revision_t *noderev;
   binary_noderev_t *binary_noderev;
-  
+  svn_fs_x__id_part_t predecessor_id;
+
   /* CONTAINER must be in 'finalized' mode */
   SVN_ERR_ASSERT(container->builder == NULL);
   SVN_ERR_ASSERT(container->paths);
@@ -434,15 +434,21 @@ svn_fs_x__noderevs_get(node_revision_t *
   /* allocate result struct and fill it field by field */
   noderev = apr_pcalloc(pool, sizeof(*noderev));
   binary_noderev = &APR_ARRAY_IDX(container->noderevs, idx, binary_noderev_t);
-  
+
   noderev->kind = (svn_node_kind_t)(binary_noderev->flags & NODEREV_KIND_MASK);
-  SVN_ERR(get_id(&noderev->id, container->ids, binary_noderev->id, pool));
-  SVN_ERR(get_id(&noderev->predecessor_id, container->ids,
-                 binary_noderev->predecessor_id, pool));
-
-  noderev->noderev_id = *svn_fs_x__id_noderev_id(noderev->id);
-  noderev->node_id = *svn_fs_x__id_node_id(noderev->id);
-  noderev->copy_id = *svn_fs_x__id_copy_id(noderev->id);
+  SVN_ERR(get_id(&noderev->noderev_id, container->ids, binary_noderev->id));
+  SVN_ERR(get_id(&noderev->node_id, container->ids,
+                 binary_noderev->node_id));
+  SVN_ERR(get_id(&noderev->copy_id, container->ids,
+                 binary_noderev->copy_id));
+  SVN_ERR(get_id(&predecessor_id, container->ids,
+                 binary_noderev->predecessor_id));
+
+  noderev->id = svn_fs_x__id_create(&noderev->node_id, &noderev->noderev_id,
+                                    pool);
+  noderev->predecessor_id = svn_fs_x__id_create(&noderev->node_id,
+                                                &predecessor_id,
+                                                pool);
 
   if (binary_noderev->flags & NODEREV_HAS_COPYFROM)
     {
@@ -575,26 +581,24 @@ svn_fs_x__write_noderevs_container(svn_s
   svn_packed__byte_stream_t *digests_stream
     = svn_packed__create_bytes_stream(root);
 
-  /* structure the CHANGES_STREAM such we can extract much of the redundancy
-   * from the binary_change_t structs */
-  for (i = 0; i < 3 * 2; ++i)
+  /* structure the IDS_STREAM such we can extract much of the redundancy
+   * from the svn_fs_x__ip_part_t structs */
+  for (i = 0; i < 2; ++i)
     svn_packed__create_int_substream(ids_stream, TRUE, FALSE);
 
+  /* Same storing binary_noderev_t in the NODEREVS_STREAM */
   svn_packed__create_int_substream(noderevs_stream, FALSE, FALSE);
-  for (i = 0; i < 11; ++i)
+  for (i = 0; i < 13; ++i)
     svn_packed__create_int_substream(noderevs_stream, TRUE, FALSE);
 
   /* serialize ids array */
   for (i = 0; i < container->ids->nelts; ++i)
     {
-      binary_id_t *id = &APR_ARRAY_IDX(container->ids, i, binary_id_t);
+      svn_fs_x__id_part_t *id = &APR_ARRAY_IDX(container->ids, i,
+                                               svn_fs_x__id_part_t);
 
-      svn_packed__add_int(ids_stream, id->node_id.change_set);
-      svn_packed__add_uint(ids_stream, id->node_id.number);
-      svn_packed__add_int(ids_stream, id->copy_id.change_set);
-      svn_packed__add_uint(ids_stream, id->copy_id.number);
-      svn_packed__add_int(ids_stream, id->noderev_id.change_set);
-      svn_packed__add_uint(ids_stream, id->noderev_id.number);
+      svn_packed__add_int(ids_stream, id->change_set);
+      svn_packed__add_uint(ids_stream, id->number);
     }
 
   /* serialize rep arrays */
@@ -609,6 +613,8 @@ svn_fs_x__write_noderevs_container(svn_s
       svn_packed__add_uint(noderevs_stream, noderev->flags);
 
       svn_packed__add_uint(noderevs_stream, noderev->id);
+      svn_packed__add_uint(noderevs_stream, noderev->node_id);
+      svn_packed__add_uint(noderevs_stream, noderev->copy_id);
       svn_packed__add_uint(noderevs_stream, noderev->predecessor_id);
       svn_packed__add_uint(noderevs_stream, noderev->predecessor_count);
 
@@ -730,19 +736,15 @@ svn_fs_x__read_noderevs_container(svn_fs
   count
     = svn_packed__int_count(svn_packed__first_int_substream(ids_stream));
   noderevs->ids
-    = apr_array_make(result_pool, (int)count, sizeof(binary_id_t));
+    = apr_array_make(result_pool, (int)count, sizeof(svn_fs_x__id_part_t));
   for (i = 0; i < count; ++i)
     {
-      binary_id_t id;
+      svn_fs_x__id_part_t id;
 
-      id.node_id.change_set = (svn_revnum_t)svn_packed__get_int(ids_stream);
-      id.node_id.number = svn_packed__get_uint(ids_stream);
-      id.copy_id.change_set = (svn_revnum_t)svn_packed__get_int(ids_stream);
-      id.copy_id.number = svn_packed__get_uint(ids_stream);
-      id.noderev_id.change_set = (svn_revnum_t)svn_packed__get_int(ids_stream);
-      id.noderev_id.number = svn_packed__get_uint(ids_stream);
+      id.change_set = (svn_revnum_t)svn_packed__get_int(ids_stream);
+      id.number = svn_packed__get_uint(ids_stream);
 
-      APR_ARRAY_PUSH(noderevs->ids, binary_id_t) = id;
+      APR_ARRAY_PUSH(noderevs->ids, svn_fs_x__id_part_t) = id;
     }
 
   /* read rep arrays */
@@ -761,6 +763,8 @@ svn_fs_x__read_noderevs_container(svn_fs
       noderev.flags = (apr_uint32_t)svn_packed__get_uint(noderevs_stream);
 
       noderev.id = (int)svn_packed__get_uint(noderevs_stream);
+      noderev.node_id = (int)svn_packed__get_uint(noderevs_stream);
+      noderev.copy_id = (int)svn_packed__get_uint(noderevs_stream);
       noderev.predecessor_id = (int)svn_packed__get_uint(noderevs_stream);
       noderev.predecessor_count = (int)svn_packed__get_uint(noderevs_stream);
 
@@ -864,7 +868,8 @@ svn_fs_x__noderevs_get_func(void **out,
 {
   node_revision_t *noderev;
   binary_noderev_t *binary_noderev;
-  
+  svn_fs_x__id_part_t predecessor_id;
+
   apr_array_header_t ids;
   apr_array_header_t reps;
   apr_array_header_t noderevs;
@@ -886,9 +891,16 @@ svn_fs_x__noderevs_get_func(void **out,
   binary_noderev = &APR_ARRAY_IDX(&noderevs, idx, binary_noderev_t);
 
   noderev->kind = (svn_node_kind_t)(binary_noderev->flags & NODEREV_KIND_MASK);
-  SVN_ERR(get_id(&noderev->id, &ids, binary_noderev->id, pool));
-  SVN_ERR(get_id(&noderev->predecessor_id, &ids,
-                 binary_noderev->predecessor_id, pool));
+  SVN_ERR(get_id(&noderev->noderev_id, &ids, binary_noderev->id));
+  SVN_ERR(get_id(&noderev->node_id, &ids, binary_noderev->node_id));
+  SVN_ERR(get_id(&noderev->copy_id, &ids, binary_noderev->copy_id));
+  SVN_ERR(get_id(&predecessor_id, &ids, binary_noderev->predecessor_id));
+
+  noderev->id = svn_fs_x__id_create(&noderev->node_id, &noderev->noderev_id,
+                                    pool);
+  noderev->predecessor_id = svn_fs_x__id_create(&noderev->node_id,
+                                                &predecessor_id,
+                                                pool);
 
   if (binary_noderev->flags & NODEREV_HAS_COPYFROM)
     {

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=1646800&r1=1646799&r2=1646800&view=diff
==============================================================================
--- subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.c (original)
+++ subversion/branches/fsx-id/subversion/libsvn_fs_x/transaction.c Fri Dec 19 17:26:09 2014
@@ -1641,7 +1641,7 @@ svn_fs_x__create_node(const svn_fs_id_t
   SVN_ERR(allocate_item_index(&number, fs, txn_id, pool));
 
   /* Construct the ID object from all the above parts. */
-  id = svn_fs_x__id_txn_create(&node_id, copy_id, txn_id, number, pool);
+  id = svn_fs_x__id_txn_create(&node_id, txn_id, number, pool);
   noderev->id = id;
   noderev->copy_id = *copy_id;
   noderev->node_id = node_id;
@@ -1815,7 +1815,7 @@ svn_fs_x__add_change(svn_fs_t *fs,
       /* There is no valid ID.  Provide a dummy. */
       svn_fs_x__id_part_t dummy;
       svn_fs_x__id_part_reset(&dummy);
-      fs_id = svn_fs_x__id_create(&dummy, &dummy, id, pool);
+      fs_id = svn_fs_x__id_create(&dummy, id, pool);
     }
   else
     {
@@ -2470,7 +2470,7 @@ svn_fs_x__create_successor(const svn_fs_
   SVN_ERR(allocate_item_index(&new_noderev->noderev_id.number, fs, txn_id,
                               pool));
 
-  new_noderev->id = svn_fs_x__id_create(&new_noderev->node_id, copy_id,
+  new_noderev->id = svn_fs_x__id_create(&new_noderev->node_id,
                                         &new_noderev->noderev_id, pool);
   if (! new_noderev->copyroot_path)
     {
@@ -2947,8 +2947,8 @@ write_final_rev(const svn_fs_id_t **new_
 
   SVN_ERR(store_l2p_index_entry(fs, txn_id, my_offset,
                                 noderev->noderev_id.number, pool));
-  new_id = svn_fs_x__id_create(&noderev->node_id, &noderev->copy_id,
-                               &noderev->noderev_id, pool);
+  new_id = svn_fs_x__id_create(&noderev->node_id,  &noderev->noderev_id,
+                               pool);
   noderev->id = new_id;
 
   if (ffd->rep_sharing_allowed)



Mime
View raw message