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 CA070172C0 for ; Tue, 3 Mar 2015 11:36:18 +0000 (UTC) Received: (qmail 13563 invoked by uid 500); 3 Mar 2015 11:36:18 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 13536 invoked by uid 500); 3 Mar 2015 11:36:18 -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 13526 invoked by uid 99); 3 Mar 2015 11:36:18 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Mar 2015 11:36:18 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id 31F3CAC02BD for ; Tue, 3 Mar 2015 11:36:18 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1663671 - /subversion/trunk/subversion/libsvn_wc/update_editor.c Date: Tue, 03 Mar 2015 11:36:17 -0000 To: commits@subversion.apache.org From: rhuijben@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150303113618.31F3CAC02BD@hades.apache.org> Author: rhuijben Date: Tue Mar 3 11:36:17 2015 New Revision: 1663671 URL: http://svn.apache.org/r1663671 Log: Don't replace directories with a not-present node when a not supported subversion server (read: GitHub) describes that we should add a directory where one already exists. In this case the reporter got told that the directory already exists, but still described that one should be added in its place. (A well behaving server would describe an open, or a delete before the add). In any case: this is not an obstructing working copy as we assumed, so we don't have to break wc.db's info to allow recovering. * subversion/libsvn_wc/update_editor.c (add_directory, add_file): Check that there really is an obstructing working copy, before taking action. Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=1663671&r1=1663670&r2=1663671&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_wc/update_editor.c (original) +++ subversion/trunk/subversion/libsvn_wc/update_editor.c Tue Mar 3 11:36:17 2015 @@ -1937,7 +1937,12 @@ add_directory(const char *path, } else if (status == svn_wc__db_status_normal) { - if (wc_kind == svn_node_dir) + svn_boolean_t root; + + SVN_ERR(svn_wc__db_is_wcroot(&root, eb->db, db->local_abspath, + scratch_pool)); + + if (root) { /* !! We found the root of a working copy obstructing the wc !! @@ -1949,9 +1954,16 @@ add_directory(const char *path, resolved. Note that svn_wc__db_base_add_not_present_node() explicitly adds the node into the parent's node database. */ - svn_hash_sets(pb->not_present_nodes, apr_pstrdup(pb->pool, db->name), + svn_hash_sets(pb->not_present_nodes, + apr_pstrdup(pb->pool, db->name), svn_node_kind_to_word(svn_node_dir)); } + else if (wc_kind == svn_node_dir) + { + /* We have an editor violation. Github sometimes does this + in its subversion compatibility code, when changing the + depth of a working copy, or on updates from incomplete */ + } else { /* We found a file external occupating the place we need in BASE. @@ -3108,18 +3120,32 @@ add_file(const char *path, } else if (status == svn_wc__db_status_normal) { - if (wc_kind == svn_node_dir) + svn_boolean_t root; + + SVN_ERR(svn_wc__db_is_wcroot(&root, eb->db, fb->local_abspath, + scratch_pool)); + + if (root) { /* !! We found the root of a working copy obstructing the wc !! If the directory would be part of our own working copy then - we wouldn't have been called as an add_file(). + we wouldn't have been called as an add_directory(). The only thing we can do is add a not-present node, to allow a future update to bring in the new files when the problem is - resolved. */ - svn_hash_sets(pb->not_present_nodes, apr_pstrdup(pb->pool, fb->name), - svn_node_kind_to_word(svn_node_file)); + resolved. Note that svn_wc__db_base_add_not_present_node() + explicitly adds the node into the parent's node database. */ + + svn_hash_sets(pb->not_present_nodes, + apr_pstrdup(pb->pool, fb->name), + svn_node_kind_to_word(svn_node_dir)); + } + else if (wc_kind == svn_node_dir) + { + /* We have an editor violation. Github sometimes does this + in its subversion compatibility code, when changing the + depth of a working copy, or on updates from incomplete */ } else {