aboutsummaryrefslogtreecommitdiffstats
path: root/subversion/libsvn_wc/wc_db.c
diff options
context:
space:
mode:
Diffstat (limited to 'subversion/libsvn_wc/wc_db.c')
-rw-r--r--subversion/libsvn_wc/wc_db.c119
1 files changed, 103 insertions, 16 deletions
diff --git a/subversion/libsvn_wc/wc_db.c b/subversion/libsvn_wc/wc_db.c
index bc87b2f9d8d9..c76a8b1b9447 100644
--- a/subversion/libsvn_wc/wc_db.c
+++ b/subversion/libsvn_wc/wc_db.c
@@ -2374,7 +2374,7 @@ db_base_remove(svn_wc__db_wcroot_t *wcroot,
/* For file externals we only want to place a not present marker
if there is a BASE parent */
-
+
svn_relpath_split(&parent_local_relpath, &name, local_relpath,
scratch_pool);
@@ -6702,7 +6702,7 @@ svn_wc__db_op_mark_resolved_internal(svn_wc__db_wcroot_t *wcroot,
return SVN_NO_ERROR;
conflicts = svn_skel__parse(conflict_data, conflict_len, scratch_pool);
-
+
SVN_ERR(svn_wc__conflict_skel_resolve(&resolved_all, conflicts,
db, wcroot->abspath,
@@ -6839,7 +6839,7 @@ revert_maybe_raise_moved_away(svn_wc__db_wcroot_t * wcroot,
}
SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action,
- NULL,
+ NULL, NULL,
db, wcroot->abspath,
conflict,
scratch_pool,
@@ -7991,7 +7991,7 @@ struct op_delete_baton_t {
* Note that the following sequence results in the same DB state:
* mv A B; mv B/F B/G
* We do not care about the order the moves were performed in.
- * For details, see http://wiki.apache.org/subversion/MultiLayerMoves
+ * For details, see https://cwiki.apache.org/confluence/display/SVN/MultiLayerMoves
*/
struct moved_node_t {
/* The source of the move. */
@@ -8396,7 +8396,7 @@ delete_node(void *baton,
scratch_pool, iterpool));
if (!mn->local_relpath)
- svn_sort__array_delete(moved_nodes, i--, 1);
+ SVN_ERR(svn_sort__array_delete2(moved_nodes, i--, 1));
}
}
@@ -10804,7 +10804,7 @@ db_read_inherited_props(apr_array_header_t **inherited_props,
iprop_elt->prop_hash = node_props;
/* Build the output array in depth-first order. */
- svn_sort__array_insert(iprops, &iprop_elt, 0);
+ SVN_ERR(svn_sort__array_insert2(iprops, &iprop_elt, 0));
}
}
}
@@ -10840,7 +10840,7 @@ db_read_inherited_props(apr_array_header_t **inherited_props,
/* If we didn't filter everything then keep this iprop. */
if (apr_hash_count(cached_iprop->prop_hash))
- svn_sort__array_insert(iprops, &cached_iprop, 0);
+ SVN_ERR(svn_sort__array_insert2(iprops, &cached_iprop, 0));
}
}
@@ -16525,8 +16525,8 @@ db_process_commit_queue(svn_wc__db_t *db,
iterpool),
iterpool, iterpool));
- lock_remove_txn(queue->wcroot, cqi->local_relpath, work_item,
- iterpool);
+ SVN_ERR(lock_remove_txn(queue->wcroot, cqi->local_relpath,
+ work_item, iterpool));
}
if (cqi->remove_changelist)
SVN_ERR(svn_wc__db_op_set_changelist(db,
@@ -16578,12 +16578,12 @@ svn_wc__db_process_commit_queue(svn_wc__db_t *db,
}
svn_error_t *
-svn_wc__find_repos_node_in_wc(apr_array_header_t **local_abspath_list,
- svn_wc__db_t *db,
- const char *wri_abspath,
- const char *repos_relpath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
+svn_wc__db_find_repos_node_in_wc(apr_array_header_t **local_abspath_list,
+ svn_wc__db_t *db,
+ const char *wri_abspath,
+ const char *repos_relpath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_wc__db_wcroot_t *wcroot;
const char *wri_relpath;
@@ -16616,7 +16616,94 @@ svn_wc__find_repos_node_in_wc(apr_array_header_t **local_abspath_list,
SVN_ERR(svn_sqlite__step(&have_row, stmt));
}
-
+
+ return svn_error_trace(svn_sqlite__reset(stmt));
+}
+
+svn_error_t *
+svn_wc__db_find_working_nodes_with_basename(apr_array_header_t **local_abspaths,
+ svn_wc__db_t *db,
+ const char *wri_abspath,
+ const char *basename,
+ svn_node_kind_t kind,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ svn_wc__db_wcroot_t *wcroot;
+ const char *wri_relpath;
+ svn_sqlite__stmt_t *stmt;
+ svn_boolean_t have_row;
+
+ SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
+
+ SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &wri_relpath, db,
+ wri_abspath, scratch_pool,
+ scratch_pool));
+ VERIFY_USABLE_WCROOT(wcroot);
+
+ SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+ STMT_SELECT_PRESENT_HIGHEST_WORKING_NODES_BY_BASENAME_AND_KIND));
+ SVN_ERR(svn_sqlite__bindf(stmt, "ist", wcroot->wc_id, basename,
+ kind_map, kind));
+ SVN_ERR(svn_sqlite__step(&have_row, stmt));
+
+ *local_abspaths = apr_array_make(result_pool, 1, sizeof(const char *));
+
+ while (have_row)
+ {
+ const char *local_relpath;
+ const char *local_abspath;
+
+ local_relpath = svn_sqlite__column_text(stmt, 1, NULL);
+ local_abspath = svn_dirent_join(wcroot->abspath, local_relpath,
+ result_pool);
+ APR_ARRAY_PUSH(*local_abspaths, const char *) = local_abspath;
+ SVN_ERR(svn_sqlite__step(&have_row, stmt));
+ }
+
return svn_error_trace(svn_sqlite__reset(stmt));
}
+svn_error_t *
+svn_wc__db_find_copies_of_repos_path(apr_array_header_t **local_abspaths,
+ svn_wc__db_t *db,
+ const char *wri_abspath,
+ const char *repos_relpath,
+ svn_node_kind_t kind,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ svn_wc__db_wcroot_t *wcroot;
+ const char *wri_relpath;
+ svn_sqlite__stmt_t *stmt;
+ svn_boolean_t have_row;
+
+ SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
+
+ SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &wri_relpath, db,
+ wri_abspath, scratch_pool,
+ scratch_pool));
+ VERIFY_USABLE_WCROOT(wcroot);
+
+ SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+ STMT_SELECT_COPIES_OF_REPOS_RELPATH));
+ SVN_ERR(svn_sqlite__bindf(stmt, "ist", wcroot->wc_id, repos_relpath,
+ kind_map, kind));
+ SVN_ERR(svn_sqlite__step(&have_row, stmt));
+
+ *local_abspaths = apr_array_make(result_pool, 1, sizeof(const char *));
+
+ while (have_row)
+ {
+ const char *local_relpath;
+ const char *local_abspath;
+
+ local_relpath = svn_sqlite__column_text(stmt, 0, NULL);
+ local_abspath = svn_dirent_join(wcroot->abspath, local_relpath,
+ result_pool);
+ APR_ARRAY_PUSH(*local_abspaths, const char *) = local_abspath;
+ SVN_ERR(svn_sqlite__step(&have_row, stmt));
+ }
+
+ return svn_error_trace(svn_sqlite__reset(stmt));
+}