You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/11/12 17:40:51 UTC
svn commit: r1034464 - in /subversion/trunk/subversion/libsvn_wc:
wc-queries.sql wc_db.c
Author: hwright
Date: Fri Nov 12 16:40:51 2010
New Revision: 1034464
URL: http://svn.apache.org/viewvc?rev=1034464&view=rev
Log:
Update conflict retrieval by fetching tree conflicts directly from the
ACTUAL node.
* subversion/libsvn_wc/wc-queries.sql
(STMT_SELECT_ACTUAL_CONFLICT_VICTIMS): Pull in tree conflict victims.
* subversion/libsvn_wc/wc_db.c
(svn_wc__db_read_conflict_victims): Don't fetch tree conflicts separately
from other conflicts.
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=1034464&r1=1034463&r2=1034464&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Fri Nov 12 16:40:51 2010
@@ -455,7 +455,8 @@ SELECT local_relpath
FROM actual_node
WHERE wc_id = ?1 AND parent_relpath = ?2 AND
NOT ((prop_reject IS NULL) AND (conflict_old IS NULL)
- AND (conflict_new IS NULL) AND (conflict_working IS NULL))
+ AND (conflict_new IS NULL) AND (conflict_working IS NULL)
+ AND (conflict_data IS NULL))
-- STMT_SELECT_ACTUAL_CHILDREN_TREE_CONFLICT
SELECT local_relpath, conflict_data
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1034464&r1=1034463&r2=1034464&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Nov 12 16:40:51 2010
@@ -7867,12 +7867,8 @@ svn_wc__db_read_conflict_victims(const a
const char *local_relpath;
svn_sqlite__stmt_t *stmt;
svn_boolean_t have_row;
- apr_hash_t *found;
- apr_array_header_t *found_keys;
apr_hash_t *conflict_items;
- *victims = NULL;
-
/* The parent should be a working copy directory. */
SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_relpath, db,
local_abspath, svn_sqlite__mode_readonly,
@@ -7882,49 +7878,26 @@ svn_wc__db_read_conflict_victims(const a
/* ### This will be much easier once we have all conflicts in one
field of actual*/
- /* First look for text and property conflicts in ACTUAL */
+ /* Look for text, tree and property conflicts in ACTUAL */
SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
STMT_SELECT_ACTUAL_CONFLICT_VICTIMS));
SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
- found = apr_hash_make(result_pool);
+ *victims = apr_array_make(result_pool, 0, sizeof(const char *));
SVN_ERR(svn_sqlite__step(&have_row, stmt));
while (have_row)
{
const char *child_relpath = svn_sqlite__column_text(stmt, 0, NULL);
- const char *child_name = svn_dirent_basename(child_relpath, result_pool);
- apr_hash_set(found, child_name, APR_HASH_KEY_STRING, child_name);
+ APR_ARRAY_PUSH(*victims, const char *) =
+ svn_dirent_basename(child_relpath, result_pool);
SVN_ERR(svn_sqlite__step(&have_row, stmt));
}
SVN_ERR(svn_sqlite__reset(stmt));
- /* And add tree conflicts */
- SVN_ERR(read_all_tree_conflicts(&conflict_items, pdh, local_relpath,
- scratch_pool, scratch_pool));
-
- if (conflict_items)
- {
- apr_hash_index_t *hi;
-
- for(hi = apr_hash_first(scratch_pool, conflict_items);
- hi;
- hi = apr_hash_next(hi))
- {
- const char *child_name =
- svn_dirent_basename(svn__apr_hash_index_key(hi), result_pool);
-
- /* Using a hash avoids duplicates */
- apr_hash_set(found, child_name, APR_HASH_KEY_STRING, child_name);
- }
- }
-
- SVN_ERR(svn_hash_keys(&found_keys, found, result_pool));
- *victims = found_keys;
-
return SVN_NO_ERROR;
}