Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C1BE37C85 for ; Thu, 28 Jul 2011 22:36:22 +0000 (UTC) Received: (qmail 86876 invoked by uid 500); 28 Jul 2011 22:36:22 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 86821 invoked by uid 500); 28 Jul 2011 22:36:21 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 86814 invoked by uid 99); 28 Jul 2011 22:36:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jul 2011 22:36:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jul 2011 22:36:18 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 184ED2388901 for ; Thu, 28 Jul 2011 22:35:58 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1152026 - /subversion/trunk/subversion/libsvn_client/commit.c Date: Thu, 28 Jul 2011 22:35:57 -0000 To: commits@subversion.apache.org From: stsp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110728223558.184ED2388901@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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. * 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))