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 D7BBBE971 for ; Mon, 21 Jan 2013 16:34:28 +0000 (UTC) Received: (qmail 59855 invoked by uid 500); 21 Jan 2013 16:34:28 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 59836 invoked by uid 500); 21 Jan 2013 16:34:28 -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 59825 invoked by uid 99); 21 Jan 2013 16:34:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jan 2013 16:34:28 +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; Mon, 21 Jan 2013 16:34:27 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 10A922388900; Mon, 21 Jan 2013 16:34:08 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1436461 - /subversion/trunk/subversion/libsvn_wc/wc_db.c Date: Mon, 21 Jan 2013 16:34:07 -0000 To: commits@subversion.apache.org From: stsp@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130121163408.10A922388900@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: stsp Date: Mon Jan 21 16:34:07 2013 New Revision: 1436461 URL: http://svn.apache.org/viewvc?rev=1436461&view=rev Log: * subversion/libsvn_wc/wc_db.c (insert_working_node): Preserve existing move-to information recorded in base-deleted nodes that are being replaced. Fixes the problem where e.g. 'svn mv A B; svn mkdir A' ends up wiping information about the A->B move. Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1436461&r1=1436460&r2=1436461&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_wc/wc_db.c (original) +++ subversion/trunk/subversion/libsvn_wc/wc_db.c Mon Jan 21 16:34:07 2013 @@ -989,7 +989,9 @@ insert_working_node(void *baton, { const insert_working_baton_t *piwb = baton; const char *parent_relpath; + const char *moved_to_relpath = NULL; svn_sqlite__stmt_t *stmt; + svn_boolean_t have_row; SVN_ERR_ASSERT(piwb->op_depth > 0); @@ -997,10 +999,21 @@ insert_working_node(void *baton, SVN_ERR_ASSERT(*local_relpath != '\0'); parent_relpath = svn_relpath_dirname(local_relpath, scratch_pool); + /* Preserve existing moved-to information for this relpath, + * which might exist in case we're replacing an existing base-deleted + * node. */ + SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb, STMT_SELECT_MOVED_TO)); + SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id, local_relpath, + piwb->op_depth)); + SVN_ERR(svn_sqlite__step(&have_row, stmt)); + if (have_row) + moved_to_relpath = svn_sqlite__column_text(stmt, 0, scratch_pool); + SVN_ERR(svn_sqlite__reset(stmt)); + SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb, STMT_INSERT_NODE)); SVN_ERR(svn_sqlite__bindf(stmt, "isdsnnntstrisn" "nnnn" /* properties translated_size last_mod_time dav_cache */ - "snnd", /* symlink_target, file_external, moved_to, moved_here */ + "snsd", /* symlink_target, file_external, moved_to, moved_here */ wcroot->wc_id, local_relpath, piwb->op_depth, parent_relpath, @@ -1014,6 +1027,7 @@ insert_working_node(void *baton, /* Note: incomplete nodes may have a NULL target. */ (piwb->kind == svn_kind_symlink) ? piwb->target : NULL, + moved_to_relpath, piwb->moved_here)); if (piwb->kind == svn_kind_file)