Index: subversion/libsvn_fs_fs/fs_fs.c =================================================================== --- subversion/libsvn_fs_fs/fs_fs.c (revision 1607884) +++ subversion/libsvn_fs_fs/fs_fs.c (working copy) @@ -1481,12 +1481,10 @@ { apr_array_header_t *index_entries; svn_fs_fs__p2l_entry_t *entry; - svn_fs_fs__revision_file_t *rev_file; const char *l2p_proto_index, *p2l_proto_index; - - /* Write a skeleton r0 with no indexes. */ - SVN_ERR(svn_io_file_create(path_revision_zero, - "PLAIN\nEND\nENDREP\n" + apr_file_t *file; + const char *content = + "PLAIN\nEND\nENDREP\n" "id: 0.0.r0/2\n" "type: dir\n" "count: 0\n" @@ -1493,8 +1491,15 @@ "text: 0 3 4 4 " "2d2977d1c96f487abe4a1e202dd03b4e\n" "cpath: /\n" - "\n\n", subpool)); + "\n\n"; + /* Write a skeleton r0 with no indexes. */ + SVN_ERR(svn_io_file_open(&file, path_revision_zero, + APR_WRITE | APR_READ | APR_CREATE | APR_EXCL, + APR_OS_DEFAULT, + subpool)); + SVN_ERR(svn_io_file_write_full(file, content, strlen(content), NULL, subpool)); + /* Construct the index P2L contents: describe the 3 items we have. Be sure to create them in on-disk order. */ index_entries = apr_array_make(subpool, 3, sizeof(entry)); @@ -1525,17 +1530,15 @@ /* Now re-open r0, create proto-index files from our entries and rewrite the index section of r0. */ - SVN_ERR(svn_fs_fs__open_pack_or_rev_file_writable(&rev_file, fs, 0, - subpool, subpool)); SVN_ERR(svn_fs_fs__p2l_index_from_p2l_entries(&p2l_proto_index, fs, - rev_file, index_entries, + file, index_entries, subpool, subpool)); SVN_ERR(svn_fs_fs__l2p_index_from_p2l_entries(&l2p_proto_index, fs, index_entries, subpool, subpool)); - SVN_ERR(svn_fs_fs__add_index_data(fs, rev_file->file, l2p_proto_index, + SVN_ERR(svn_fs_fs__add_index_data(fs, file, l2p_proto_index, p2l_proto_index, 0, subpool)); - SVN_ERR(svn_fs_fs__close_revision_file(rev_file)); + SVN_ERR(svn_io_file_close(file, subpool)); } else SVN_ERR(svn_io_file_create(path_revision_zero, Index: subversion/libsvn_fs_fs/index.c =================================================================== --- subversion/libsvn_fs_fs/index.c (revision 1607884) +++ subversion/libsvn_fs_fs/index.c (working copy) @@ -2627,7 +2627,7 @@ * allocations. */ static svn_error_t * calc_fnv1(svn_fs_fs__p2l_entry_t *entry, - svn_fs_fs__revision_file_t *rev_file, + apr_file_t *rev_file, apr_pool_t *pool) { unsigned char buffer[4096]; @@ -2646,13 +2646,13 @@ } /* Read the block and feed it to the checksum calculator. */ - SVN_ERR(svn_io_file_seek(rev_file->file, APR_SET, &entry->offset, pool)); + SVN_ERR(svn_io_file_seek(rev_file, APR_SET, &entry->offset, pool)); while (size > 0) { apr_size_t to_read = size > sizeof(buffer) ? sizeof(buffer) : (apr_size_t)size; - SVN_ERR(svn_io_file_read_full2(rev_file->file, buffer, to_read, NULL, + SVN_ERR(svn_io_file_read_full2(rev_file, buffer, to_read, NULL, NULL, pool)); SVN_ERR(svn_checksum_update(context, buffer, to_read)); size -= to_read; @@ -2672,7 +2672,7 @@ svn_error_t * svn_fs_fs__p2l_index_from_p2l_entries(const char **protoname, svn_fs_t *fs, - svn_fs_fs__revision_file_t *rev_file, + apr_file_t *rev_file, apr_array_header_t *entries, apr_pool_t *result_pool, apr_pool_t *scratch_pool) Index: subversion/libsvn_fs_fs/index.h =================================================================== --- subversion/libsvn_fs_fs/index.h (revision 1607884) +++ subversion/libsvn_fs_fs/index.h (working copy) @@ -259,7 +259,7 @@ svn_error_t * svn_fs_fs__p2l_index_from_p2l_entries(const char **protoname, svn_fs_t *fs, - svn_fs_fs__revision_file_t *rev_file, + apr_file_t *rev_file, apr_array_header_t *entries, apr_pool_t *result_pool, apr_pool_t *scratch_pool);