On Thu, Jul 28, 2011 at 3:35 PM, <stsp_at_apache.org> wrote:
> Author: stsp
> Date: Thu Jul 28 22:35:57 2011
> New Revision: 1152026
>
> URL: http://svn.apache.org/viewvc?rev=1152026&view=rev
> Log:
> Make commit refuse to commit the copied-half of a move independently of
> the delete-half.
>
> It is still possible to commit the delete-half independently of the
> copied-half. That will be fixed soon.
>
> This is the first visible behaviour change for moves.
> None of our existing tests trigger the new error condition so writing
> new tests wouldn't be a bad idea. I'll add some if nobody beats me to it.
See r1152115.
-Hyrum
>
> * subversion/libsvn_client/commit.c
> Â (svn_client_commit5): Raise an error if the delete-half corresponding
> Â to the copied-half of a moved commit target does not appear in the
> Â commit target list.
>
> Modified:
> Â Â subversion/trunk/subversion/libsvn_client/commit.c
>
> Modified: subversion/trunk/subversion/libsvn_client/commit.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/commit.c?rev=1152026&r1=1152025&r2=1152026&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_client/commit.c (original)
> +++ subversion/trunk/subversion/libsvn_client/commit.c Thu Jul 28 22:35:57 2011
> @@ -1356,6 +1356,47 @@ svn_client_commit5(const apr_array_heade
> Â Â Â goto cleanup;
> Â }
>
> + Â /* For every target that was moved verify that both halves of the
> + Â * move are part of the commit. */
> + Â for (i = 0; i < commit_items->nelts; i++)
> + Â Â {
> + Â Â Â svn_client_commit_item3_t *item =
> + Â Â Â Â APR_ARRAY_IDX(commit_items, i, svn_client_commit_item3_t *);
> +
> + Â Â Â svn_pool_clear(iterpool);
> +
> + Â Â Â if (item->state_flags & SVN_CLIENT_COMMIT_ITEM_IS_COPY)
> + Â Â Â Â {
> + Â Â Â Â Â const char *moved_from_abspath;
> + Â Â Â Â Â const char *delete_op_root_abspath;
> +
> + Â Â Â Â Â cmt_err = svn_error_trace(svn_wc__node_was_moved_here(
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â &moved_from_abspath,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â &delete_op_root_abspath,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ctx->wc_ctx, item->path,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â iterpool, iterpool));
> + Â Â Â Â Â if (cmt_err)
> + Â Â Â Â Â Â goto cleanup;
> +
> + Â Â Â Â Â if (moved_from_abspath && delete_op_root_abspath &&
> + Â Â Â Â Â Â Â strcmp(moved_from_abspath, delete_op_root_abspath) == 0 &&
> + Â Â Â Â Â Â Â apr_hash_get(committables->by_path, delete_op_root_abspath,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â APR_HASH_KEY_STRING) == NULL)
> + Â Â Â Â Â Â {
> + Â Â Â Â Â Â Â cmt_err = svn_error_createf(
> + Â Â Â Â Â Â Â Â Â Â Â Â Â SVN_ERR_ILLEGAL_TARGET, NULL,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â _("Cannot commit '%s' because it was moved from "
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â "'%s' which is not part of the commit; both "
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â "sides of the move must be committed together"),
> + Â Â Â Â Â Â Â Â Â Â Â Â Â svn_dirent_local_style(item->path, iterpool),
> + Â Â Â Â Â Â Â Â Â Â Â Â Â svn_dirent_local_style(delete_op_root_abspath,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â iterpool));
> + Â Â Â Â Â Â Â goto cleanup;
> + Â Â Â Â Â Â }
> + Â Â Â Â }
> + Â Â Â /* ### TODO: check the delete-half, too */
> + Â Â }
> +
> Â /* Go get a log message. Â If an error occurs, or no log message is
> Â Â Â specified, abort the operation. */
> Â if (SVN_CLIENT__HAS_LOG_MSG_FUNC(ctx))
>
>
>
--
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/
Received on 2011-07-29 08:07:37 CEST