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 2016/01/30 16:23:09 UTC

svn commit: r1727711 - in /subversion/trunk/subversion/libsvn_fs_x: changes.c low_level.c transaction.c

Author: stefan2
Date: Sat Jan 30 15:23:09 2016
New Revision: 1727711

URL: http://svn.apache.org/viewvc?rev=1727711&view=rev
Log:
In FSX, remove all code that reads and writes noderev IDs in changed
path lists.

* subversion/libsvn_fs_x/changes.c
  (CHANGE_TXN_NODE): No longer needed.
  (binary_change_t): Remove noderev ID element.
  (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 noderev ID access for
                                     containered changed paths lists.

* subversion/libsvn_fs_x/low_level.c
  (read_change,
   write_change_entry): No longer read and write noderev IDs when
                        reading / writing non-packed changes lists.

* subversion/libsvn_fs_x/transaction.c
  (fold_change): The noderev ID is now meaningless here.
  (svn_fs_x__add_change): Don't store the noderev ID anymore.
  (write_final_rev): No longer update the noderev in changed paths lists.
  (sanitize_changed_path_info): No longer neccessary.
  (commit_body): Update caller.

Modified:
    subversion/trunk/subversion/libsvn_fs_x/changes.c
    subversion/trunk/subversion/libsvn_fs_x/low_level.c
    subversion/trunk/subversion/libsvn_fs_x/transaction.c

Modified: subversion/trunk/subversion/libsvn_fs_x/changes.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/changes.c?rev=1727711&r1=1727710&r2=1727711&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/changes.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/changes.c Sat Jan 30 15:23:09 2016
@@ -37,9 +37,6 @@
 /* the change contains a property modification */
 #define CHANGE_PROP_MOD     0x00002
 
-/* the last part (rev_id) of node revision ID is a transaction ID */
-#define CHANGE_TXN_NODE     0x00004
-
 /* (flags & CHANGE_NODE_MASK) >> CHANGE_NODE_SHIFT extracts the node type */
 #define CHANGE_NODE_SHIFT   0x00003
 #define CHANGE_NODE_MASK    0x00018
@@ -77,10 +74,6 @@ typedef struct binary_change_t
   svn_revnum_t copyfrom_rev;
   apr_size_t copyfrom_path;
 
-  /* Relevant parts of the node revision ID of the change.
-   * Empty, if REV_ID is not "used". */
-  svn_fs_x__id_t noderev_id;
-
 } binary_change_t;
 
 /* The actual container object.  Change lists are concatenated into CHANGES
@@ -138,20 +131,14 @@ append_change(svn_fs_x__changes_t *chang
               svn_fs_x__change_t *change)
 {
   binary_change_t binary_change = { 0 };
-  svn_boolean_t is_txn_id;
 
   /* CHANGE must be sufficiently complete */
   SVN_ERR_ASSERT(change);
   SVN_ERR_ASSERT(change->path.data);
 
-  /* Relevant parts of the revision ID of the change. */
-  binary_change.noderev_id = change->noderev_id;
-
   /* define the kind of change and what specific information is present */
-  is_txn_id = svn_fs_x__is_txn(binary_change.noderev_id.change_set);
   binary_change.flags = (change->text_mod ? CHANGE_TEXT_MOD : 0)
                       | (change->prop_mod ? CHANGE_PROP_MOD : 0)
-                      | (is_txn_id ? CHANGE_TXN_NODE : 0)
                       | ((int)change->change_kind << CHANGE_KIND_SHIFT)
                       | ((int)change->node_kind << CHANGE_NODE_SHIFT);
 
@@ -260,9 +247,6 @@ svn_fs_x__changes_get_list(apr_array_hea
                                                      &change->path.len,
                                                      result_pool);
 
-      if (binary_change->noderev_id.change_set != SVN_FS_X__INVALID_CHANGE_SET)
-        change->noderev_id = binary_change->noderev_id;
-
       change->change_kind = (svn_fs_path_change_kind_t)
         ((binary_change->flags & CHANGE_KIND_MASK) >> CHANGE_KIND_SHIFT);
       change->text_mod = (binary_change->flags & CHANGE_TEXT_MOD) != 0;
@@ -312,8 +296,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)
@@ -331,9 +313,6 @@ svn_fs_x__write_changes_container(svn_st
 
       svn_packed__add_int(changes_stream, change->copyfrom_rev);
       svn_packed__add_uint(changes_stream, change->copyfrom_path);
-
-      svn_packed__add_int(changes_stream, change->noderev_id.change_set);
-      svn_packed__add_uint(changes_stream, change->noderev_id.number);
     }
 
   /* write to disk */
@@ -388,9 +367,6 @@ svn_fs_x__read_changes_container(svn_fs_
       change.copyfrom_rev = (svn_revnum_t)svn_packed__get_int(changes_stream);
       change.copyfrom_path = (apr_size_t)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);
-
       APR_ARRAY_PUSH(changes->changes, binary_change_t) = change;
     }
 
@@ -509,8 +485,6 @@ svn_fs_x__changes_get_list_func(void **o
         = svn_fs_x__string_table_get_func(paths, binary_change->path,
                                           &change->path.len, pool);
 
-      change->noderev_id = binary_change->noderev_id;
-
       change->change_kind = (svn_fs_path_change_kind_t)
         ((binary_change->flags & CHANGE_KIND_MASK) >> CHANGE_KIND_SHIFT);
       change->text_mod = (binary_change->flags & CHANGE_TEXT_MOD) != 0;

Modified: subversion/trunk/subversion/libsvn_fs_x/low_level.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/low_level.c?rev=1727711&r1=1727710&r2=1727711&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/low_level.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/low_level.c Sat Jan 30 15:23:09 2016
@@ -829,14 +829,6 @@ read_change(svn_fs_x__change_t **change_
   change = apr_pcalloc(result_pool, sizeof(*change));
   last_str = line->data;
 
-  /* Get the node-id of the change. */
-  str = svn_cstring_tokenize(" ", &last_str);
-  if (str == NULL)
-    return svn_error_create(SVN_ERR_FS_CORRUPT, NULL,
-                            _("Invalid changes line in rev-file"));
-
-  SVN_ERR(svn_fs_x__id_parse(&change->noderev_id, str));
-
   /* Get the change type. */
   str = svn_cstring_tokenize(" ", &last_str);
   if (str == NULL)
@@ -1044,7 +1036,6 @@ write_change_entry(svn_stream_t *stream,
                    svn_fs_x__change_t *change,
                    apr_pool_t *scratch_pool)
 {
-  const char *idstr;
   const char *change_string = NULL;
   const char *kind_string = "";
   svn_stringbuf_t *buf;
@@ -1070,8 +1061,6 @@ write_change_entry(svn_stream_t *stream,
                                change->change_kind);
     }
 
-  idstr = svn_fs_x__id_unparse(&change->noderev_id, scratch_pool)->data;
-
   SVN_ERR_ASSERT(change->node_kind == svn_node_dir
                  || change->node_kind == svn_node_file);
   kind_string = apr_psprintf(scratch_pool, "-%s",
@@ -1079,8 +1068,8 @@ write_change_entry(svn_stream_t *stream,
                              ? SVN_FS_X__KIND_DIR
                              : SVN_FS_X__KIND_FILE);
 
-  buf = svn_stringbuf_createf(scratch_pool, "%s %s%s %s %s %s %s\n",
-                              idstr, change_string, kind_string,
+  buf = svn_stringbuf_createf(scratch_pool, "%s%s %s %s %s %s\n",
+                              change_string, kind_string,
                               change->text_mod ? FLAG_TRUE : FLAG_FALSE,
                               change->prop_mod ? FLAG_TRUE : FLAG_FALSE,
                               change->mergeinfo_mod == svn_tristate_true

Modified: subversion/trunk/subversion/libsvn_fs_x/transaction.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/transaction.c?rev=1727711&r1=1727710&r2=1727711&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/transaction.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/transaction.c Sat Jan 30 15:23:09 2016
@@ -974,16 +974,6 @@ fold_change(apr_hash_t *changed_paths,
       /* This path already exists in the hash, so we have to merge
          this change into the already existing one. */
 
-      /* Sanity check: we should be talking about the same node
-         revision ID as our last change except where the last change
-         was a deletion. */
-      if (!svn_fs_x__id_eq(&old_change->noderev_id, &change->noderev_id)
-          && (old_change->change_kind != svn_fs_path_change_delete))
-        return svn_error_create
-          (SVN_ERR_FS_CORRUPT, NULL,
-           _("Invalid change ordering: new node revision ID "
-             "without delete"));
-
       /* Sanity check: an add, replacement, or reset must be the first
          thing to follow a deletion. */
       if ((old_change->change_kind == svn_fs_path_change_delete)
@@ -1965,7 +1955,6 @@ svn_fs_x__add_change(svn_fs_t *fs,
 
   change.path.data = path;
   change.path.len = strlen(path);
-  change.noderev_id = *id;
   change.change_kind = change_kind;
   change.text_mod = text_mod;
   change.prop_mod = prop_mod;
@@ -3042,7 +3031,6 @@ write_final_rev(svn_fs_x__id_t *new_id_p
   svn_fs_x__change_set_t change_set = svn_fs_x__change_set_by_rev(rev);
   svn_stream_t *file_stream;
   apr_pool_t *subpool;
-  svn_fs_x__change_t *change;
 
   /* Check to see if this is a transaction node. */
   if (txn_id == SVN_FS_X__INVALID_TXN_ID)
@@ -3220,38 +3208,12 @@ write_final_rev(svn_fs_x__id_t *new_id_p
 
   SVN_ERR(store_p2l_index_entry(fs, txn_id, &entry, scratch_pool));
 
-  /* Update the ID within the changed paths list. */
-  change = svn_hash_gets(changed_paths, noderev->created_path);
-  if (change)
-    change->noderev_id = noderev->noderev_id;
-
   /* Return our ID that references the revision file. */
   *new_id_p = new_id;
 
   return SVN_NO_ERROR;
 }
 
-/* Reset all in-transaction noderev-IDs in CHANGED_PATHS.  They should
-   belong to deleted nodes only.  At any rate, these IDs become invalid
-   as soon as transaction got committed.
-   Perform temporary allocations in SCRATCH_POOL. */
-static svn_error_t *
-sanitize_changed_path_info(apr_hash_t *changed_paths,
-                           apr_pool_t *scratch_pool)
-{
-  apr_hash_index_t *hi;
-  for (hi = apr_hash_first(scratch_pool, changed_paths);
-       hi;
-       hi = apr_hash_next(hi))
-    {
-      svn_fs_x__change_t *change = apr_hash_this_val(hi);
-      if (svn_fs_x__is_txn(change->noderev_id.change_set))
-        svn_fs_x__id_reset(&change->noderev_id);
-    }
-
-  return SVN_NO_ERROR;
-}
-
 /* Write the changed path info CHANGED_PATHS from transaction TXN_ID to the
    permanent rev-file FILE representing NEW_REV in filesystem FS.  *OFFSET_P
    is set the to offset in the file of the beginning of this information.
@@ -3793,7 +3755,6 @@ commit_body(void *baton,
   svn_pool_clear(subpool);
 
   /* Write the changed-path information. */
-  SVN_ERR(sanitize_changed_path_info(changed_paths, subpool));
   SVN_ERR(write_final_changed_path_info(&changed_path_offset, proto_file,
                                         cb->fs, txn_id, changed_paths,
                                         new_rev, subpool));