David Glasser wrote:
> On Thu, Nov 27, 2008 at 4:13 PM, <hwright_at_tigris.org> wrote:
>> Author: hwright
>> Date: Thu Nov 27 13:13:00 2008
>> New Revision: 34449
>>
>> Log:
>> A bit of tryptophan-induced hacking: Use a string buf when writing the FSFS
>> format file, to enable easy addition of additional options in that file.
>>
>> * subversion/libsvn_fs_fs/fs_fs.c
>> (write_format): Simplify format file content generation.
>>
>> Modified:
>> trunk/subversion/libsvn_fs_fs/fs_fs.c
>>
>> Modified: trunk/subversion/libsvn_fs_fs/fs_fs.c
>> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_fs_fs/fs_fs.c?pathrev=34449&r1=34448&r2=34449
>> ==============================================================================
>> --- trunk/subversion/libsvn_fs_fs/fs_fs.c Thu Nov 27 01:53:55 2008 (r34448)
>> +++ trunk/subversion/libsvn_fs_fs/fs_fs.c Thu Nov 27 13:13:00 2008 (r34449)
>> @@ -898,34 +898,31 @@ static svn_error_t *
>> write_format(const char *path, int format, int max_files_per_dir,
>> svn_boolean_t overwrite, apr_pool_t *pool)
>> {
>> - const char *contents;
>> + svn_stringbuf_t *sb;
>> + svn_string_t *contents;
>>
>> SVN_ERR_ASSERT(1 <= format && format <= SVN_FS_FS__FORMAT_NUMBER);
>> +
>> + sb = svn_stringbuf_create(apr_psprintf(pool, "%d\n", format), pool);
>> +
>> if (format >= SVN_FS_FS__MIN_LAYOUT_FORMAT_OPTION_FORMAT)
>> {
>> if (max_files_per_dir)
>> - contents = apr_psprintf(pool,
>> - "%d\n"
>> - "layout sharded %d\n",
>> - format, max_files_per_dir);
>> + svn_stringbuf_appendcstr(sb, apr_psprintf(pool, "layout sharded %d\n",
>> + max_files_per_dir));
>> else
>> - contents = apr_psprintf(pool,
>> - "%d\n"
>> - "layout linear",
>> - format);
>> - }
>> - else
>> - {
>> - contents = apr_psprintf(pool, "%d\n", format);
>> + svn_stringbuf_appendcstr(sb, "layout linear");
>
> Not a regression, but there should probably be a newline here.
r34466.
-Hyrum
Received on 2008-11-28 23:10:51 CET