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

Re: [PATCH] Fix for issue 3799 - exporting file should not overwrite

From: Noorul Islam K M <noorul_at_collab.net>
Date: Tue, 24 May 2011 15:39:10 +0530

Philip Martin <philip.martin_at_wandisco.com> writes:

> Noorul Islam K M <noorul_at_collab.net> writes:
>
>> Index: subversion/libsvn_client/export.c
>> ===================================================================
>> --- subversion/libsvn_client/export.c (revision 1071880)
>> +++ subversion/libsvn_client/export.c (working copy)
>> @@ -524,7 +524,26 @@
>> }
>> else if (from_kind == svn_node_file)
>> {
>> + svn_node_kind_t kind;
>> + svn_error_t *err;
>> +
>> SVN_ERR(append_basename_if_dir(&to_abspath, from_abspath, FALSE, pool));
>> + svn_error_clear(svn_io_check_path(to_abspath, &kind, pool));
>> +
>> + if ((kind == svn_node_file) && ! force)
>> + {
>> + return svn_error_createf(SVN_ERR_FS_ALREADY_EXISTS, NULL,
>> + _("Destination file '%s' exists, "
>> + "and will not be overwritten unless "
>> + "forced"),
>> + svn_dirent_local_style(to_abspath, pool));
>
> That's the wrong error, SVN_ERR_FS_ is for the Subversion filesystem in
> the repository.
>

I could see usage of the same at several places in libsvn_client.

>> + }
>> + else if (kind == svn_node_dir)
>> + return svn_error_createf(SVN_ERR_FS_ALREADY_EXISTS, NULL,
>> + _("Destination %s exists. Cannot overwrite "
>> + "directory with non-directory"),
>> + svn_dirent_local_style(to_abspath, pool));
>> +
>> SVN_ERR(copy_one_versioned_file(from_abspath, to_abspath, ctx->wc_ctx,
>> revision, native_eol, ignore_keywords,
>> pool));
>
> Why do we have these checks here as well as open_root_internal?

open_root_internal is not called in these situations.

Thanks and Regards
Noorul
Received on 2011-05-24 12:11:19 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.