summaryrefslogtreecommitdiff
path: root/subversion/libsvn_wc/info.c
diff options
context:
space:
mode:
Diffstat (limited to 'subversion/libsvn_wc/info.c')
-rw-r--r--subversion/libsvn_wc/info.c163
1 files changed, 69 insertions, 94 deletions
diff --git a/subversion/libsvn_wc/info.c b/subversion/libsvn_wc/info.c
index dc80ee7..78e5d7f 100644
--- a/subversion/libsvn_wc/info.c
+++ b/subversion/libsvn_wc/info.c
@@ -52,7 +52,7 @@ svn_wc_info_dup(const svn_wc_info_t *info,
for (i = 0; i < info->conflicts->nelts; i++)
{
APR_ARRAY_PUSH(new_conflicts, svn_wc_conflict_description2_t *)
- = svn_wc__conflict_description2_dup(
+ = svn_wc_conflict_description2_dup(
APR_ARRAY_IDX(info->conflicts, i,
const svn_wc_conflict_description2_t *),
pool);
@@ -141,7 +141,6 @@ build_info_for_node(svn_wc__info2_t **info,
{
/* Root or child of copy */
tmpinfo->rev = original_revision;
- repos_relpath = original_repos_relpath;
if (op_root)
{
@@ -167,34 +166,6 @@ build_info_for_node(svn_wc__info2_t **info,
}
}
}
- else if (op_root)
- {
- /* Local addition */
- SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, &repos_relpath,
- &tmpinfo->repos_root_URL,
- &tmpinfo->repos_UUID,
- NULL, NULL, NULL, NULL,
- db, local_abspath,
- result_pool, scratch_pool));
-
- if (have_base)
- SVN_ERR(svn_wc__db_base_get_info(NULL, NULL, &tmpinfo->rev, NULL,
- NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL,
- NULL, NULL,
- db, local_abspath,
- scratch_pool, scratch_pool));
- }
- else
- {
- /* Child of copy. ### Not WC-NG like */
- SVN_ERR(svn_wc__internal_get_origin(NULL, &tmpinfo->rev,
- &repos_relpath,
- &tmpinfo->repos_root_URL,
- &tmpinfo->repos_UUID, NULL,
- db, local_abspath, TRUE,
- result_pool, scratch_pool));
- }
/* ### We should be able to avoid both these calls with the information
from read_info() in most cases */
@@ -222,14 +193,20 @@ build_info_for_node(svn_wc__info2_t **info,
else
wc_info->schedule = svn_wc_schedule_add;
}
- SVN_ERR(svn_wc__db_read_url(&tmpinfo->URL, db, local_abspath,
- result_pool, scratch_pool));
+ SVN_ERR(svn_wc__db_read_repos_info(NULL, &repos_relpath,
+ &tmpinfo->repos_root_URL,
+ &tmpinfo->repos_UUID,
+ db, local_abspath,
+ result_pool, scratch_pool));
+
+ tmpinfo->URL = svn_path_url_add_component2(tmpinfo->repos_root_URL,
+ repos_relpath, result_pool);
}
else if (status == svn_wc__db_status_deleted)
{
- const char *work_del_abspath;
+ svn_wc__db_status_t w_status;
- SVN_ERR(svn_wc__db_read_pristine_info(NULL, NULL,
+ SVN_ERR(svn_wc__db_read_pristine_info(&w_status, &tmpinfo->kind,
&tmpinfo->last_changed_rev,
&tmpinfo->last_changed_date,
&tmpinfo->last_changed_author,
@@ -239,51 +216,32 @@ build_info_for_node(svn_wc__info2_t **info,
db, local_abspath,
result_pool, scratch_pool));
+ if (w_status == svn_wc__db_status_deleted)
+ {
+ /* We have a working not-present status. We don't know anything
+ about this node, but it *is visible* in STATUS.
+
+ Let's tell that it is excluded */
+
+ wc_info->depth = svn_depth_exclude;
+ tmpinfo->kind = svn_node_unknown;
+ }
+
/* And now fetch the url and revision of what will be deleted */
SVN_ERR(svn_wc__db_scan_deletion(NULL, &wc_info->moved_to_abspath,
- &work_del_abspath, NULL,
+ NULL, NULL,
db, local_abspath,
scratch_pool, scratch_pool));
- if (work_del_abspath != NULL)
- {
- /* This is a deletion within a copied subtree. Get the copied-from
- * revision. */
- const char *added_abspath = svn_dirent_dirname(work_del_abspath,
- scratch_pool);
-
- SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, &repos_relpath,
- &tmpinfo->repos_root_URL,
- &tmpinfo->repos_UUID,
- NULL, NULL, NULL,
- &tmpinfo->rev,
- db, added_abspath,
- result_pool, scratch_pool));
-
- tmpinfo->URL = svn_path_url_add_component2(
- tmpinfo->repos_root_URL,
- svn_relpath_join(repos_relpath,
- svn_dirent_skip_ancestor(added_abspath,
- local_abspath),
- scratch_pool),
- result_pool);
- }
- else
- {
- SVN_ERR(svn_wc__db_base_get_info(NULL, NULL, &tmpinfo->rev,
- &repos_relpath,
- &tmpinfo->repos_root_URL,
- &tmpinfo->repos_UUID, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- db, local_abspath,
- result_pool, scratch_pool));
-
- tmpinfo->URL = svn_path_url_add_component2(tmpinfo->repos_root_URL,
- repos_relpath,
- result_pool);
- }
+
+ SVN_ERR(svn_wc__db_read_repos_info(&tmpinfo->rev, &repos_relpath,
+ &tmpinfo->repos_root_URL,
+ &tmpinfo->repos_UUID,
+ db, local_abspath,
+ result_pool, scratch_pool));
wc_info->schedule = svn_wc_schedule_delete;
+ tmpinfo->URL = svn_path_url_add_component2(tmpinfo->repos_root_URL,
+ repos_relpath, result_pool);
}
else if (status == svn_wc__db_status_not_present
|| status == svn_wc__db_status_server_excluded)
@@ -291,6 +249,21 @@ build_info_for_node(svn_wc__info2_t **info,
*info = NULL;
return SVN_NO_ERROR;
}
+ else if (status == svn_wc__db_status_excluded && !repos_relpath)
+ {
+ /* We have a WORKING exclude. Avoid segfault on no repos info */
+
+ SVN_ERR(svn_wc__db_read_repos_info(NULL, &repos_relpath,
+ &tmpinfo->repos_root_URL,
+ &tmpinfo->repos_UUID,
+ db, local_abspath,
+ result_pool, scratch_pool));
+
+ wc_info->schedule = svn_wc_schedule_normal;
+ tmpinfo->URL = svn_path_url_add_component2(tmpinfo->repos_root_URL,
+ repos_relpath, result_pool);
+ tmpinfo->wc_info->depth = svn_depth_exclude;
+ }
else
{
/* Just a BASE node. We have all the info we need */
@@ -298,10 +271,10 @@ build_info_for_node(svn_wc__info2_t **info,
repos_relpath,
result_pool);
wc_info->schedule = svn_wc_schedule_normal;
- }
- if (status == svn_wc__db_status_excluded)
- tmpinfo->wc_info->depth = svn_depth_exclude;
+ if (status == svn_wc__db_status_excluded)
+ wc_info->depth = svn_depth_exclude;
+ }
/* A default */
tmpinfo->size = SVN_INVALID_FILESIZE;
@@ -310,9 +283,10 @@ build_info_for_node(svn_wc__info2_t **info,
local_abspath, result_pool, scratch_pool));
if (conflicted)
- SVN_ERR(svn_wc__read_conflicts(&wc_info->conflicts, db,
- local_abspath,
- TRUE /* ### create tempfiles */,
+ SVN_ERR(svn_wc__read_conflicts(&wc_info->conflicts, NULL,
+ db, local_abspath,
+ FALSE /* create tempfiles */,
+ FALSE /* only tree conflicts */,
result_pool, scratch_pool));
else
wc_info->conflicts = NULL;
@@ -373,7 +347,7 @@ struct found_entry_baton
svn_boolean_t actual_only;
svn_boolean_t first;
/* The set of tree conflicts that have been found but not (yet) visited by
- * the tree walker. Map of abspath -> svn_wc_conflict_description2_t. */
+ * the tree walker. Map of abspath -> empty string. */
apr_hash_t *tree_conflicts;
apr_pool_t *pool;
};
@@ -533,9 +507,10 @@ svn_wc__get_info(svn_wc_context_t *wc_ctx,
for (hi = apr_hash_first(scratch_pool, fe_baton.tree_conflicts); hi;
hi = apr_hash_next(hi))
{
- const char *this_abspath = svn__apr_hash_index_key(hi);
+ const char *this_abspath = apr_hash_this_key(hi);
const svn_wc_conflict_description2_t *tree_conflict;
svn_wc__info2_t *info;
+ const apr_array_header_t *conflicts;
svn_pool_clear(iterpool);
@@ -543,35 +518,35 @@ svn_wc__get_info(svn_wc_context_t *wc_ctx,
if (!repos_root_url)
{
- SVN_ERR(svn_wc__internal_get_repos_info(NULL, NULL,
- &repos_root_url,
- &repos_uuid,
- wc_ctx->db,
- svn_dirent_dirname(
+ SVN_ERR(svn_wc__db_read_repos_info(NULL, NULL,
+ &repos_root_url,
+ &repos_uuid,
+ wc_ctx->db,
+ svn_dirent_dirname(
this_abspath,
iterpool),
- scratch_pool,
- iterpool));
+ scratch_pool, iterpool));
}
info->repos_root_URL = repos_root_url;
info->repos_UUID = repos_uuid;
- SVN_ERR(svn_wc__read_conflicts(&info->wc_info->conflicts,
+ SVN_ERR(svn_wc__read_conflicts(&conflicts, NULL,
wc_ctx->db, this_abspath,
- TRUE /* ### create tempfiles */,
+ FALSE /* create tempfiles */,
+ FALSE /* only tree conflicts */,
iterpool, iterpool));
-
- if (! info->wc_info->conflicts || ! info->wc_info->conflicts->nelts)
+ if (! conflicts || ! conflicts->nelts)
continue;
- tree_conflict = APR_ARRAY_IDX(info->wc_info->conflicts, 0,
- svn_wc_conflict_description2_t *);
+ tree_conflict = APR_ARRAY_IDX(conflicts, 0,
+ const svn_wc_conflict_description2_t *);
if (!depth_includes(local_abspath, depth, tree_conflict->local_abspath,
tree_conflict->node_kind, iterpool))
continue;
+ info->wc_info->conflicts = conflicts;
SVN_ERR(receiver(receiver_baton, this_abspath, info, iterpool));
}
svn_pool_destroy(iterpool);