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

Re: svn commit: r20893 - branches/merge-tracking/subversion/libsvn_fs_fs

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: 2006-07-28 12:57:40 CEST

Daniel Rall wrote:
> Okay -- we need to always do the cleanup, 'cuz if we don't we could
> leave stray records around the merge info index. Which don't actively
> harm anything, but perhaps should be deleted...
>
> The API probably shouldn't be named index_merge_info(), then.
> update_merge_info() would be better, but is already taken. Should we
> merge the two routines into a single routine, or rename the existing
> update_merge_info() function to something more specific?
>
>
Find the attached patch.

With regards
Kamesh Jayachandran
[[[
Patch by: Kamesh Jayachandran <kamesh@collab.net>

r20893 fails to do a cleanup of some earlier commit with the rev as
current one.

* subversion/libsvn_fs_fs/fs_fs.c
  (generate_mergeinfo_sql): Renamed to
'insert_mergeinfo_index_for_single_path'
  (update_mergeinfo_index): Renamed to 'insert_mergeinfo_index'
   changed to call insert_mergeinfo_index_for_single_path.
  (index_merge_info): Renamed to 'replace_merge_info_index'
   One extra parameter 'contains_merge_info' is added.
   Adds the mergeinfo if the commit has some merge info.

  (commit_body): calls 'replace_merge_info_index' unconditionally by passing
   the 'contains_merge_info'.
]]]

Index: subversion/libsvn_fs_fs/fs_fs.c
===================================================================
--- subversion/libsvn_fs_fs/fs_fs.c (revision 20894)
+++ subversion/libsvn_fs_fs/fs_fs.c (working copy)
@@ -3999,7 +3999,7 @@
    mergeinfo lists of PATH, which is stored unparsed in MINFOSTRING. */
    
 static svn_error_t *
-generate_mergeinfo_sql(svn_fs_txn_t *txn, svn_revnum_t new_rev,
+insert_mergeinfo_index_for_single_path(svn_fs_txn_t *txn, svn_revnum_t new_rev,
                        const char *path, svn_string_t *minfostring,
                        apr_pool_t *pool)
 {
@@ -4075,7 +4075,7 @@
 
 /* A no-op if TXN has no associated merge info. */
 static svn_error_t *
-update_mergeinfo_index(svn_fs_txn_t *txn, svn_revnum_t new_rev,
+insert_mergeinfo_index(svn_fs_txn_t *txn, svn_revnum_t new_rev,
                        apr_pool_t *pool)
 {
   apr_hash_t *minfoprops;
@@ -4099,8 +4099,10 @@
           minfopath = key;
           minfostring = val;
 
- SVN_ERR(generate_mergeinfo_sql(txn, new_rev, minfopath, minfostring,
- pool));
+ SVN_ERR(insert_mergeinfo_index_for_single_path(txn, new_rev,
+ minfopath,
+ minfostring,
+ pool));
         }
     }
   
@@ -4118,8 +4120,8 @@
    revision number as NEW_REV, then record the merge info for the
    current transaction. */
 static svn_error_t *
-index_merge_info(struct commit_baton *cb, svn_revnum_t new_rev,
- apr_pool_t *pool)
+replace_merge_info_index(struct commit_baton *cb, svn_revnum_t new_rev,
+ svn_boolean_t contains_merge_info, apr_pool_t *pool)
 {
   const char *deletestring;
   fs_txn_data_t *ftd = cb->txn->fsap_data;
@@ -4143,7 +4145,8 @@
   SVN_ERR(fs_sqlite_exec(ftd->mtd, deletestring, NULL, NULL));
 
   /* Record any merge info from the current transaction. */
- SVN_ERR(update_mergeinfo_index(cb->txn, new_rev, pool));
+ if (contains_merge_info)
+ SVN_ERR(insert_mergeinfo_index(cb->txn, new_rev, pool));
       
   /* This is moved here from commit_txn, because we don't want to
      write the final current file if the sqlite commit fails.
@@ -4273,8 +4276,7 @@
   SVN_ERR(svn_fs_fs__move_into_place(revprop_filename, final_revprop,
                                      old_rev_filename, pool));
   
- if (contains_merge_info)
- SVN_ERR(index_merge_info(cb, new_rev, pool));
+ SVN_ERR(replace_merge_info_index(cb, new_rev, contains_merge_info, pool));
 
   /* Update the 'current' file. */
   SVN_ERR(write_final_current(cb->fs, cb->txn->id, new_rev, start_node_id,

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Jul 29 01:28:07 2006

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