subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1463122 - in /subversion/branches/fsfs-format7/subversion/libsvn_fs_fs: changes.c changes.h
Date Mon, 01 Apr 2013 11:29:01 GMT
Author: stefan2
Date: Mon Apr  1 11:29:01 2013
New Revision: 1463122

URL: http://svn.apache.org/r1463122
Log:
On the fsfs-format7 branch:  Drop the svn_fs_fs__changes_finalize
function as it only complicates the API.  Let
svn_fs_fs__write_changes_container() automatically determine where
to get a finalized path table from.

* subversion/libsvn_fs_fs/changes.h
  (svn_fs_fs__changes_finalize): drop

* subversion/libsvn_fs_fs/changes.c
  (svn_fs_fs__changes_finalize): drop
  (svn_fs_fs__write_changes_container): finialize path table locally

Modified:
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/changes.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/changes.h

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/changes.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/changes.c?rev=1463122&r1=1463121&r2=1463122&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/changes.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/changes.c Mon Apr  1 11:29:01
2013
@@ -241,23 +241,6 @@ svn_fs_fs__changes_estimate_size(const s
 }
 
 svn_error_t *
-svn_fs_fs__changes_finalize(svn_fs_fs__changes_t *changes)
-{
-  /* CHANGES must be in 'builder' mode */
-  SVN_ERR_ASSERT(changes->builder);
-  SVN_ERR_ASSERT(changes->paths == NULL);
-
-  /* finalize paths string table */
-  changes->paths = svn_fs_fs__string_table_create(changes->builder,
-                                                  changes->offsets->pool);
-
-  /* we are no longer in 'builder' mode */
-  changes->builder = NULL;
-
-  return SVN_NO_ERROR;
-}
-
-svn_error_t *
 svn_fs_fs__changes_get_list(apr_array_header_t **list,
                             const svn_fs_fs__changes_t *changes,
                             apr_size_t idx,
@@ -335,6 +318,11 @@ svn_fs_fs__write_changes_container(svn_s
 {
   int i;
 
+  string_table_t *paths = changes->paths
+                        ? changes->paths
+                        : svn_fs_fs__string_table_create(changes->builder,
+                                                         pool);
+
   svn_packed__data_root_t *root = svn_packed__data_create_root(pool);
 
   /* one top-level stream for each array */
@@ -356,10 +344,6 @@ svn_fs_fs__write_changes_container(svn_s
   svn_packed__create_int_substream(changes_stream, TRUE, TRUE);
   svn_packed__create_int_substream(changes_stream, TRUE, FALSE);
   
-  /* CHANGES must be in 'finalized' mode */
-  SVN_ERR_ASSERT(changes->builder == NULL);
-  SVN_ERR_ASSERT(changes->paths);
-
   /* serialize offsets array */
   for (i = 0; i < changes->offsets->nelts; ++i)
     svn_packed__add_uint(offsets_stream,
@@ -386,7 +370,7 @@ svn_fs_fs__write_changes_container(svn_s
     }
 
   /* write to disk */
-  SVN_ERR(svn_fs_fs__write_string_table(stream, changes->paths, pool));
+  SVN_ERR(svn_fs_fs__write_string_table(stream, paths, pool));
   SVN_ERR(svn_packed__data_write(stream, root, pool));
   
   return SVN_NO_ERROR;

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/changes.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/changes.h?rev=1463122&r1=1463121&r2=1463122&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/changes.h (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/changes.h Mon Apr  1 11:29:01
2013
@@ -79,12 +79,6 @@ svn_fs_fs__changes_append_list(apr_size_
 apr_size_t
 svn_fs_fs__changes_estimate_size(const svn_fs_fs__changes_t *changes);
 
-/* Convert CHANGES from its writable internal representation to its final
- * memory-friendly r/o representation.
- */
-svn_error_t *
-svn_fs_fs__changes_finalize(svn_fs_fs__changes_t *changes);
-
 /* Read changes containers. */
 
 /* From CHANGES, extract the change list with the given INDEX.  Allocate



Mime
View raw message