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

Re: [PATCH] make svnmucc consistently log an error when copy targets exist

From: Philip Martin <philip_at_codematters.co.uk>
Date: Sat, 08 Nov 2008 13:46:20 +0000

"Kevin Radke" <kmradke_at_gmail.com> writes:

> [[[
> Consistently log an error when copy targets exist
> * contrib/client-side/svnmucc/svnmucc.c
> (build): If copy target path exists log an error
> ]]]
>
> Index: contrib/client-side/svnmucc/svnmucc.c
> ===================================================================
> --- contrib/client-side/svnmucc/svnmucc.c (revision 34099)
> +++ contrib/client-side/svnmucc/svnmucc.c (working copy)
> @@ -480,6 +480,27 @@
> "than base revision");
> operation->operation =
> operation->operation == OP_DELETE ? OP_REPLACE : OP_ADD;
> + if (operation->operation == OP_ADD)
> + {
> + /* There is a bug in the current version of mod_dav_svn
> + which incorrectly replaces existing directories.
> + Therefore we need to check if the target exists
> + and raise an error here. */
> + SVN_ERR(svn_ra_check_path(session,
> + copy_src ? copy_src : path,
> + copy_src ? copy_rev : head,
> + &operation->kind, pool));
> + if (operation->kind != svn_node_none)
> + {
> + if (copy_src && strcmp(path, copy_src))

Indentation looks a bit off here.

> + return svn_error_createf(SVN_ERR_BAD_URL, NULL,
> + "'%s' (from '%s:%ld') already exists",
> + path, copy_src, copy_rev);
> + else
> + return svn_error_createf(SVN_ERR_BAD_URL, NULL,
> + "'%s' already exists", path);
> + }
> + }
> SVN_ERR(svn_ra_check_path(session, subtract_anchor(anchor, url, pool),
> rev, &operation->kind, pool));
> if (operation->kind == svn_node_none)

OK to commit.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-11-08 14:46:38 CET

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.