sussman@tigris.org writes:
> New Revision: 1617
>
> Modified: trunk/subversion/libsvn_client/diff.c
> ==============================================================================
> --- trunk/subversion/libsvn_client/diff.c (original)
> +++ trunk/subversion/libsvn_client/diff.c Mon Apr 1 14:53:45 2002
> @@ -220,12 +220,48 @@
> {
> struct merge_cmd_baton *merge_b = baton;
> apr_pool_t *subpool = svn_pool_create (merge_b->pool);
> + enum svn_node_kind kind;
>
> - /* ### if file already exists, this should call svn_wc_merge. */
> -
> - SVN_ERR (svn_io_copy_file (yours, mine, TRUE, subpool));
> - SVN_ERR (svn_client_add (svn_stringbuf_create (mine, subpool),
> - FALSE, NULL, NULL, subpool));
> + SVN_ERR (svn_io_check_path (mine, &kind, subpool));
> + switch (kind)
> + {
> + case svn_node_none:
> + SVN_ERR (svn_io_copy_file (yours, mine, TRUE, subpool));
> + SVN_ERR (svn_client_add (svn_stringbuf_create (mine, subpool),
> + FALSE, NULL, NULL, subpool));
> + break;
> + case svn_node_dir:
> + /* ### create a .drej conflict or something someday? */
> + return svn_error_createf (SVN_ERR_WC_NOT_FILE, 0, NULL, subpool,
> + "Cannot create file '%s' for addition, "
> + "because a directory by that name "
> + "already exists.", mine);
> + case svn_node_file:
> + {
> + /* file already exists, is it under version control? */
> + svn_wc_entry_t *entry;
> + SVN_ERR (svn_wc_entry (&entry, svn_stringbuf_create (mine, subpool),
> + subpool));
> + if (entry)
> + {
> + svn_error_t *err;
> + err = svn_wc_merge (older, yours, mine,
> + ".older", ".yours", ".working", /* ###? */
> + subpool);
Yeah, agree with the "###?". We can do better than the diff3
documentation's "mine, older, yours" convention. Older and yours
should both be revision numbers; can't think of anything better than
".working" for working, though.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Apr 2 01:50:01 2002