One more thing!
On Dec 19, 2007 8:11 AM, <kameshj@tigris.org> wrote:
> Author: kameshj
> Date: Wed Dec 19 08:11:43 2007
> New Revision: 28561
> +/* merges MERGE_B->reflected_ranges from MERGE_B->target url to OLDER. */
> +static svn_error_t *
> +merge_reflected_ranges_b4_reflecting(const char *older,
> + const char *file_path_relative_to_target,
> + merge_cmd_baton_t *merge_b)
> +{
> + int i;
> + svn_diff_file_options_t *options;
> + const char *target_marker = "<<<<<<< .working";
> + const char *left_marker = "||||||| .old";
> + const char *right_marker = ">>>>>>> .new";
> + const char *temp_dir;
> + apr_pool_t *subpool = svn_pool_create(merge_b->pool);
> + SVN_ERR(svn_io_temp_dir(&temp_dir, subpool));
> +
> + if (merge_b->merge_options)
> + SVN_ERR(svn_diff_file_options_parse(options,
> + merge_b->merge_options, subpool));
> + else
> + options = svn_diff_file_options_create(subpool);
> + for (i = 0; i < merge_b->reflected_ranges->nelts; i++)
> + {
> + svn_diff_t *diff;
> + const char *left, *right, *result_target;
> + svn_merge_range_t *range;
> + svn_stream_t *ostream;
> + apr_file_t *result_f;
> + SVN_ERR(svn_io_open_unique_file2(&result_f, &result_target,
> + svn_path_join(temp_dir, "tmp", subpool),
> + "", svn_io_file_del_on_pool_cleanup,
> + subpool));
> + ostream = svn_stream_from_aprfile(result_f, subpool);
> + range = APR_ARRAY_IDX(merge_b->reflected_ranges, i, svn_merge_range_t *);
> + SVN_ERR(get_file_from_ra(&left, file_path_relative_to_target,
> + range->start, merge_b->target_ra_session,
> + subpool));
> + SVN_ERR(get_file_from_ra(&right, file_path_relative_to_target,
> + range->end, merge_b->target_ra_session,
> + subpool));
> + SVN_ERR(svn_diff_file_diff3_2(&diff, left, older, right,
> + options, subpool));
> + SVN_ERR(svn_diff_file_output_merge(ostream, diff,
> + left, older, right,
> + left_marker,
> + target_marker,
> + right_marker,
> + "=======", /* seperator */
> + FALSE, /* display original */
> + FALSE, /* resolve conflicts */
> + subpool));
> + SVN_ERR(svn_stream_close(ostream));
> + SVN_ERR(svn_io_file_flush_to_disk(result_f, subpool));
> +
> + SVN_ERR(svn_io_copy_file(result_target, older, TRUE, subpool));
> + }
> + svn_pool_destroy(subpool);
> + return SVN_NO_ERROR;
> +}
Shouldn't this function do different things for binary and text files?
Also I feel like there should be some concept of subst in there
somewhere. Maybe it should just be using something along the lines of
svn_wc__merge_internal?
--dave
--
David Glasser | glasser_at_davidglasser.net | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Dec 27 17:54:13 2007