You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2015/09/17 16:09:48 UTC

svn commit: r1703630 - in /subversion/trunk/subversion: include/svn_client.h libsvn_client/resolved.c

Author: stsp
Date: Thu Sep 17 14:09:48 2015
New Revision: 1703630

URL: http://svn.apache.org/r1703630
Log:
Remove svn_client_conflict_walk() again. It is unused.

Clients are now expected to implement their own walker, as 'svn' does.

* subversion/include/svn_client.h
  (svn_client_conflict_walk_func_t, svn_client_conflict_walk): Remove.

* subversion/libsvn_client/resolved.c
  (conflict_resolver_baton_t, conflict_resolver_func, 
  svn_client_conflict_walk): Remove.

Modified:
    subversion/trunk/subversion/include/svn_client.h
    subversion/trunk/subversion/libsvn_client/resolved.c

Modified: subversion/trunk/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_client.h?rev=1703630&r1=1703629&r2=1703630&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_client.h (original)
+++ subversion/trunk/subversion/include/svn_client.h Thu Sep 17 14:09:48 2015
@@ -4451,37 +4451,6 @@ svn_client_conflict_from_wc_description2
   apr_pool_t *scratch_pool);
 
 /**
- * Callback for svn_client_conflict_walk_conflicts();
- * 
- * @since New in 1.10.
- */
-typedef svn_error_t *(svn_client_conflict_walk_func_t)(
-  void *baton,
-  svn_client_conflict_t *conflict,
-  apr_pool_t *scratch_pool);
-
-/**
- * Walk all conflicts within the specified @a depth of @a local_abspath.
- * Pass each conflict found during the walk to the @conflict_walk_func
- * callback, along with @a conflict_walk_func_baton.
- * Use cancellation and notification support provided by client context @a ctx.
- * 
- * This callback may choose to resolve the conflict. If the act of resolving
- * a conflict creates new conflicts within the walked working copy (as might
- * be the case for some tree conflicts), the callback will be invoked for each
- * such new conflict as well.
- * 
- * @since New in 1.10.
- */
-svn_error_t *
-svn_client_conflict_walk(const char *local_abspath,
-                         svn_depth_t depth,
-                         svn_client_conflict_walk_func_t conflict_walk_func,
-                         void *conflict_walk_func_baton,
-                         svn_client_ctx_t *ctx,
-                         apr_pool_t *scratch_pool);
-
-/**
 * Indicate the types of conflicts present on the working copy node
 * described by @a conflict. Any output argument may be @c NULL if
 * the caller is not interested in the status of a particular type.

Modified: subversion/trunk/subversion/libsvn_client/resolved.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/resolved.c?rev=1703630&r1=1703629&r2=1703630&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/resolved.c (original)
+++ subversion/trunk/subversion/libsvn_client/resolved.c Thu Sep 17 14:09:48 2015
@@ -347,123 +347,6 @@ svn_client_conflict_from_wc_description2
                                                result_pool, scratch_pool));
 }
 
-/* Baton type for conflict_resolver_func(). */
-struct conflict_resolver_baton_t {
-
-  svn_client_conflict_walk_func_t *conflict_walk_func;
-  void *conflict_walk_func_baton;
-  svn_client_ctx_t *ctx;
-};
-
-/* Implements svn_wc_conflict_resolver_func2_t for now because
- * libsvn_wc does not support our new conflict type yet. */
-static svn_error_t *
-conflict_resolver_func(svn_wc_conflict_result_t **result,
-                       const svn_wc_conflict_description2_t *description,
-                       void *baton,
-                       apr_pool_t *result_pool,
-                       apr_pool_t *scratch_pool)
-{
-  struct conflict_resolver_baton_t *b = baton;
-  svn_client_conflict_t *conflict;
-  const char *local_abspath;
-  svn_client_conflict_option_id_t resolution;
-  svn_wc_conflict_choice_t conflict_choice;
-
-  local_abspath = description->local_abspath;
-  SVN_ERR(svn_client_conflict_get(&conflict, local_abspath, b->ctx,
-                                  scratch_pool, scratch_pool));
-
-  SVN_ERR(b->conflict_walk_func(b->conflict_walk_func_baton,
-                                conflict, scratch_pool));
-
-  /* Evaluate the conflict callback result based on which kind
-   * of conflict libsvn_wc has given us. */
-  resolution = svn_client_conflict_option_undefined;
-  if (description->kind == svn_wc_conflict_kind_text)
-    resolution = conflict->resolution_text;
-  else if (description->kind == svn_wc_conflict_kind_tree)
-    resolution = conflict->resolution_tree;
-  else if (description->kind == svn_wc_conflict_kind_property)
-    {
-      svn_client_conflict_option_t *option;
-
-      option = svn_hash_gets(conflict->resolved_props,
-                             description->property_name);
-      if (option == NULL)
-        return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
-                                 _("No resolution provided for conflicted "
-                                   "property '%s' on path '%s'"),
-                                 description->property_name,
-                                 svn_dirent_local_style(local_abspath,
-                                                        scratch_pool));
-
-      resolution = svn_client_conflict_option_get_id(option);
-      conflict_choice = conflict_option_id_to_wc_conflict_choice(resolution);
-      *result = svn_wc_create_conflict_result(conflict_choice, NULL,
-                                              result_pool);
-      if (resolution == svn_client_conflict_option_merged_text)
-        (*result)->merged_value = option->type_data.prop.merged_propval;
-        
-      return SVN_NO_ERROR;
-    }
-  else
-    return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
-                             _("Unknown legacy conflict kind '%d'"),
-                             description->kind);
-
-  if (resolution == svn_client_conflict_option_undefined)
-    return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
-                             _("No resolution for conflicted path '%s'"),
-                             svn_dirent_local_style(local_abspath,
-                                                    scratch_pool));
-
-  conflict_choice = conflict_option_id_to_wc_conflict_choice(resolution);
-  *result = svn_wc_create_conflict_result(conflict_choice, NULL, result_pool);
-
-  return SVN_NO_ERROR;
-}
-
-svn_error_t *
-svn_client_conflict_walk(const char *local_abspath,
-                         svn_depth_t depth,
-                         svn_client_conflict_walk_func_t conflict_walk_func,
-                         void *conflict_walk_func_baton,
-                         svn_client_ctx_t *ctx,
-                         apr_pool_t *scratch_pool)
-{
-  struct conflict_resolver_baton_t b;
-  const char *lock_abspath;
-  svn_error_t *err;
-
-  b.conflict_walk_func = conflict_walk_func;
-  b.conflict_walk_func_baton = conflict_walk_func_baton;
-  b.ctx = ctx;
-
-  SVN_ERR(svn_wc__acquire_write_lock_for_resolve(&lock_abspath, ctx->wc_ctx,
-                                                 local_abspath,
-                                                 scratch_pool, scratch_pool));
-  /* ### TODO: svn_wc__resolve_conflicts() should be changed to support
-   * ### iteration without relying on svn_wc_conflict_resolver_func2_t */
-  err = svn_wc__resolve_conflicts(ctx->wc_ctx, local_abspath,
-                                  depth,
-                                  TRUE /* resolve_text */,
-                                  "" /* resolve_prop (ALL props) */,
-                                  TRUE /* resolve_tree */,
-                                  svn_wc_conflict_choose_unspecified,
-                                  conflict_resolver_func, &b,
-                                  ctx->cancel_func, ctx->cancel_baton,
-                                  ctx->notify_func2, ctx->notify_baton2,
-                                  scratch_pool);
-
-  err = svn_error_compose_create(err, svn_wc__release_write_lock(ctx->wc_ctx,
-                                                                 lock_abspath,
-                                                                 scratch_pool));
-  svn_io_sleep_for_timestamps(local_abspath, scratch_pool);
-
-  return svn_error_trace(err);
-}
-
 void
 svn_client_conflict_option_set_merged_propval(
   svn_client_conflict_option_t *option,