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

Re: svn commit: r1144530 - /subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Sat, 9 Jul 2011 02:34:36 +0300

Blair Zajac wrote on Fri, Jul 08, 2011 at 15:50:17 -0700:
> On Jul 8, 2011, at 3:44 PM, danielsh_at_apache.org wrote:
> > +++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Fri Jul 8 22:44:52 2011
> > @@ -6509,8 +6509,7 @@ commit_body(void *baton, apr_pool_t *poo
> > new_dir, pool));
> > }
> >
> > - if (ffd->format < SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT ||
> > - new_rev >= ffd->min_unpacked_revprop)
> > + assert(! is_packed_revprop(cb->fs, new_rev));
>
> Wouldn't an SVN_ERR_ASSERT() be better here?

Works for me. What about those other instances --- in
write_change_entry() and recover_find_max_ids()?

Index: subversion/libsvn_fs_fs/fs_fs.c
===================================================================
--- subversion/libsvn_fs_fs/fs_fs.c (revision 1144550)
+++ subversion/libsvn_fs_fs/fs_fs.c (working copy)
@@ -5330,7 +5330,7 @@ write_change_entry(apr_file_t *file,
 
   if (include_node_kind)
     {
- assert(change->node_kind == svn_node_dir
+ SVN_ERR_ASSERT(change->node_kind == svn_node_dir
                      || change->node_kind == svn_node_file);
       kind_string = apr_psprintf(pool, "-%s",
                                  change->node_kind == svn_node_dir
@@ -6371,7 +6371,7 @@ commit_body(void *baton, apr_pool_t *pool)
         }
 
       /* Create the revprops shard. */
- assert(! is_packed_revprop(cb->fs, new_rev));
+ SVN_ERR_ASSERT(! is_packed_revprop(cb->fs, new_rev));
         {
           const char *new_dir = path_revprops_shard(cb->fs, new_rev, pool);
           svn_error_t *err = svn_io_dir_make(new_dir, APR_OS_DEFAULT, pool);
@@ -6407,7 +6407,7 @@ commit_body(void *baton, apr_pool_t *pool)
                                      &date, pool));
 
   /* Move the revprops file into place. */
- assert(! is_packed_revprop(cb->fs, new_rev));
+ SVN_ERR_ASSERT(! is_packed_revprop(cb->fs, new_rev));
   revprop_filename = path_txn_props(cb->fs, cb->txn->id, pool);
   final_revprop = path_revprops(cb->fs, new_rev, pool);
   SVN_ERR(move_into_place(revprop_filename, final_revprop,
@@ -6881,12 +6881,12 @@ recover_find_max_ids(svn_fs_t *fs, svn_revnum_t re
 
       if (svn_fs_fs__key_compare(node_id, max_node_id) > 0)
         {
- assert(strlen(node_id) < MAX_KEY_SIZE);
+ SVN_ERR_ASSERT(strlen(node_id) < MAX_KEY_SIZE);
           apr_cpystrn(max_node_id, node_id, MAX_KEY_SIZE);
         }
       if (svn_fs_fs__key_compare(copy_id, max_copy_id) > 0)
         {
- assert(strlen(copy_id) < MAX_KEY_SIZE);
+ SVN_ERR_ASSERT(strlen(copy_id) < MAX_KEY_SIZE);
           apr_cpystrn(max_copy_id, copy_id, MAX_KEY_SIZE);
         }
 
Received on 2011-07-09 01:35:24 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.