On Thu, May 31, 2012 at 4:32 PM, Hyrum K Wright <hyrum.wri...@wandisco.com> wrote: > On Thu, May 10, 2012 at 2:13 PM, <rhuij...@apache.org> wrote: >> Author: rhuijben >> Date: Thu May 10 19:13:11 2012 >> New Revision: 1336833 >> >> URL: http://svn.apache.org/viewvc?rev=1336833&view=rev >> Log: >> Make the text and property merge handling of 'svn merge' of a single file an >> atomic operation by moving the handling into a single libsvn_wc call that >> installs or doesn't install the working queue items. >> >> * subversion/include/svn_wc.h >> (svn_wc_merge5): New function. >> (svn_wc_merge4): Deprecate function. >> >> * subversion/libsvn_client/merge.c >> (merge_file_changed): Update caller. >> >> * subversion/libsvn_wc/deprecated.c >> (svn_wc_merge4): New function. Wraps svn_wc_merge5(). >> >> * subversion/libsvn_wc/merge.c >> (svn_wc_merge4): Rename to ... >> (svn_wc_merge5): ... this and add support for merging properties in the same >> operation. At the same time avoid a few more unneeded db operations. >> > ... >> Modified: subversion/trunk/subversion/libsvn_wc/merge.c >> URL: >> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/merge.c?rev=1336833&r1=1336832&r2=1336833&view=diff >> ============================================================================== >> --- subversion/trunk/subversion/libsvn_wc/merge.c (original) >> +++ subversion/trunk/subversion/libsvn_wc/merge.c Thu May 10 19:13:11 2012 > ... >> @@ -1476,7 +1476,8 @@ svn_wc__internal_merge(svn_skel_t **work >> >> >> svn_error_t * >> -svn_wc_merge4(enum svn_wc_merge_outcome_t *merge_outcome, >> +svn_wc_merge5(enum svn_wc_merge_outcome_t *merge_content_outcome, >> + enum svn_wc_notify_state_t *merge_props_outcome, >> svn_wc_context_t *wc_ctx, >> const char *left_abspath, >> const char *right_abspath, >> @@ -1489,6 +1490,7 @@ svn_wc_merge4(enum svn_wc_merge_outcome_ >> svn_boolean_t dry_run, >> const char *diff3_cmd, >> const apr_array_header_t *merge_options, >> + apr_hash_t *original_props, >> const apr_array_header_t *prop_diff, >> svn_wc_conflict_resolver_func2_t conflict_func, >> void *conflict_baton, >> @@ -1497,8 +1499,11 @@ svn_wc_merge4(enum svn_wc_merge_outcome_ >> apr_pool_t *scratch_pool) >> { >> const char *dir_abspath = svn_dirent_dirname(target_abspath, scratch_pool); >> + svn_skel_t *prop_items = NULL; >> svn_skel_t *work_items; >> - apr_hash_t *actual_props; >> + apr_hash_t *pristine_props = NULL; >> + apr_hash_t *actual_props = NULL; >> + apr_hash_t *new_actual_props = NULL; >> >> SVN_ERR_ASSERT(svn_dirent_is_absolute(left_abspath)); >> SVN_ERR_ASSERT(svn_dirent_is_absolute(right_abspath)); >> @@ -1508,37 +1513,86 @@ svn_wc_merge4(enum svn_wc_merge_outcome_ >> if (!dry_run) >> SVN_ERR(svn_wc__write_check(wc_ctx->db, dir_abspath, scratch_pool)); >> >> - /* Sanity check: the merge target must be under revision control, >> - * unless the merge target is a copyfrom text, which lives in a >> - * temporary file and does not exist in ACTUAL yet. */ >> + /* Sanity check: the merge target must be a file under revision control >> */ >> { >> + svn_wc__db_status_t status; >> svn_kind_t kind; >> - svn_boolean_t hidden; >> - SVN_ERR(svn_wc__db_read_kind(&kind, wc_ctx->db, target_abspath, TRUE, >> - scratch_pool)); >> + svn_boolean_t had_props; >> + svn_boolean_t props_mod; >> >> - if (kind == svn_kind_unknown) >> + SVN_ERR(svn_wc__db_read_info(&status, &kind, NULL, NULL, NULL, NULL, >> NULL, >> + NULL, NULL, NULL, NULL, NULL, NULL, NULL, >> + NULL, NULL, NULL, NULL, NULL, NULL, NULL, >> + NULL, &had_props, &props_mod, NULL, NULL, >> + NULL, >> + wc_ctx->db, target_abspath, >> + scratch_pool, scratch_pool)); >> + >> + if (kind != svn_kind_file || (status != svn_wc__db_status_normal >> + && status != svn_wc__db_status_added)) >> { >> - *merge_outcome = svn_wc_merge_no_merge; >> + *merge_content_outcome = svn_wc_merge_no_merge; >> + if (merge_props_outcome) >> + *merge_props_outcome = svn_wc_merge_no_merge; > > There is a type mismatch here: *merge_props_outcome is an enum of type > svn_wc_notify_state_t, but svn_wc_merge_no_merge is one of > svn_wc_merge_outcome_t.
Bert, Any response on this? I'm concerned about this seemingly arbitrary type mismatch, and the effects it could have. This probably only work by luck at this point... -Hyrum -- uberSVN: Apache Subversion Made Easy http://www.uberSVN.com/