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?
On Fri, 28 Jul 2006, Kamesh Jayachandran wrote:
> - }
> >+ SVN_ERR(index_merge_info(cb, new_rev, pool));
> Fails to cleanup the earlier failed merge commits.
> Attached patch does it.
> With regards
> Kamesh Jayachandran
> Patch by: Kamesh Jayachandran <firstname.lastname@example.org>
> r20893 fails to do a cleanup of some earlier commit with the rev as
> current one.
> * subversion/libsvn_fs_fs/fs_fs.c
> One extra parameter 'contains_merge_info' is added.
> Adds the mergeinfo if the commit has some merge info.
> (commit_body): calls index_merge_info 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)
> @@ -4119,7 +4119,7 @@
> current transaction. */
> static svn_error_t *
> index_merge_info(struct commit_baton *cb, svn_revnum_t new_rev,
> - apr_pool_t *pool)
> + svn_boolean_t contains_merge_info, apr_pool_t *pool)
> const char *deletestring;
> fs_txn_data_t *ftd = cb->txn->fsap_data;
> @@ -4143,7 +4143,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(update_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 +4274,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(index_merge_info(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,
Received on Fri Jul 28 23:49:14 2006
- application/pgp-signature attachment: stored