You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2015/01/06 16:02:36 UTC

svn commit: r1649817 - in /subversion/trunk: CHANGES subversion/include/svn_io.h subversion/libsvn_subr/io.c subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c

Author: julianfoad
Date: Tue Jan  6 15:02:35 2015
New Revision: 1649817

URL: http://svn.apache.org/r1649817
Log:
Rename 'svn_io_file_create_binary' to 'svn_io_file_create_bytes' and accept
a pointer to anything for the contents.

The former name sounded too much like it was processing the contents in
binary mode. The API is as yet unreleased so can simply be changed.

* CHANGES
  Update the mention of it.

* subversion/include/svn_io.h,
  subversion/libsvn_subr/io.c
  (svn_io_file_create_binary): Rename to svn_io_file_create_bytes. Change
    the 'contents' parameter from 'const char *' to 'const void *'. Don't
    describe the contents as 'binary' in the doc string.
  (svn_io_file_create,
   svn_io_file_create_empty): Track the rename.

* subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c
  (metadata_checksumming): Track the rename.

Modified:
    subversion/trunk/CHANGES
    subversion/trunk/subversion/include/svn_io.h
    subversion/trunk/subversion/libsvn_subr/io.c
    subversion/trunk/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c

Modified: subversion/trunk/CHANGES
URL: http://svn.apache.org/viewvc/subversion/trunk/CHANGES?rev=1649817&r1=1649816&r2=1649817&view=diff
==============================================================================
--- subversion/trunk/CHANGES (original)
+++ subversion/trunk/CHANGES Tue Jan  6 15:02:35 2015
@@ -315,7 +315,7 @@ http://svn.apache.org/repos/asf/subversi
     * New api svn_io_file_aligned_seek() (r1502539)
     * ra_svn: fix svn_ra_get_log*() to apply limit when server can't (r1503043)
     * svn_client_commit6: notify which path prevents a mv commit (r1503662)
-    * New apis svn_io_file_create_empty() and svn_io_file_create_binary()
+    * New apis svn_io_file_create_empty() and svn_io_file_create_bytes()
       (r1505006)
     * New api svn_ver_check_list2() (r1502267)
     * svn_fs_paths_changed() gains support for moves (r1525448)

Modified: subversion/trunk/subversion/include/svn_io.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_io.h?rev=1649817&r1=1649816&r2=1649817&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_io.h (original)
+++ subversion/trunk/subversion/include/svn_io.h Tue Jan  6 15:02:35 2015
@@ -691,17 +691,17 @@ svn_io_file_create(const char *file,
                    const char *contents,
                    apr_pool_t *pool);
 
-/** Create file at utf8-encoded @a file with binary contents @a contents
+/** Create file at utf8-encoded @a file with contents @a contents
  * of @a length bytes.  @a file must not already exist.
  * Use @a pool for memory allocations.
  *
  * @since New in 1.9.
  */
 svn_error_t *
-svn_io_file_create_binary(const char *file,
-                          const char *contents,
-                          apr_size_t length,
-                          apr_pool_t *pool);
+svn_io_file_create_bytes(const char *file,
+                         const void *contents,
+                         apr_size_t length,
+                         apr_pool_t *pool);
 
 /** Create empty file at utf8-encoded @a file, which must not already exist.
  * Use @a pool for memory allocations.

Modified: subversion/trunk/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/io.c?rev=1649817&r1=1649816&r2=1649817&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/io.c (original)
+++ subversion/trunk/subversion/libsvn_subr/io.c Tue Jan  6 15:02:35 2015
@@ -1170,10 +1170,10 @@ svn_io_make_dir_recursively(const char *
 }
 
 svn_error_t *
-svn_io_file_create_binary(const char *file,
-                          const char *contents,
-                          apr_size_t length,
-                          apr_pool_t *pool)
+svn_io_file_create_bytes(const char *file,
+                         const void *contents,
+                         apr_size_t length,
+                         apr_pool_t *pool)
 {
   apr_file_t *f;
   apr_size_t written;
@@ -1209,18 +1209,17 @@ svn_io_file_create(const char *file,
                    const char *contents,
                    apr_pool_t *pool)
 {
-  return svn_error_trace(svn_io_file_create_binary(file, contents,
-                                                   contents
-                                                        ? strlen(contents)
-                                                        : 0,
-                                                   pool));
+  return svn_error_trace(svn_io_file_create_bytes(file, contents,
+                                                  contents ? strlen(contents)
+                                                           : 0,
+                                                  pool));
 }
 
 svn_error_t *
 svn_io_file_create_empty(const char *file,
                          apr_pool_t *pool)
 {
-  return svn_error_trace(svn_io_file_create_binary(file, "", 0, pool));
+  return svn_error_trace(svn_io_file_create_bytes(file, NULL, 0, pool));
 }
 
 svn_error_t *

Modified: subversion/trunk/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c?rev=1649817&r1=1649816&r2=1649817&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c Tue Jan  6 15:02:35 2015
@@ -1079,7 +1079,7 @@ metadata_checksumming(const svn_test_opt
   SVN_ERR(svn_stringbuf_from_file2(&r0, r0_path, pool));
   r0->data[21] = '1';
   SVN_ERR(svn_io_remove_file2(r0_path, FALSE, pool));
-  SVN_ERR(svn_io_file_create_binary(r0_path, r0->data, r0->len, pool));
+  SVN_ERR(svn_io_file_create_bytes(r0_path, r0->data, r0->len, pool));
 
   /* Reading the corrupted data on the normal code path triggers no error.
    * Use a separate namespace to avoid simply reading data from cache. */