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 2013/03/10 05:33:31 UTC

svn commit: r1454784 - in /subversion/branches/fsfs-format7/subversion/libsvn_fs_fs: cached_data.c fs.h id.c id.h low_level.c rep-cache.c temp_serializer.c transaction.c util.c util.h

Author: stefan2
Date: Sun Mar 10 04:33:30 2013
New Revision: 1454784

URL: http://svn.apache.org/r1454784
Log:
On the fsfs-format7 branch:  Switch the txn_id member of representation_t
from C string to ID part struct.  Update users and their interfaces to
use ID part structs for txn IDs, too.  Introduce and use utility functions
to check whether a txn ID struct is used (equivalent to a non-NULL txn_id)
and to reset one to unused state.

This is another patch of the "numerical IDs" patch series.

* subversion/libsvn_fs_fs/fs.h
  (representation_t): switch txn_id from string to struct

* subversion/libsvn_fs_fs/id.h
  (svn_fs_fs__id_txn_used,
   svn_fs_fs__id_txn_reset): declare API functions to test & reset txn IDs

* subversion/libsvn_fs_fs/id.c
  (svn_fs_fs__id_txn_used,
   svn_fs_fs__id_txn_reset): implement new API functions

* subversion/libsvn_fs_fs/cached_data.c
  (open_and_seek_transaction): convert txn_id to string
  (open_and_seek_representation,
   create_rep_state_body,
   svn_fs_fs__rep_chain_length,
   build_rep_list,
   get_dir_contents,
   svn_fs_fs__get_proplist): use new API to test / reset txn

* subversion/libsvn_fs_fs/rep-cache.c
  (svn_fs_fs__walk_rep_reference,
   svn_fs_fs__get_rep_reference): ditto

* subversion/libsvn_fs_fs/low_level.c
  (svn_fs_fs__parse_representation,
   svn_fs_fs__unparse_representation): ditto
  (read_rep_offsets): parse string

* subversion/libsvn_fs_fs/temp_serializer.c
  (serialize_representation,
   deserialize_representation): update and simplify

* subversion/libsvn_fs_fs/util.h
  (path_txn_sha1): switch txn_id parameter from string to struct

* subversion/libsvn_fs_fs/util.c
  (path_txn_sha1): update; temporarily convert to string here

* subversion/libsvn_fs_fs/transaction.c
  (store_sha1_rep_mapping): update API caller
  (set_uniquifier): drop TXN_ID parameter; update
  (svn_fs_fs__set_entry,
   get_shared_rep,
   rep_write_contents_close,
   svn_fs_fs__set_proplist): update callers
  (set_representation,
   write_final_rev,
   svn_fs_fs__delete_node_revision): use new API to test / reset txn

Modified:
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/cached_data.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs.h
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/id.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/id.h
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/rep-cache.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/temp_serializer.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/util.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/util.h

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/cached_data.c?rev=1454784&r1=1454783&r2=1454784&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/cached_data.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/cached_data.c Sun Mar 10 04:33:30 2013
@@ -237,13 +237,14 @@ open_and_seek_transaction(apr_file_t **f
 {
   apr_file_t *rev_file;
   apr_off_t offset;
+  const char *txn_id = svn_fs_fs__id_txn_unparse(&rep->txn_id, pool);
 
   SVN_ERR(svn_io_file_open(&rev_file,
-                           path_txn_proto_rev(fs, rep->txn_id, pool),
+                           path_txn_proto_rev(fs, txn_id, pool),
                            APR_READ | APR_BUFFERED, APR_OS_DEFAULT, pool));
 
   SVN_ERR(svn_fs_fs__item_offset(&offset, fs, SVN_INVALID_REVNUM,
-                                 rep->txn_id, rep->item_index, pool));
+                                 txn_id, rep->item_index, pool));
   SVN_ERR(aligned_seek(fs, rev_file, NULL, offset, pool));
 
   *file = rev_file;
@@ -260,7 +261,7 @@ open_and_seek_representation(apr_file_t 
                              representation_t *rep,
                              apr_pool_t *pool)
 {
-  if (! rep->txn_id)
+  if (! svn_fs_fs__id_txn_used(&rep->txn_id))
     return open_and_seek_revision(file_p, fs, rep->revision, rep->item_index,
                                   pool);
   else
@@ -667,9 +668,10 @@ create_rep_state_body(rep_state_t **rep_
   rs->combined_cache = ffd->combined_window_cache;
   rs->ver = -1;
 
-  if (ffd->rep_header_cache && !rep->txn_id)
+  if (ffd->rep_header_cache && !svn_fs_fs__id_txn_used(&rep->txn_id))
     SVN_ERR(svn_cache__get((void **) &rh, &is_cached,
                            ffd->rep_header_cache, &key, pool));
+
   if (is_cached)
     {
       /* we don't know the offset of the item */
@@ -727,7 +729,7 @@ create_rep_state_body(rep_state_t **rep_
       SVN_ERR(svn_fs_fs__read_rep_header(&rh, rs->file->stream, pool));
       SVN_ERR(get_file_offset(&rs->start, rs->file->file, pool));
 
-      if (!rep->txn_id)
+      if (! svn_fs_fs__id_txn_used(&rep->txn_id))
         {
           if (ffd->format >= SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
             SVN_ERR(block_read(NULL, fs, rep->revision, rep->item_index,
@@ -851,7 +853,7 @@ svn_fs_fs__rep_chain_length(int *chain_l
       base_rep.revision = header->base_revision;
       base_rep.item_index = header->base_item_index;
       base_rep.size = header->base_length;
-      base_rep.txn_id = NULL;
+      svn_fs_fs__id_txn_reset(&base_rep.txn_id);
       is_delta = header->is_delta;
 
       ++count;
@@ -1117,8 +1119,9 @@ build_rep_list(apr_array_header_t **list
         SVN_ERR(create_rep_state(&rs, &rep_header, &shared_file,
                                  &rep, fs, pool));
 
-      if (!rep.txn_id)
+      if (!svn_fs_fs__id_txn_used(&rep.txn_id))
         SVN_ERR(get_cached_combined_window(window_p, rs, &is_cached, pool));
+
       if (is_cached)
         {
           /* We already have a reconstructed window in our cache.
@@ -1148,7 +1151,7 @@ build_rep_list(apr_array_header_t **list
       rep.revision = rep_header->base_revision;
       rep.item_index = rep_header->base_item_index;
       rep.size = rep_header->base_length;
-      rep.txn_id = NULL;
+      svn_fs_fs__id_txn_reset(&rep.txn_id);
 
       rs = NULL;
     }
@@ -1839,7 +1842,7 @@ get_dir_contents(apr_hash_t *entries,
 {
   svn_stream_t *contents;
 
-  if (noderev->data_rep && noderev->data_rep->txn_id)
+  if (noderev->data_rep && svn_fs_fs__id_txn_used(&noderev->data_rep->txn_id))
     {
       const char *filename = path_txn_node_children(fs, noderev->id, pool);
 
@@ -2078,7 +2081,7 @@ svn_fs_fs__get_proplist(apr_hash_t **pro
   apr_hash_t *proplist;
   svn_stream_t *stream;
 
-  if (noderev->prop_rep && noderev->prop_rep->txn_id)
+  if (noderev->prop_rep && svn_fs_fs__id_txn_used(&noderev->prop_rep->txn_id))
     {
       const char *filename = path_txn_node_props(fs, noderev->id, pool);
       proplist = apr_hash_make(pool);

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs.h?rev=1454784&r1=1454783&r2=1454784&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs.h (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs.h Sun Mar 10 04:33:30 2013
@@ -482,7 +482,7 @@ typedef struct representation_t
   svn_filesize_t expanded_size;
 
   /* Is this representation a transaction? */
-  const char *txn_id;
+  svn_fs_fs__id_part_t txn_id;
 
   /* For rep-sharing, we need a way of uniquifying node-revs which share the
      same representation (see svn_fs_fs__noderev_same_rep_key() ).  So, we

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/id.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/id.c?rev=1454784&r1=1454783&r2=1454784&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/id.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/id.c Sun Mar 10 04:33:30 2013
@@ -140,6 +140,19 @@ svn_fs_fs__id_part_eq(const svn_fs_fs__i
   return lhs->revision == rhs->revision && lhs->number == rhs->number;
 }
 
+svn_boolean_t
+svn_fs_fs__id_txn_used(const svn_fs_fs__id_part_t *txn_id)
+{
+  return SVN_IS_VALID_REVNUM(txn_id->revision) || (txn_id->number != 0);
+}
+
+void
+svn_fs_fs__id_txn_reset(svn_fs_fs__id_part_t *txn_id)
+{
+  txn_id->revision = SVN_INVALID_REVNUM;
+  txn_id->number = 0;
+}
+
 svn_error_t *
 svn_fs_fs__id_txn_parse(svn_fs_fs__id_part_t *txn_id,
                         const char *data)

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/id.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/id.h?rev=1454784&r1=1454783&r2=1454784&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/id.h (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/id.h Sun Mar 10 04:33:30 2013
@@ -55,6 +55,12 @@ svn_boolean_t svn_fs_fs__id_part_is_root
 svn_boolean_t svn_fs_fs__id_part_eq(const svn_fs_fs__id_part_t *lhs,
                                     const svn_fs_fs__id_part_t *rhs);
 
+/* Return TRUE, if TXN_ID is used, i.e. doesn't contain just the defaults. */
+svn_boolean_t svn_fs_fs__id_txn_used(const svn_fs_fs__id_part_t *txn_id);
+
+/* Reset TXN_ID to the defaults. */
+void svn_fs_fs__id_txn_reset(svn_fs_fs__id_part_t *txn_id);
+
 /* Parse the transaction id in DATA and store the result in *TXN_ID */
 svn_error_t *svn_fs_fs__id_txn_parse(svn_fs_fs__id_part_t *txn_id,
                                      const char *data);

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.c?rev=1454784&r1=1454783&r2=1454784&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.c Sun Mar 10 04:33:30 2013
@@ -261,6 +261,9 @@ svn_fs_fs__parse_representation(represen
 
   rep->revision = SVN_STR_TO_REV(str);
 
+  /* initialize transaction info (never stored) */
+  svn_fs_fs__id_txn_reset(&rep->txn_id);
+  
   /* while in transactions, it is legal to simply write "-1" */
   str = svn_cstring_tokenize(" ", &string);
   if (str == NULL)
@@ -357,7 +360,8 @@ read_rep_offsets(representation_t **rep_
 
   if ((*rep_p)->revision == SVN_INVALID_REVNUM)
     if (noderev_id)
-      (*rep_p)->txn_id = svn_fs_fs__id_txn_id(noderev_id);
+      SVN_ERR(svn_fs_fs__id_txn_parse(&(*rep_p)->txn_id,
+                                      svn_fs_fs__id_txn_id(noderev_id)));
 
   return SVN_NO_ERROR;
 }
@@ -530,7 +534,7 @@ svn_fs_fs__unparse_representation(repres
                                   apr_pool_t *pool)
 {
   char buffer[SVN_INT64_BUFFER_SIZE];
-  if (rep->txn_id && mutable_rep_truncated)
+  if (svn_fs_fs__id_txn_used(&rep->txn_id) && mutable_rep_truncated)
     return svn_stringbuf_ncreate("-1", 2, pool);
 
 #define DISPLAY_MAYBE_NULL_CHECKSUM(checksum)          \

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/rep-cache.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/rep-cache.c?rev=1454784&r1=1454783&r2=1454784&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/rep-cache.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/rep-cache.c Sun Mar 10 04:33:30 2013
@@ -193,6 +193,7 @@ svn_fs_fs__walk_rep_reference(svn_fs_t *
 
       /* Construct a representation_t. */
       rep = apr_pcalloc(iterpool, sizeof(*rep));
+      svn_fs_fs__id_txn_reset(&rep->txn_id);
       sha1_digest = svn_sqlite__column_text(stmt, 0, iterpool);
       err = svn_checksum_parse_hex(&rep->sha1_checksum,
                                    svn_checksum_sha1, sha1_digest,
@@ -250,6 +251,7 @@ svn_fs_fs__get_rep_reference(representat
   if (have_row)
     {
       *rep = apr_pcalloc(pool, sizeof(**rep));
+      svn_fs_fs__id_txn_reset(&(*rep)->txn_id);
       (*rep)->sha1_checksum = svn_checksum_dup(checksum, pool);
       (*rep)->revision = svn_sqlite__column_revnum(stmt, 0);
       (*rep)->item_index = svn_sqlite__column_int64(stmt, 1);

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/temp_serializer.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/temp_serializer.c?rev=1454784&r1=1454783&r2=1454784&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/temp_serializer.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/temp_serializer.c Sun Mar 10 04:33:30 2013
@@ -184,8 +184,6 @@ serialize_representation(svn_temp_serial
   serialize_checksum(context, &rep->md5_checksum);
   serialize_checksum(context, &rep->sha1_checksum);
 
-  svn_temp_serializer__add_string(context, &rep->txn_id);
-
   /* return to the caller's nesting level */
   svn_temp_serializer__pop(context);
 }
@@ -207,8 +205,6 @@ deserialize_representation(void *buffer,
   /* fixup of sub-structures */
   deserialize_checksum(rep, &rep->md5_checksum);
   deserialize_checksum(rep, &rep->sha1_checksum);
-
-  svn_temp_deserializer__resolve(rep, (void **)&rep->txn_id);
 }
 
 /* auxilliary structure representing the content of a directory hash */

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c?rev=1454784&r1=1454783&r2=1454784&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c Sun Mar 10 04:33:30 2013
@@ -559,7 +559,7 @@ store_sha1_rep_mapping(svn_fs_t *fs,
     {
       apr_file_t *rep_file;
       const char *file_name = path_txn_sha1(fs,
-                                            svn_fs_fs__id_txn_id(noderev->id),
+                                            &noderev->data_rep->txn_id,
                                             noderev->data_rep->sha1_checksum,
                                             pool);
       svn_stringbuf_t *rep_string
@@ -1437,13 +1437,13 @@ svn_fs_fs__abort_txn(svn_fs_txn_t *txn,
 static svn_error_t *
 set_uniquifier(svn_fs_t *fs,
                representation_t *rep,
-               const char *txn_id,
                apr_pool_t *pool)
 {
   svn_fs_fs__id_part_t temp;
+  const char *txn_id = svn_fs_fs__id_txn_unparse(&rep->txn_id, pool);
 
   SVN_ERR(get_new_txn_node_id(&temp, fs, txn_id, pool));
-  SVN_ERR(svn_fs_fs__id_txn_parse(&rep->uniquifier.txn_id, txn_id));
+  rep->uniquifier.txn_id = rep->txn_id;
   rep->uniquifier.number = temp.number;
 
   return SVN_NO_ERROR;
@@ -1465,7 +1465,7 @@ svn_fs_fs__set_entry(svn_fs_t *fs,
   fs_fs_data_t *ffd = fs->fsap_data;
   apr_pool_t *subpool = svn_pool_create(pool);
 
-  if (!rep || !rep->txn_id)
+  if (!rep || !svn_fs_fs__id_txn_used(&rep->txn_id))
     {
       apr_hash_t *entries;
 
@@ -1485,8 +1485,8 @@ svn_fs_fs__set_entry(svn_fs_t *fs,
       /* Mark the node-rev's data rep as mutable. */
       rep = apr_pcalloc(pool, sizeof(*rep));
       rep->revision = SVN_INVALID_REVNUM;
-      rep->txn_id = txn_id;
-      SVN_ERR(set_uniquifier(fs, rep, txn_id, pool));
+      SVN_ERR(svn_fs_fs__id_txn_parse(&rep->txn_id, txn_id));
+      SVN_ERR(set_uniquifier(fs, rep, pool));
       parent_noderev->data_rep = rep;
       SVN_ERR(svn_fs_fs__put_node_revision(fs, parent_noderev->id,
                                            parent_noderev, FALSE, pool));
@@ -2027,11 +2027,11 @@ get_shared_rep(representation_t **old_re
   /* look for intra-revision matches (usually data reps but not limited
      to them in case props happen to look like some data rep)
    */
-  if (*old_rep == NULL && rep->txn_id)
+  if (*old_rep == NULL && svn_fs_fs__id_txn_used(&rep->txn_id))
     {
       svn_node_kind_t kind;
       const char *file_name
-        = path_txn_sha1(fs, rep->txn_id, rep->sha1_checksum, pool);
+        = path_txn_sha1(fs, &rep->txn_id, rep->sha1_checksum, pool);
 
       /* in our txn, is there a rep file named with the wanted SHA1?
          If so, read it and use that rep.
@@ -2080,8 +2080,9 @@ rep_write_contents_close(void *baton)
 
   /* Fill in the rest of the representation field. */
   rep->expanded_size = b->rep_size;
-  rep->txn_id = svn_fs_fs__id_txn_id(b->noderev->id);
-  SVN_ERR(set_uniquifier(b->fs, rep, rep->txn_id, b->pool));
+  SVN_ERR(svn_fs_fs__id_txn_parse(&rep->txn_id,
+                                  svn_fs_fs__id_txn_id(b->noderev->id)));
+  SVN_ERR(set_uniquifier(b->fs, rep, b->pool));
   rep->revision = SVN_INVALID_REVNUM;
 
   /* Finalize the checksum. */
@@ -2106,7 +2107,8 @@ rep_write_contents_close(void *baton)
     {
       /* Write out our cosmetic end marker. */
       SVN_ERR(svn_stream_puts(b->rep_stream, "ENDREP\n"));
-      SVN_ERR(allocate_item_index(&rep->item_index, b->fs, rep->txn_id,
+      SVN_ERR(allocate_item_index(&rep->item_index, b->fs,
+                                  svn_fs_fs__id_txn_id(b->noderev->id),
                                   b->rep_offset, b->pool));
 
       b->noderev->data_rep = rep;
@@ -2129,11 +2131,14 @@ rep_write_contents_close(void *baton)
       entry.item_index = rep->item_index;
 
       SVN_ERR(store_sha1_rep_mapping(b->fs, b->noderev, b->pool));
-      SVN_ERR(store_p2l_index_entry(b->fs, rep->txn_id, &entry, b->pool));
+      SVN_ERR(store_p2l_index_entry(b->fs,
+                                    svn_fs_fs__id_txn_id(b->noderev->id),
+                                    &entry, b->pool));
     }
 
   SVN_ERR(svn_io_file_close(b->file, b->pool));
-  SVN_ERR(unlock_proto_rev(b->fs, rep->txn_id, b->lockcookie, b->pool));
+  SVN_ERR(unlock_proto_rev(b->fs, svn_fs_fs__id_txn_id(b->noderev->id),
+                           b->lockcookie, b->pool));
   svn_pool_destroy(b->pool);
 
   return SVN_NO_ERROR;
@@ -2152,7 +2157,7 @@ set_representation(svn_stream_t **conten
 {
   struct rep_write_baton *wb;
 
-  if (! svn_fs_fs__id_txn_id(noderev->id))
+  if (! svn_fs_fs__id_is_txn(noderev->id))
     return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
                              _("Attempted to write to non-transaction '%s'"),
                              svn_fs_fs__id_unparse(noderev->id, pool)->data);
@@ -2231,11 +2236,14 @@ svn_fs_fs__set_proplist(svn_fs_t *fs,
   SVN_ERR(svn_io_file_close(file, pool));
 
   /* Mark the node-rev's prop rep as mutable, if not already done. */
-  if (!noderev->prop_rep || !noderev->prop_rep->txn_id)
+  if (!noderev->prop_rep
+      || !svn_fs_fs__id_txn_used(&noderev->prop_rep->txn_id))
     {
       noderev->prop_rep = apr_pcalloc(pool, sizeof(*noderev->prop_rep));
-      noderev->prop_rep->txn_id = svn_fs_fs__id_txn_id(noderev->id);
-      SVN_ERR(svn_fs_fs__put_node_revision(fs, noderev->id, noderev, FALSE, pool));
+      SVN_ERR(svn_fs_fs__id_txn_parse(&noderev->prop_rep->txn_id,
+                                      svn_fs_fs__id_txn_id(noderev->id)));
+      SVN_ERR(svn_fs_fs__put_node_revision(fs, noderev->id, noderev, FALSE,
+                                           pool));
     }
 
   return SVN_NO_ERROR;
@@ -2688,7 +2696,8 @@ write_final_rev(const svn_fs_id_t **new_
         }
       svn_pool_destroy(subpool);
 
-      if (noderev->data_rep && noderev->data_rep->txn_id)
+      if (noderev->data_rep
+          && svn_fs_fs__id_txn_used(&noderev->data_rep->txn_id))
         {
           /* Write out the contents of this directory as a text rep. */
           SVN_ERR(unparse_dir_entries(&str_entries, entries, pool));
@@ -2704,7 +2713,7 @@ write_final_rev(const svn_fs_id_t **new_
                                    fs, txn_id, NULL,
                                    SVN_FS_FS__ITEM_TYPE_DIR_REP, pool));
 
-          noderev->data_rep->txn_id = NULL;
+          svn_fs_fs__id_txn_reset(&noderev->data_rep->txn_id);
         }
     }
   else
@@ -2713,9 +2722,10 @@ write_final_rev(const svn_fs_id_t **new_
          exists in a "this" state, gets rewritten to our new revision
          num. */
 
-      if (noderev->data_rep && noderev->data_rep->txn_id)
+      if (noderev->data_rep
+          && svn_fs_fs__id_txn_used(&noderev->data_rep->txn_id))
         {
-          noderev->data_rep->txn_id = NULL;
+          svn_fs_fs__id_txn_reset(&noderev->data_rep->txn_id);
           noderev->data_rep->revision = rev;
 
           if (ffd->format < SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
@@ -2732,7 +2742,8 @@ write_final_rev(const svn_fs_id_t **new_
     }
 
   /* Fix up the property reps. */
-  if (noderev->prop_rep && noderev->prop_rep->txn_id)
+  if (noderev->prop_rep
+      && svn_fs_fs__id_txn_used(&noderev->prop_rep->txn_id))
     {
       apr_hash_t *proplist;
       int item_type = noderev->kind == svn_node_dir
@@ -2740,7 +2751,7 @@ write_final_rev(const svn_fs_id_t **new_
                     : SVN_FS_FS__ITEM_TYPE_FILE_PROPS;
       SVN_ERR(svn_fs_fs__get_proplist(&proplist, fs, noderev, pool));
 
-      noderev->prop_rep->txn_id = NULL;
+      svn_fs_fs__id_txn_reset(&noderev->prop_rep->txn_id);
       noderev->prop_rep->revision = rev;
 
       if (ffd->deltify_properties)
@@ -3378,12 +3389,14 @@ svn_fs_fs__delete_node_revision(svn_fs_t
   SVN_ERR(svn_fs_fs__get_node_revision(&noderev, fs, id, pool));
 
   /* Delete any mutable property representation. */
-  if (noderev->prop_rep && noderev->prop_rep->txn_id)
+  if (noderev->prop_rep
+      && svn_fs_fs__id_txn_used(&noderev->prop_rep->txn_id))
     SVN_ERR(svn_io_remove_file2(path_txn_node_props(fs, id, pool), FALSE,
                                 pool));
 
   /* Delete any mutable data representation. */
-  if (noderev->data_rep && noderev->data_rep->txn_id
+  if (noderev->data_rep
+      && svn_fs_fs__id_txn_used(&noderev->data_rep->txn_id)
       && noderev->kind == svn_node_dir)
     {
       fs_fs_data_t *ffd = fs->fsap_data;

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/util.c?rev=1454784&r1=1454783&r2=1454784&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/util.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/util.c Sun Mar 10 04:33:30 2013
@@ -245,10 +245,13 @@ path_txn_dir(svn_fs_t *fs, const char *t
  * within FS for the given SHA1 checksum.  Use POOL for allocations.
  */
 const char *
-path_txn_sha1(svn_fs_t *fs, const char *txn_id, svn_checksum_t *sha1,
+path_txn_sha1(svn_fs_t *fs,
+              const svn_fs_fs__id_part_t *txn_id,
+              svn_checksum_t *sha1,
               apr_pool_t *pool)
 {
-  return svn_dirent_join(path_txn_dir(fs, txn_id, pool),
+  const char *txn_id_str = svn_fs_fs__id_txn_unparse(txn_id, pool);
+  return svn_dirent_join(path_txn_dir(fs, txn_id_str, pool),
                          svn_checksum_to_cstring(sha1, pool),
                          pool);
 }

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/util.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/util.h?rev=1454784&r1=1454783&r2=1454784&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/util.h (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/util.h Sun Mar 10 04:33:30 2013
@@ -153,7 +153,7 @@ path_txn_dir(svn_fs_t *fs,
  */
 const char *
 path_txn_sha1(svn_fs_t *fs,
-              const char *txn_id,
+              const svn_fs_fs__id_part_t *txn_id,
               svn_checksum_t *sha1,
               apr_pool_t *pool);