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 667ECEF01 for ; Sat, 26 Jan 2013 18:44:07 +0000 (UTC) Received: (qmail 55490 invoked by uid 500); 26 Jan 2013 18:44:07 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 55475 invoked by uid 500); 26 Jan 2013 18:44:07 -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 55468 invoked by uid 99); 26 Jan 2013 18:44:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 26 Jan 2013 18:44:07 +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; Sat, 26 Jan 2013 18:44:05 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 1695123888FE; Sat, 26 Jan 2013 18:43:45 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1438938 - /subversion/trunk/subversion/libsvn_client/repos_diff.c Date: Sat, 26 Jan 2013 18:43:44 -0000 To: commits@subversion.apache.org From: rhuijben@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130126184345.1695123888FE@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rhuijben Date: Sat Jan 26 18:43:44 2013 New Revision: 1438938 URL: http://svn.apache.org/viewvc?rev=1438938&view=rev Log: * subversion/libsvn_client/repos_diff.c (diff_state_handle): Consolidate replacement checks in add notification handling. Ignore tree conflict case as a failure to delete will certainly raise another tree conflict to add something in its place. Modified: subversion/trunk/subversion/libsvn_client/repos_diff.c Modified: subversion/trunk/subversion/libsvn_client/repos_diff.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/repos_diff.c?rev=1438938&r1=1438937&r2=1438938&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_client/repos_diff.c (original) +++ subversion/trunk/subversion/libsvn_client/repos_diff.c Sat Jan 26 18:43:44 2013 @@ -1443,10 +1443,8 @@ diff_state_handle(svn_boolean_t tree_con return SVN_NO_ERROR; } - /* This code is copy & pasted from different functions in this file. - It is only used from the merge api, and should really be integrated - there. - */ + /* This code is only used from the merge api, and should really be + integrated there. */ { deleted_path_notify_t *dpn; @@ -1455,6 +1453,11 @@ diff_state_handle(svn_boolean_t tree_con svn_node_kind_t notify_kind = (kind == svn_kind_dir) ? svn_node_dir : svn_node_file; + if (for_add) + action = svn_wc_notify_update_add; + else + action = svn_wc_notify_update_update; + /* Find out if a pending delete notification for this path is * still around. */ dpn = apr_hash_get(eb->deleted_paths, relpath, APR_HASH_KEY_STRING); @@ -1463,28 +1466,15 @@ diff_state_handle(svn_boolean_t tree_con /* If any was found, we will handle the pending 'deleted path * notification' (DPN) here. Remove it from the list. */ apr_hash_set(eb->deleted_paths, relpath, - APR_HASH_KEY_STRING, NULL); + APR_HASH_KEY_STRING, NULL); /* the pending delete might be on a different node kind. */ notify_kind = dpn->kind; notify_content_state = notify_prop_state = dpn->state; - } - /* Determine what the notification (ACTION) should be. - * In case of a pending 'delete', this might become a 'replace'. */ - if (dpn) - { - if (dpn->action == svn_wc_notify_update_delete - && for_add) + if (for_add && dpn->action == svn_wc_notify_update_delete) action = svn_wc_notify_update_replace; - else - /* Note: dpn->action might be svn_wc_notify_tree_conflict */ - action = dpn->action; } - else if (for_add) - action = svn_wc_notify_update_add; - else - action = svn_wc_notify_update_update; notify = svn_wc_create_notify(relpath, action, scratch_pool); notify->kind = notify_kind;