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 238DFC151 for ; Sat, 30 Jun 2012 21:49:00 +0000 (UTC) Received: (qmail 35169 invoked by uid 500); 30 Jun 2012 21:49:00 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 35144 invoked by uid 500); 30 Jun 2012 21:49:00 -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 35136 invoked by uid 99); 30 Jun 2012 21:49:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 30 Jun 2012 21:49:00 +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, 30 Jun 2012 21:48:58 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 538462388978; Sat, 30 Jun 2012 21:48:38 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1355828 - in /subversion/trunk/subversion/libsvn_wc: wc-queries.sql wc_db.c Date: Sat, 30 Jun 2012 21:48:37 -0000 To: commits@subversion.apache.org From: rhuijben@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120630214838.538462388978@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rhuijben Date: Sat Jun 30 21:48:36 2012 New Revision: 1355828 URL: http://svn.apache.org/viewvc?rev=1355828&view=rev Log: Reorder the columns returned by STMT_SELECT_ACTUAL_NODE and STMT_SELECT_ACTUAL_CHILDREN_INFO in preparation for using unified conflict skels. * subversion/libsvn_wc/wc-queries.sql (STMT_SELECT_ACTUAL_NODE, STMT_SELECT_ACTUAL_CHILDREN_INFO): Reorder columns as non-conflict*, conflict_data, legacy-conflict* * subversion/libsvn_wc/wc_db.c (copy_actual): Renumber columns. (read_info, read_children_info): Renumber columns. Add code for after format bump. (commit_node): Renumber columns. (svn_wc__db_read_conflicts): Renumber columns. Fail for new format. Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql subversion/trunk/subversion/libsvn_wc/wc_db.c Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=1355828&r1=1355827&r2=1355828&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original) +++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Sat Jun 30 21:48:36 2012 @@ -102,8 +102,8 @@ ORDER BY op_depth LIMIT 1 -- STMT_SELECT_ACTUAL_NODE -SELECT prop_reject, changelist, conflict_old, conflict_new, -conflict_working, tree_conflict_data, properties +SELECT changelist, properties, conflict_data, +conflict_old, conflict_new, conflict_working, prop_reject, tree_conflict_data FROM actual_node WHERE wc_id = ?1 AND local_relpath = ?2 @@ -137,9 +137,8 @@ FROM nodes_current WHERE wc_id = ?1 AND parent_relpath = ?2 -- STMT_SELECT_ACTUAL_CHILDREN_INFO -SELECT prop_reject, changelist, conflict_old, conflict_new, -conflict_working, tree_conflict_data, properties, local_relpath, -conflict_data +SELECT local_relpath, changelist, properties, conflict_data, +conflict_old, conflict_new, conflict_working, prop_reject, tree_conflict_data FROM actual_node WHERE wc_id = ?1 AND parent_relpath = ?2 Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1355828&r1=1355827&r2=1355828&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_wc/wc_db.c (original) +++ subversion/trunk/subversion/libsvn_wc/wc_db.c Sat Jun 30 21:48:36 2012 @@ -3325,9 +3325,9 @@ copy_actual(svn_wc__db_wcroot_t *src_wcr const char *properties; /* Skipping conflict data... */ - changelist = svn_sqlite__column_text(stmt, 1, scratch_pool); + changelist = svn_sqlite__column_text(stmt, 0, scratch_pool); /* No need to parse the properties when simply copying. */ - properties = svn_sqlite__column_blob(stmt, 6, &props_size, scratch_pool); + properties = svn_sqlite__column_blob(stmt, 1, &props_size, scratch_pool); if (changelist || properties) { @@ -7269,7 +7269,7 @@ read_info(svn_wc__db_status_t *status, if (changelist) { if (have_act) - *changelist = svn_sqlite__column_text(stmt_act, 1, result_pool); + *changelist = svn_sqlite__column_text(stmt_act, 0, result_pool); else *changelist = NULL; } @@ -7292,7 +7292,7 @@ read_info(svn_wc__db_status_t *status, } if (props_mod) { - *props_mod = have_act && !svn_sqlite__column_is_null(stmt_act, 6); + *props_mod = have_act && !svn_sqlite__column_is_null(stmt_act, 1); } if (had_props) { @@ -7303,11 +7303,15 @@ read_info(svn_wc__db_status_t *status, if (have_act) { *conflicted = - !svn_sqlite__column_is_null(stmt_act, 2) || /* old */ - !svn_sqlite__column_is_null(stmt_act, 3) || /* new */ - !svn_sqlite__column_is_null(stmt_act, 4) || /* working */ - !svn_sqlite__column_is_null(stmt_act, 0) || /* prop_reject */ - !svn_sqlite__column_is_null(stmt_act, 5); /* tree_conflict_data */ +#if SVN_WC__VERSION < SVN_WC__USES_CONFLICT_SKELS + !svn_sqlite__column_is_null(stmt_act, 3) || /* old */ + !svn_sqlite__column_is_null(stmt_act, 4) || /* new */ + !svn_sqlite__column_is_null(stmt_act, 5) || /* working */ + !svn_sqlite__column_is_null(stmt_act, 6) || /* prop_reject */ + !svn_sqlite__column_is_null(stmt_act, 7); /*tree_conflict_data*/ +#else + !svn_sqlite__column_is_null(stmt_act, 2); /* conflict_data */ +#endif } else *conflicted = FALSE; @@ -7362,7 +7366,11 @@ read_info(svn_wc__db_status_t *status, { /* A row in ACTUAL_NODE should never exist without a corresponding node in BASE_NODE and/or WORKING_NODE unless it flags a tree conflict. */ - if (svn_sqlite__column_is_null(stmt_act, 5)) /* tree_conflict_data */ +#if SVN_WC__VERSION < SVN_WC__USES_CONFLICT_SKELS + if (svn_sqlite__column_is_null(stmt_act, 7)) /* tree_conflict_data */ +#else + if (svn_sqlite__column_is_null(stmt_act, 2)) /* conflict_data */ +#endif err = svn_error_createf(SVN_ERR_WC_CORRUPT, NULL, _("Corrupt data for '%s'"), path_for_error_message(wcroot, local_relpath, @@ -7408,7 +7416,7 @@ read_info(svn_wc__db_status_t *status, if (recorded_mod_time) *recorded_mod_time = 0; if (changelist) - *changelist = svn_sqlite__column_text(stmt_act, 1, result_pool); + *changelist = svn_sqlite__column_text(stmt_act, 0, result_pool); if (op_root) *op_root = FALSE; if (had_props) @@ -7779,7 +7787,7 @@ read_children_info(void *baton, { struct read_children_info_item_t *child_item; struct svn_wc__db_info_t *child; - const char *child_relpath = svn_sqlite__column_text(stmt, 7, NULL); + const char *child_relpath = svn_sqlite__column_text(stmt, 0, NULL); const char *name = svn_relpath_basename(child_relpath, NULL); child_item = apr_hash_get(nodes, name, APR_HASH_KEY_STRING); @@ -7793,14 +7801,14 @@ read_children_info(void *baton, child->changelist = svn_sqlite__column_text(stmt, 1, result_pool); - child->props_mod = !svn_sqlite__column_is_null(stmt, 6); + child->props_mod = !svn_sqlite__column_is_null(stmt, 2); #ifdef HAVE_SYMLINK if (child->props_mod) { svn_error_t *err; apr_hash_t *properties; - err = svn_sqlite__column_properties(&properties, stmt, 6, + err = svn_sqlite__column_properties(&properties, stmt, 2, scratch_pool, scratch_pool); if (err) SVN_ERR(svn_error_compose_create(err, svn_sqlite__reset(stmt))); @@ -7809,11 +7817,19 @@ read_children_info(void *baton, } #endif - child->conflicted = !svn_sqlite__column_is_null(stmt, 2) || /* old */ +#if SVN_WC__VERSION < SVN_WC__USES_CONFLICT_SKELS + child->conflicted = !svn_sqlite__column_is_null(stmt, 4) || /* old */ + !svn_sqlite__column_is_null(stmt, 5) || /* new */ + !svn_sqlite__column_is_null(stmt, 6) || /* work */ + !svn_sqlite__column_is_null(stmt, 7) || /* prop */ + !svn_sqlite__column_is_null(stmt, 8); /* tree */ +#else + child->conflicted = !svn_sqlite__column_is_null(stmt, 3) || /* old */ !svn_sqlite__column_is_null(stmt, 3) || /* new */ !svn_sqlite__column_is_null(stmt, 4) || /* work */ !svn_sqlite__column_is_null(stmt, 0) || /* prop */ !svn_sqlite__column_is_null(stmt, 5); /* tree */ +#endif if (child->conflicted) apr_hash_set(conflicts, apr_pstrdup(result_pool, name), @@ -9218,14 +9234,14 @@ commit_node(void *baton, Note: we'll keep them as a big blob of data, rather than deserialize/serialize them. */ if (have_act) - prop_blob.data = svn_sqlite__column_blob(stmt_act, 6, &prop_blob.len, + prop_blob.data = svn_sqlite__column_blob(stmt_act, 1, &prop_blob.len, scratch_pool); if (prop_blob.data == NULL) prop_blob.data = svn_sqlite__column_blob(stmt_info, 14, &prop_blob.len, scratch_pool); if (cb->keep_changelist && have_act) - changelist = svn_sqlite__column_text(stmt_act, 1, scratch_pool); + changelist = svn_sqlite__column_text(stmt_act, 0, scratch_pool); old_presence = svn_sqlite__column_token(stmt_info, 3, presence_map); @@ -11689,6 +11705,7 @@ svn_wc__db_read_conflicts(const apr_arra if (have_row) { +#if SVN_WC__VERSION < SVN_WC__USES_CONFLICT_SKELS const char *prop_reject; const char *conflict_old; const char *conflict_new; @@ -11696,7 +11713,7 @@ svn_wc__db_read_conflicts(const apr_arra const char *conflict_data; /* ### Store in description! */ - prop_reject = svn_sqlite__column_text(stmt, 0, NULL); + prop_reject = svn_sqlite__column_text(stmt, 6, NULL); if (prop_reject) { svn_wc_conflict_description2_t *desc; @@ -11712,9 +11729,9 @@ svn_wc__db_read_conflicts(const apr_arra APR_ARRAY_PUSH(cflcts, svn_wc_conflict_description2_t*) = desc; } - conflict_old = svn_sqlite__column_text(stmt, 2, NULL); - conflict_new = svn_sqlite__column_text(stmt, 3, NULL); - conflict_working = svn_sqlite__column_text(stmt, 4, NULL); + conflict_old = svn_sqlite__column_text(stmt, 3, NULL); + conflict_new = svn_sqlite__column_text(stmt, 4, NULL); + conflict_working = svn_sqlite__column_text(stmt, 5, NULL); if (conflict_old || conflict_new || conflict_working) { @@ -11736,7 +11753,7 @@ svn_wc__db_read_conflicts(const apr_arra APR_ARRAY_PUSH(cflcts, svn_wc_conflict_description2_t*) = desc; } - conflict_data = svn_sqlite__column_text(stmt, 5, scratch_pool); + conflict_data = svn_sqlite__column_text(stmt, 7, scratch_pool); if (conflict_data) { const svn_wc_conflict_description2_t *desc; @@ -11755,6 +11772,9 @@ svn_wc__db_read_conflicts(const apr_arra APR_ARRAY_PUSH(cflcts, const svn_wc_conflict_description2_t *) = desc; } +#else + SVN_ERR_MALFUNCTION(); +#endif } SVN_ERR(svn_sqlite__reset(stmt));