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 5A400D47A for ; Thu, 29 Nov 2012 15:13:29 +0000 (UTC) Received: (qmail 79132 invoked by uid 500); 29 Nov 2012 15:13:29 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 79093 invoked by uid 500); 29 Nov 2012 15:13: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 79063 invoked by uid 99); 29 Nov 2012 15:13:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Nov 2012 15:13:26 +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, 29 Nov 2012 15:13:25 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 4F65723888E4; Thu, 29 Nov 2012 15:13:05 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1415206 - /subversion/trunk/subversion/libsvn_wc/props.c Date: Thu, 29 Nov 2012 15:13:05 -0000 To: commits@subversion.apache.org From: rhuijben@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121129151305.4F65723888E4@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rhuijben Date: Thu Nov 29 15:13:04 2012 New Revision: 1415206 URL: http://svn.apache.org/viewvc?rev=1415206&view=rev Log: * subversion/libsvn_wc/props.c (svn_wc_get_pristine_props): Clear error instead of ignoring it. (svn_wc_prop_get2): Handle SVN_ERR_WC_PATH_UNEXPECTED_STATUS as a valid result and return NULL properties as documented. (svn_wc__internal_propget): Use db api for error behavior to avoid a further unneeded db call. Remove some obsolete error handling for the dav cache, which would have never touched this code as the node hidden check would have returned an error. Modified: subversion/trunk/subversion/libsvn_wc/props.c Modified: subversion/trunk/subversion/libsvn_wc/props.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.c?rev=1415206&r1=1415205&r2=1415206&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_wc/props.c (original) +++ subversion/trunk/subversion/libsvn_wc/props.c Thu Nov 29 15:13:04 2012 @@ -1535,6 +1535,8 @@ svn_wc_get_pristine_props(apr_hash_t **p if (err->apr_err != SVN_ERR_WC_PATH_UNEXPECTED_STATUS) return svn_error_trace(err); + svn_error_clear(err); + /* Documented behavior is to set *PROPS to NULL */ *props = NULL; } @@ -1551,6 +1553,7 @@ svn_wc_prop_get2(const svn_string_t **va apr_pool_t *scratch_pool) { enum svn_prop_kind kind = svn_property_kind2(name); + svn_error_t *err; SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath)); @@ -1561,8 +1564,18 @@ svn_wc_prop_get2(const svn_string_t **va _("Property '%s' is an entry property"), name); } - SVN_ERR(svn_wc__internal_propget(value, wc_ctx->db, local_abspath, name, - result_pool, scratch_pool)); + err = svn_wc__internal_propget(value, wc_ctx->db, local_abspath, name, + result_pool, scratch_pool); + + if (err) + { + if (err->apr_err != SVN_ERR_WC_PATH_UNEXPECTED_STATUS) + return svn_error_trace(err); + + svn_error_clear(err); + /* Documented behavior is to set *VALUE to NULL */ + *value = NULL; + } return SVN_NO_ERROR; } @@ -1582,30 +1595,11 @@ svn_wc__internal_propget(const svn_strin SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath)); SVN_ERR_ASSERT(kind != svn_prop_entry_kind); - /* This returns SVN_ERR_WC_PATH_NOT_FOUND for unversioned paths for us */ - SVN_ERR(svn_wc__db_node_hidden(&hidden, db, local_abspath, scratch_pool)); - if (hidden) - { - /* The node is not present, or not really "here". Therefore, the - property is not present. */ - *value = NULL; - return SVN_NO_ERROR; - } - if (kind == svn_prop_wc_kind) { - svn_error_t *err; - /* If no dav cache can be found, just set VALUE to NULL (for - compatibility with pre-WC-NG code). */ - err = svn_wc__db_base_get_dav_cache(&prophash, db, local_abspath, - result_pool, scratch_pool); - if (err && (err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)) - { - *value = NULL; - svn_error_clear(err); - return SVN_NO_ERROR; - } - SVN_ERR_W(err, _("Failed to load properties")); + SVN_ERR_W(svn_wc__db_base_get_dav_cache(&prophash, db, local_abspath, + result_pool, scratch_pool), + _("Failed to load properties")); } else {