Author: stsp
Date: Mon Aug 25 14:55:42 2014
New Revision: 1620332

URL: http://svn.apache.org/r1620332
Log:
Remove the special obstructed-add handler from svn's conflict callback.
It doesn't work with the current libsvn_wc implementation. The "mf" and
"tf" options it offers error out with "tree conflicts can only be resolved
to working state".

The only remaining way to trigger this handler was by merging an addition
of a file on top of a directory (or vice versa).
This case is now handled by the generic tree conflict code, which doesn't
offer the unsupported options:
     > local dir obstruction, incoming file add upon merge
  Select: (r) mark resolved, (p) postpone, (q) quit resolution, (h) help:

* subversion/svn/conflict-callbacks.c
  (obstructed_add_options, handle_obstructed_add): Remove.
  (conflict_func_interactive): Stop calling handle_obstructed_add(). 

Modified:
    subversion/trunk/subversion/svn/conflict-callbacks.c

Modified: subversion/trunk/subversion/svn/conflict-callbacks.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/conflict-callbacks.c?rev=1620332&r1=1620331&r2=1620332&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/conflict-callbacks.c (original)
+++ subversion/trunk/subversion/svn/conflict-callbacks.c Mon Aug 25 14:55:42 
2014
@@ -487,25 +487,6 @@ static const resolver_option_t prop_conf
   { NULL }
 };
 
-/* Resolver options for an obstructued addition */
-static const resolver_option_t obstructed_add_options[] =
-{
-  { "mf", N_("my version"),       N_("accept pre-existing item (ignore "
-                                     "upstream addition)  [mine-full]"),
-                                  svn_wc_conflict_choose_mine_full },
-  { "tf", N_("their version"),    N_("accept incoming item (overwrite "
-                                     "pre-existing item)  [theirs-full]"),
-                                  svn_wc_conflict_choose_theirs_full },
-  { "p",  N_("postpone"),         N_("mark the conflict to be resolved later"
-                                     "  [postpone]"),
-                                  svn_wc_conflict_choose_postpone },
-  { "q",  N_("quit resolution"),  N_("postpone all remaining conflicts"),
-                                  svn_wc_conflict_choose_postpone },
-  { "h",  N_("help"),             N_("show this help (also '?')"),
-                                  svn_wc_conflict_choose_undefined },
-  { NULL }
-};
-
 /* Resolver options for a tree conflict */
 static const resolver_option_t tree_conflict_options[] =
 {
@@ -1148,56 +1129,6 @@ handle_tree_conflict(svn_wc_conflict_res
   return SVN_NO_ERROR;
 }
 
-/* Ask the user what to do about the obstructed add described by DESC.
- * Return the answer in RESULT. B is the conflict baton for this
- * conflict resolution session.
- * SCRATCH_POOL is used for temporary allocations. */
-static svn_error_t *
-handle_obstructed_add(svn_wc_conflict_result_t *result,
-                      const svn_wc_conflict_description2_t *desc,
-                      svn_cl__interactive_conflict_baton_t *b,
-                      apr_pool_t *scratch_pool)
-{
-  apr_pool_t *iterpool;
-
-  SVN_ERR(svn_cmdline_fprintf(
-               stderr, scratch_pool,
-               _("Conflict discovered when trying to add '%s'.\n"
-                 "An object of the same name already exists.\n"),
-               svn_cl__local_style_skip_ancestor(b->path_prefix,
-                                                 desc->local_abspath,
-                                                 scratch_pool)));
-
-  iterpool = svn_pool_create(scratch_pool);
-  while (1)
-    {
-      const resolver_option_t *opt;
-
-      svn_pool_clear(iterpool);
-
-      SVN_ERR(prompt_user(&opt, obstructed_add_options, NULL, b->pb,
-                          iterpool));
-      if (! opt)
-        continue;
-
-      if (strcmp(opt->code, "q") == 0)
-        {
-          result->choice = opt->choice;
-          b->accept_which = svn_cl__accept_postpone;
-          b->quit = TRUE;
-          break;
-        }
-      else if (opt->choice != svn_wc_conflict_choose_undefined)
-        {
-          result->choice = opt->choice;
-          break;
-        }
-    }
-  svn_pool_destroy(iterpool);
-
-  return SVN_NO_ERROR;
-}
-
 /* The body of svn_cl__conflict_func_interactive(). */
 static svn_error_t *
 conflict_func_interactive(svn_wc_conflict_result_t **result,
@@ -1341,29 +1272,6 @@ conflict_func_interactive(svn_wc_conflic
     SVN_ERR(handle_text_conflict(*result, desc, b, scratch_pool));
   else if (desc->kind == svn_wc_conflict_kind_property)
     SVN_ERR(handle_prop_conflict(*result, desc, b, result_pool, scratch_pool));
-
-  /*
-    Dealing with obstruction of additions can be tricky.  The
-    obstructing item could be unversioned, versioned, or even
-    schedule-add.  Here's a matrix of how the caller should behave,
-    based on results we return.
-
-                         Unversioned       Versioned       Schedule-Add
-
-      choose_mine       skip addition,    skip addition     skip addition
-                        add existing item
-
-      choose_theirs     destroy file,    schedule-delete,   revert add,
-                        add new item.    add new item.      rm file,
-                                                            add new item
-
-      postpone               [              bail out                 ]
-
-   */
-  else if ((desc->action == svn_wc_conflict_action_add)
-           && (desc->reason == svn_wc_conflict_reason_obstructed))
-    SVN_ERR(handle_obstructed_add(*result, desc, b, scratch_pool));
-
   else if (desc->kind == svn_wc_conflict_kind_tree)
     SVN_ERR(handle_tree_conflict(*result, desc, b, scratch_pool));
 


Reply via email to