Author: gstein
Date: Wed May 25 18:20:11 2011
New Revision: 1127617
URL: http://svn.apache.org/viewvc?rev=1127617&view=rev
Log:
Shift around some deprecated code and remove cd_to_cd2().
* subversion/include/private/svn_wc_private.h:
(svn_wc__conflict_description_dup): moved to deprecated.c and made
file-private.
(svn_wc__cd_to_cd2): removed
* subversion/libsvn_wc/wc.h:
(svn_wc__compat_notify_baton_t): moved to deprecated.c, made internal
(svn_wc__compat_call_notify_func): moved to deprecated.c and made internal
* subversion/libsvn_wc/util.c:
(svn_wc_external_item_dup): moved to deprecated.c
(svn_wc__compat_call_notify_func): moved to deprecated.c as
compat_call_notify_func().
(svn_wc__conflict_description_dup): moved to deprecated.c as
conflict_description_dup().
(svn_wc__cd_to_cd2): removed
* subversion/libsvn_wc/deprecated.c:
(struct compat_notify_baton_t): moved from wc.h
(compat_call_notify_func): moved from util.c
(svn_wc_delete, svn_wc_add, svn_wc_revert, svn_wc_resolved_conflict,
svn_wc_get_update_editor, svn_wc_get_switch_editor,
svn_wc_copy): track renames of compat_notify
(svn_wc_external_item_dup): moved here from util.c
(svn_wc_dup_status2): track rename of conflict_description_dup()
(conflict_description_dup): moved here from util.c
Modified:
subversion/trunk/subversion/include/private/svn_wc_private.h
subversion/trunk/subversion/libsvn_wc/deprecated.c
subversion/trunk/subversion/libsvn_wc/util.c
subversion/trunk/subversion/libsvn_wc/wc.h
Modified: subversion/trunk/subversion/include/private/svn_wc_private.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_wc_private.h?rev=1127617&r1=1127616&r2=1127617&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_wc_private.h Wed May 25
18:20:11 2011
@@ -170,12 +170,6 @@ svn_wc__get_all_tree_conflicts(apr_hash_
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-/** Return a duplicate of @a conflict, allocated in @a pool.
- * A deep copy of all members, except the adm_access member, will be made.
- */
-svn_wc_conflict_description_t *
-svn_wc__conflict_description_dup(const svn_wc_conflict_description_t *conflict,
- apr_pool_t *pool);
/** Like svn_wc_is_wc_root(), but it doesn't consider switched subdirs or
* deleted entries as working copy roots.
@@ -195,7 +189,10 @@ svn_wc__strictly_is_wc_root(svn_boolean_
/*
- * Convert from svn_wc_conflict_description2_t to
svn_wc_conflict_description_t.
+ * Convert from svn_wc_conflict_description2_t to
+ * svn_wc_conflict_description_t. This is needed by some backwards-compat
+ * code in libsvn_client/ctx.c
+ *
* Allocate the result in RESULT_POOL.
*/
svn_wc_conflict_description_t *
@@ -204,14 +201,6 @@ svn_wc__cd2_to_cd(const svn_wc_conflict_
/*
- * Convert from svn_wc_conflict_description_t to
svn_wc_conflict_description2_t.
- * Allocate the result in RESULT_POOL.
- */
-svn_wc_conflict_description2_t *
-svn_wc__cd_to_cd2(const svn_wc_conflict_description_t *conflict,
- apr_pool_t *result_pool);
-
-/*
* Convert from svn_wc_status3_t to svn_wc_status2_t.
* Allocate the result in RESULT_POOL.
*/
Modified: subversion/trunk/subversion/libsvn_wc/deprecated.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/deprecated.c?rev=1127617&r1=1127616&r2=1127617&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_wc/deprecated.c Wed May 25 18:20:11 2011
@@ -298,6 +298,30 @@ svn_wc_crawl_revisions2(const char *path
}
+/* Baton for compat_call_notify_func below. */
+struct compat_notify_baton_t {
+ /* Wrapped func/baton. */
+ svn_wc_notify_func_t func;
+ void *baton;
+};
+
+
+/* Implements svn_wc_notify_func2_t. Call BATON->func (BATON is of type
+ svn_wc__compat_notify_baton_t), passing BATON->baton and the appropriate
+ arguments from NOTIFY. */
+static void
+compat_call_notify_func(void *baton,
+ const svn_wc_notify_t *n,
+ apr_pool_t *pool)
+{
+ struct compat_notify_baton_t *nb = baton;
+
+ if (nb->func)
+ (*nb->func)(nb->baton, n->path, n->action, n->kind, n->mime_type,
+ n->content_state, n->prop_state, n->revision);
+}
+
+
/*** Compatibility wrapper: turns an svn_ra_reporter_t into an
svn_ra_reporter2_t.
@@ -389,7 +413,7 @@ svn_wc_crawl_revisions(const char *path,
apr_pool_t *pool)
{
struct wrap_2to1_report_baton wrb;
- svn_wc__compat_notify_baton_t nb;
+ struct compat_notify_baton_t nb;
wrb.reporter = reporter;
wrb.baton = report_baton;
@@ -399,7 +423,7 @@ svn_wc_crawl_revisions(const char *path,
return svn_wc_crawl_revisions2(path, adm_access, &wrap_2to1_reporter, &wrb,
restore_files, recurse, use_commit_times,
- svn_wc__compat_call_notify_func, &nb,
+ compat_call_notify_func, &nb,
traversal_info,
pool);
}
@@ -827,13 +851,13 @@ svn_wc_delete(const char *path,
void *notify_baton,
apr_pool_t *pool)
{
- svn_wc__compat_notify_baton_t nb;
+ struct compat_notify_baton_t nb;
nb.func = notify_func;
nb.baton = notify_baton;
return svn_wc_delete2(path, adm_access, cancel_func, cancel_baton,
- svn_wc__compat_call_notify_func, &nb, pool);
+ compat_call_notify_func, &nb, pool);
}
svn_error_t *
@@ -912,14 +936,14 @@ svn_wc_add(const char *path,
void *notify_baton,
apr_pool_t *pool)
{
- svn_wc__compat_notify_baton_t nb;
+ struct compat_notify_baton_t nb;
nb.func = notify_func;
nb.baton = notify_baton;
return svn_wc_add2(path, parent_access, copyfrom_url, copyfrom_rev,
cancel_func, cancel_baton,
- svn_wc__compat_call_notify_func, &nb, pool);
+ compat_call_notify_func, &nb, pool);
}
svn_error_t *
@@ -981,14 +1005,14 @@ svn_wc_revert(const char *path,
void *notify_baton,
apr_pool_t *pool)
{
- svn_wc__compat_notify_baton_t nb;
+ struct compat_notify_baton_t nb;
nb.func = notify_func;
nb.baton = notify_baton;
return svn_wc_revert2(path, parent_access, recursive, use_commit_times,
cancel_func, cancel_baton,
- svn_wc__compat_call_notify_func, &nb, pool);
+ compat_call_notify_func, &nb, pool);
}
svn_error_t *
@@ -1069,14 +1093,14 @@ svn_wc_resolved_conflict(const char *pat
void *notify_baton,
apr_pool_t *pool)
{
- svn_wc__compat_notify_baton_t nb;
+ struct compat_notify_baton_t nb;
nb.func = notify_func;
nb.baton = notify_baton;
return svn_wc_resolved_conflict2(path, adm_access,
resolve_text, resolve_props, recurse,
- svn_wc__compat_call_notify_func, &nb,
+ compat_call_notify_func, &nb,
NULL, NULL, pool);
}
@@ -2628,7 +2652,9 @@ svn_wc_get_status_editor3(const svn_delt
svn_wc_traversal_info_t *traversal_info,
apr_pool_t *pool)
{
+ /* This baton must live beyond this function. Alloc on heap. */
struct status_editor3_compat_baton *secb = apr_palloc(pool, sizeof(*secb));
+
secb->old_func = status_func;
secb->old_baton = status_baton;
@@ -2659,6 +2685,7 @@ svn_wc_get_status_editor2(const svn_delt
apr_pool_t *pool)
{
apr_array_header_t *ignores;
+
SVN_ERR(svn_wc_get_default_ignores(&ignores, config, pool));
return svn_wc_get_status_editor3(editor,
edit_baton,
@@ -2742,6 +2769,44 @@ svn_wc_status(svn_wc_status_t **status,
return SVN_NO_ERROR;
}
+
+static svn_wc_conflict_description_t *
+conflict_description_dup(const svn_wc_conflict_description_t *conflict,
+ apr_pool_t *pool)
+{
+ svn_wc_conflict_description_t *new_conflict;
+
+ new_conflict = apr_pcalloc(pool, sizeof(*new_conflict));
+
+ /* Shallow copy all members. */
+ *new_conflict = *conflict;
+
+ if (conflict->path)
+ new_conflict->path = apr_pstrdup(pool, conflict->path);
+ if (conflict->property_name)
+ new_conflict->property_name = apr_pstrdup(pool, conflict->property_name);
+ if (conflict->mime_type)
+ new_conflict->mime_type = apr_pstrdup(pool, conflict->mime_type);
+ /* NOTE: We cannot make a deep copy of adm_access. */
+ if (conflict->base_file)
+ new_conflict->base_file = apr_pstrdup(pool, conflict->base_file);
+ if (conflict->their_file)
+ new_conflict->their_file = apr_pstrdup(pool, conflict->their_file);
+ if (conflict->my_file)
+ new_conflict->my_file = apr_pstrdup(pool, conflict->my_file);
+ if (conflict->merged_file)
+ new_conflict->merged_file = apr_pstrdup(pool, conflict->merged_file);
+ if (conflict->src_left_version)
+ new_conflict->src_left_version =
+ svn_wc_conflict_version_dup(conflict->src_left_version, pool);
+ if (conflict->src_right_version)
+ new_conflict->src_right_version =
+ svn_wc_conflict_version_dup(conflict->src_right_version, pool);
+
+ return new_conflict;
+}
+
+
svn_wc_status2_t *
svn_wc_dup_status2(const svn_wc_status2_t *orig_stat,
apr_pool_t *pool)
@@ -2767,7 +2832,7 @@ svn_wc_dup_status2(const svn_wc_status2_
if (orig_stat->tree_conflict)
new_stat->tree_conflict
- = svn_wc__conflict_description_dup(orig_stat->tree_conflict, pool);
+ = conflict_description_dup(orig_stat->tree_conflict, pool);
/* Return the new hotness. */
return new_stat;
@@ -3156,14 +3221,16 @@ svn_wc_get_update_editor(svn_revnum_t *t
svn_wc_traversal_info_t *traversal_info,
apr_pool_t *pool)
{
- svn_wc__compat_notify_baton_t *nb = apr_palloc(pool, sizeof(*nb));
+ /* This baton must live beyond this function. Alloc on heap. */
+ struct compat_notify_baton_t *nb = apr_palloc(pool, sizeof(*nb));
+
nb->func = notify_func;
nb->baton = notify_baton;
return svn_wc_get_update_editor3(target_revision, anchor, target,
use_commit_times,
SVN_DEPTH_INFINITY_OR_FILES(recurse), FALSE,
- FALSE, svn_wc__compat_call_notify_func, nb,
+ FALSE, compat_call_notify_func, nb,
cancel_func, cancel_baton, NULL, NULL,
NULL, NULL,
diff3_cmd, NULL, editor, edit_baton,
@@ -3291,20 +3358,41 @@ svn_wc_get_switch_editor(svn_revnum_t *t
svn_wc_traversal_info_t *traversal_info,
apr_pool_t *pool)
{
- svn_wc__compat_notify_baton_t *nb = apr_palloc(pool, sizeof(*nb));
+ /* This baton must live beyond this function. Alloc on heap. */
+ struct compat_notify_baton_t *nb = apr_palloc(pool, sizeof(*nb));
+
nb->func = notify_func;
nb->baton = notify_baton;
return svn_wc_get_switch_editor3(target_revision, anchor, target,
switch_url, use_commit_times,
SVN_DEPTH_INFINITY_OR_FILES(recurse), FALSE,
- FALSE, svn_wc__compat_call_notify_func, nb,
+ FALSE, compat_call_notify_func, nb,
cancel_func, cancel_baton,
NULL, NULL, diff3_cmd,
NULL, editor, edit_baton, traversal_info,
pool);
}
+
+svn_wc_external_item_t *
+svn_wc_external_item_dup(const svn_wc_external_item_t *item,
+ apr_pool_t *pool)
+{
+ svn_wc_external_item_t *new_item = apr_palloc(pool, sizeof(*new_item));
+
+ *new_item = *item;
+
+ if (new_item->target_dir)
+ new_item->target_dir = apr_pstrdup(pool, new_item->target_dir);
+
+ if (new_item->url)
+ new_item->url = apr_pstrdup(pool, new_item->url);
+
+ return new_item;
+}
+
+
svn_wc_traversal_info_t *
svn_wc_init_traversal_info(apr_pool_t *pool)
{
@@ -3834,13 +3922,13 @@ svn_wc_copy(const char *src_path,
void *notify_baton,
apr_pool_t *pool)
{
- svn_wc__compat_notify_baton_t nb;
+ struct compat_notify_baton_t nb;
nb.func = notify_func;
nb.baton = notify_baton;
return svn_wc_copy2(src_path, dst_parent, dst_basename, cancel_func,
- cancel_baton, svn_wc__compat_call_notify_func,
+ cancel_baton, compat_call_notify_func,
&nb, pool);
}
Modified: subversion/trunk/subversion/libsvn_wc/util.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/util.c?rev=1127617&r1=1127616&r2=1127617&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/util.c (original)
+++ subversion/trunk/subversion/libsvn_wc/util.c Wed May 25 18:20:11 2011
@@ -156,22 +156,6 @@ svn_wc_external_item_create(const svn_wc
return SVN_NO_ERROR;
}
-svn_wc_external_item_t *
-svn_wc_external_item_dup(const svn_wc_external_item_t *item,
- apr_pool_t *pool)
-{
- svn_wc_external_item_t *new_item = apr_palloc(pool, sizeof(*new_item));
-
- *new_item = *item;
-
- if (new_item->target_dir)
- new_item->target_dir = apr_pstrdup(pool, new_item->target_dir);
-
- if (new_item->url)
- new_item->url = apr_pstrdup(pool, new_item->url);
-
- return new_item;
-}
svn_wc_external_item2_t *
svn_wc_external_item2_dup(const svn_wc_external_item2_t *item,
@@ -190,16 +174,6 @@ svn_wc_external_item2_dup(const svn_wc_e
return new_item;
}
-void svn_wc__compat_call_notify_func(void *baton,
- const svn_wc_notify_t *n,
- apr_pool_t *pool)
-{
- svn_wc__compat_notify_baton_t *nb = baton;
-
- if (nb->func)
- (*nb->func)(nb->baton, n->path, n->action, n->kind, n->mime_type,
- n->content_state, n->prop_state, n->revision);
-}
svn_boolean_t
svn_wc_match_ignore_list(const char *str, const apr_array_header_t *list,
@@ -273,41 +247,6 @@ svn_wc_conflict_description_create_tree2
return conflict;
}
-svn_wc_conflict_description_t *
-svn_wc__conflict_description_dup(const svn_wc_conflict_description_t *conflict,
- apr_pool_t *pool)
-{
- svn_wc_conflict_description_t *new_conflict;
-
- new_conflict = apr_pcalloc(pool, sizeof(*new_conflict));
-
- /* Shallow copy all members. */
- *new_conflict = *conflict;
-
- if (conflict->path)
- new_conflict->path = apr_pstrdup(pool, conflict->path);
- if (conflict->property_name)
- new_conflict->property_name = apr_pstrdup(pool, conflict->property_name);
- if (conflict->mime_type)
- new_conflict->mime_type = apr_pstrdup(pool, conflict->mime_type);
- /* NOTE: We cannot make a deep copy of adm_access. */
- if (conflict->base_file)
- new_conflict->base_file = apr_pstrdup(pool, conflict->base_file);
- if (conflict->their_file)
- new_conflict->their_file = apr_pstrdup(pool, conflict->their_file);
- if (conflict->my_file)
- new_conflict->my_file = apr_pstrdup(pool, conflict->my_file);
- if (conflict->merged_file)
- new_conflict->merged_file = apr_pstrdup(pool, conflict->merged_file);
- if (conflict->src_left_version)
- new_conflict->src_left_version =
- svn_wc_conflict_version_dup(conflict->src_left_version, pool);
- if (conflict->src_right_version)
- new_conflict->src_right_version =
- svn_wc_conflict_version_dup(conflict->src_right_version, pool);
-
- return new_conflict;
-}
svn_wc_conflict_description2_t *
svn_wc__conflict_description2_dup(const svn_wc_conflict_description2_t
*conflict,
@@ -455,69 +394,6 @@ svn_wc__cd2_to_cd(const svn_wc_conflict_
}
-svn_wc_conflict_description2_t *
-svn_wc__cd_to_cd2(const svn_wc_conflict_description_t *conflict,
- apr_pool_t *result_pool)
-{
- svn_wc_conflict_description2_t *new_conflict;
- const char *dir_abspath;
-
- if (conflict == NULL)
- return NULL;
-
- new_conflict = apr_pcalloc(result_pool, sizeof(*new_conflict));
-
- svn_error_clear(
- svn_dirent_get_absolute(&new_conflict->local_abspath, conflict->path,
- result_pool));
- new_conflict->node_kind = conflict->node_kind;
- new_conflict->kind = conflict->kind;
- new_conflict->action = conflict->action;
- new_conflict->reason = conflict->reason;
- if (conflict->src_left_version)
- new_conflict->src_left_version =
- svn_wc_conflict_version_dup(conflict->src_left_version, result_pool);
- if (conflict->src_right_version)
- new_conflict->src_right_version =
- svn_wc_conflict_version_dup(conflict->src_right_version,
result_pool);
-
- switch (conflict->kind)
- {
- case svn_wc_conflict_kind_property:
- new_conflict->property_name = apr_pstrdup(result_pool,
- conflict->property_name);
- /* Falling through. */
-
- case svn_wc_conflict_kind_text:
- dir_abspath = svn_dirent_dirname(new_conflict->local_abspath,
- result_pool);
- new_conflict->is_binary = conflict->is_binary;
- new_conflict->mime_type = conflict->mime_type
- ? apr_pstrdup(result_pool, conflict->mime_type)
- : NULL;
- new_conflict->base_abspath = svn_dirent_join(dir_abspath,
- conflict->base_file,
- result_pool);
- new_conflict->their_abspath = svn_dirent_join(dir_abspath,
- conflict->their_file,
- result_pool);
- new_conflict->my_abspath = svn_dirent_join(dir_abspath,
- conflict->my_file,
- result_pool);
- new_conflict->merged_file = conflict->merged_file
- ? apr_pstrdup(result_pool,
- conflict->merged_file)
- : NULL;
- break;
-
- case svn_wc_conflict_kind_tree:
- new_conflict->operation = conflict->operation;
- break;
- }
-
- return new_conflict;
-}
-
svn_error_t *
svn_wc__status2_from_3(svn_wc_status2_t **status,
const svn_wc_status3_t *old_status,
Modified: subversion/trunk/subversion/libsvn_wc/wc.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc.h?rev=1127617&r1=1127616&r2=1127617&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc.h Wed May 25 18:20:11 2011
@@ -348,20 +348,6 @@ svn_wc__prop_array_to_hash(const apr_arr
apr_pool_t *result_pool);
-/* Baton for svn_wc__compat_call_notify_func below. */
-typedef struct svn_wc__compat_notify_baton_t {
- /* Wrapped func/baton. */
- svn_wc_notify_func_t func;
- void *baton;
-} svn_wc__compat_notify_baton_t;
-
-/* Implements svn_wc_notify_func2_t. Call BATON->func (BATON is of type
- svn_wc__compat_notify_baton_t), passing BATON->baton and the appropriate
- arguments from NOTIFY. */
-void svn_wc__compat_call_notify_func(void *baton,
- const svn_wc_notify_t *notify,
- apr_pool_t *pool);
-
/* Set *MODIFIED_P to non-zero if LOCAL_ABSPATH's text is modified with
* regard to the base revision, else set *MODIFIED_P to zero.
*
@@ -742,8 +728,8 @@ svn_wc__perform_file_merge(svn_skel_t **
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-;
+ apr_pool_t *scratch_pool);
+
#ifdef __cplusplus
}