Daniel Berlin wrote:
>On Thu, 2005-10-20 at 13:15 -0400, Daniel Berlin wrote:
>>Actually, i think i can teach it to not create the props file if the
>>hash is empty, which works on all versions (they stat the path first,
>>and treat non-existence as emptyness).
>>That works fine for my porpoises.
>Yup, the attached actually works.
>This is fully backwards compatible with 1.2.x due to how hash_read
>Again, i'd badly like this change in 1.3.x.
>(In 1.4, we probably want to not create the file at all. It turns out
>not everything uses empty_props_p, however, so this actually introduces
>For the curious, gcc's checkout has 30k files in it
>each 4 byte file was taking 1 disk block of 4096 bytes.
>30k * 4k = 120 meg
>multiply by 2 (one props, one props-base), and you get 240 meg.
>This also stops useless I/O when a file has no properties set, as a
>I've applied this to the trunk in the meanwhile.
>Don't write empty hashes to the props file, it just wastes space.
>* subversion/libsvn_wc/props.c (svn_wc__save_prop_file): Check hash
>count before writing to file.
>(empty_props_p): finfo.size == 0 is empty too.
Aieee, bad indentatin in log message!
>--- subversion/libsvn_wc/props.c (revision 16853)
>+++ subversion/libsvn_wc/props.c (working copy)
>@@ -187,16 +187,18 @@
> apr_pool_t *pool)
> apr_file_t *prop_tmp;
Aargh, extraneous new line with two trailing spaces!
> SVN_ERR (svn_io_file_open (&prop_tmp, propfile_path,
> (APR_WRITE | APR_CREATE | APR_TRUNCATE
> | APR_BUFFERED),
> APR_OS_DEFAULT, pool));
>- SVN_ERR_W (svn_hash_write (hash, prop_tmp, pool),
>- apr_psprintf (pool,
>- _("Can't write property hash to '%s'"),
>- svn_path_local_style (propfile_path, pool)));
>+ if (apr_hash_count (hash) != 0)
>+ SVN_ERR_W (svn_hash_write (hash, prop_tmp, pool),
>+ apr_psprintf (pool,
>+ _("Can't write property hash to '%s'"),
>+ svn_path_local_style (propfile_path, pool)));
> SVN_ERR (svn_io_file_close (prop_tmp, pool));
>@@ -1729,7 +1731,7 @@
> /* If we remove props from a propfile, eventually the file will
> contain nothing but "END\n" */
>- if (finfo.filetype == APR_REG && finfo.size == 4)
>+ if (finfo.filetype == APR_REG && (finfo.size == 4 || finfo.size == 0))
> *empty_p = TRUE;
Disregarding my deep and relevant comments above, if this truly doesn't
cause an incompatibility and/or doesn't require a WC version update,
then please commit and add my +1 to the backport entry in the 1.3.x
To unsubscribe, e-mail: firstname.lastname@example.org
For additional commands, e-mail: email@example.com
Received on Thu Oct 20 20:52:00 2005