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

Re: [PATCH] Issue #2188 - [API] svn_client_copy/move should error out if target exists

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2005-05-14 01:06:56 CEST

"S.Ramaswamy" <ramaswamy@collab.net> writes:

> Introduced a parameter 'dir_override' in the new API calls
> svn_client_copy2() and svn_client_move3() to allow directory creation
> to be toggled. Need a better name than 'dir_override'. The cmd line
> client still calls the older API, since this change is mainly meant
> for non-cmd line clients. Should the cmd line also be making calls to
> the new functions ?

The command line client should not be using deprecated functions.

> --- subversion/libsvn_client/copy.c (revision 14705)
> +++ subversion/libsvn_client/copy.c (working copy)
> @@ -67,6 +67,7 @@
> svn_boolean_t is_move,
> svn_boolean_t force,
> svn_client_ctx_t *ctx,
> + svn_boolean_t dir_override,
> apr_pool_t *pool)
> {
> svn_node_kind_t src_kind, dst_kind;
> @@ -93,6 +94,12 @@
> }
> else if (dst_kind == svn_node_dir)
> {
> + if ((!dir_override) && (src_kind == svn_node_dir))

Is that src_kind check correct?

The aim is to make "copy url_or_path1 url_or_path2" predictable,
i.e. to allow the caller to predict the exact destination URL or path.
As far as I can see with your patch the caller still doesn't know what
will get created when src_kind is not a directory.

I don't know whether it makes sense to have a flag to retain the old
behaviour in the new function. If the "smart" destination logic was
relegated to the deprecated functions the new functions might well be
simpler.

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat May 14 01:08:00 2005

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.