[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r33682 - branches/fsfs-pack/subversion/libsvn_fs_fs

From: Hyrum K. Wright <hyrum_wright_at_mail.utexas.edu>
Date: Thu, 16 Oct 2008 11:21:01 +0200

Greg Stein wrote:
> Reading the commit log, I understand what you're doing, but if I were
> to just read the code... it is unclear why you delete the pack file.
> I'd suggest adding a comment rather than relying on people looking up
> log messages...

Yeah, the code is decidedly lacking in comments (including the functions
themselves). The patch I'm currently working on hopefully adds enough comments
to make things a bit more understandable.

-Hyrum

> On Wed, Oct 15, 2008 at 5:30 PM, <hwright_at_tigris.org> wrote:
>> Author: hwright
>> Date: Wed Oct 15 17:30:50 2008
>> New Revision: 33682
>>
>> Log:
>> On the fsfs-pack branch:
>> Do a little bit of consistency checking before proceeding with packing.
>>
>> * subversion/libsvn_fs_fs/fs_fs.c
>> (pack_shard): If both the packed shard and the old shard exist, assume the
>> packed_shard wasn't completed, and just delete it.
>>
>> Modified:
>> branches/fsfs-pack/subversion/libsvn_fs_fs/fs_fs.c
>>
>> Modified: branches/fsfs-pack/subversion/libsvn_fs_fs/fs_fs.c
>> URL: http://svn.collab.net/viewvc/svn/branches/fsfs-pack/subversion/libsvn_fs_fs/fs_fs.c?pathrev=33682&r1=33681&r2=33682
>> ==============================================================================
>> --- branches/fsfs-pack/subversion/libsvn_fs_fs/fs_fs.c Wed Oct 15 16:43:58 2008 (r33681)
>> +++ branches/fsfs-pack/subversion/libsvn_fs_fs/fs_fs.c Wed Oct 15 17:30:50 2008 (r33682)
>> @@ -6376,6 +6376,27 @@ pack_shard(const char *revs_dir,
>> apr_int64_t shard,
>> apr_pool_t *pool)
>> {
>> + svn_node_kind_t pack_kind;
>> + svn_node_kind_t shard_kind;
>> + const char *pack_file_path = svn_path_join(revs_dir,
>> + apr_psprintf(pool, "%ld.pack",
>> + shard), pool);
>> + const char *shard_path = svn_path_join(revs_dir,
>> + apr_psprintf(pool, "%ld", shard),
>> + pool);
>> +
>> + /* Do some consistency checking. */
>> + SVN_ERR(svn_io_check_path(pack_file_path, &pack_kind, pool));
>> + SVN_ERR(svn_io_check_path(shard_path, &shard_kind, pool));
>> + if (pack_kind == svn_node_file)
>> + {
>> + if (shard_kind == svn_node_dir)
>> + SVN_ERR(svn_io_remove_file(pack_file_path, pool));
>> + else
>> + /* We have already packed this shard, so just leave. */
>> + return SVN_NO_ERROR;
>> + }
>> +
>> return SVN_NO_ERROR;
>> }
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: svn-unsubscribe_at_subversion.tigris.org
>> For additional commands, e-mail: svn-help_at_subversion.tigris.org
>>
>>
>

Received on 2008-10-16 11:21:25 CEST

This is an archived mail posted to the Subversion Dev mailing list.