You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by gs...@apache.org on 2010/05/10 05:41:07 UTC
svn commit: r942652 - in /subversion/trunk/subversion/libsvn_wc:
adm_crawler.c conflicts.c conflicts.h wc.h
Author: gstein
Date: Mon May 10 03:41:06 2010
New Revision: 942652
URL: http://svn.apache.org/viewvc?rev=942652&view=rev
Log:
Simplify the code path for resolving text conflicts on a file when it is
restored.
* subversion/libsvn_wc/conflicts.h:
(svn_wc__resolve_text_conflict): new helper function to resolve text
conflicts on a file
* subversion/libsvn_wc/wc.h:
(svn_wc__internal_resolved_conflict): removed. unused.
* subversion/libsvn_wc/conflicts.c:
(resolve_conflict_on_node): initialize the DID_RESOLVE OUT param
(svn_wc__resolve_text_conflict): new helper, as a simple wrapper around
resolve_conflict_on_node
(resolve_one_conflict): remove CANCEL_FUNC/BATON. calling that within
the granularity of looping over an individual node's conflicts is way
way too much. add parameter comments on calls to lower funcs. add a
note that RESOLVE_PROP *cannot* be used to resolve a single prop
conflict.
(recursive_resolve_conflict): remove CANCEL_FUNC/BATON on call to
resolve_one_conflict
(svn_wc__internal_resolved_conflict): removed
(svn_wc_resolved_conflict5): move DEPTH adjust from
internal_resolved_conflict to here. add a check for unimplemented
RESOLVE_PROP behavior (see resolve_one_conflict comment and
resolve_conflict_on_node behavior). call recursive_resolve_conflict
directly instead of the "internal" func.
* subversion/libsvn_wc/adm_crawler.c:
(restore_file): call svn_wc__resolve_text_conflict rather than the
overpowered internal_resolved_conflict.
Modified:
subversion/trunk/subversion/libsvn_wc/adm_crawler.c
subversion/trunk/subversion/libsvn_wc/conflicts.c
subversion/trunk/subversion/libsvn_wc/conflicts.h
subversion/trunk/subversion/libsvn_wc/wc.h
Modified: subversion/trunk/subversion/libsvn_wc/adm_crawler.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_crawler.c?rev=942652&r1=942651&r2=942652&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_crawler.c Mon May 10 03:41:06 2010
@@ -48,6 +48,7 @@
#include "entries.h"
#include "lock.h"
#include "workqueue.h"
+#include "conflicts.h"
#include "svn_private_config.h"
@@ -88,12 +89,8 @@ restore_file(svn_wc__db_t *db,
scratch_pool));
/* Remove any text conflict */
- SVN_ERR(svn_wc__internal_resolved_conflict(
- db, local_abspath, svn_depth_empty, TRUE, NULL, FALSE,
- svn_wc_conflict_choose_merged, NULL, NULL, NULL, NULL,
- scratch_pool));
-
- return SVN_NO_ERROR;
+ return svn_error_return(svn_wc__resolve_text_conflict(db, local_abspath,
+ scratch_pool));
}
/* Try to restore LOCAL_ABSPATH of node type KIND and if successfull,
Modified: subversion/trunk/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/conflicts.c?rev=942652&r1=942651&r2=942652&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_wc/conflicts.c Mon May 10 03:41:06 2010
@@ -329,9 +329,11 @@ resolve_conflict_on_node(svn_wc__db_t *d
const char *prop_reject_file = NULL;
svn_wc__db_kind_t kind;
int i;
- const apr_array_header_t *conflicts = NULL;
+ const apr_array_header_t *conflicts;
const char *conflict_dir_abspath;
+ *did_resolve = FALSE;
+
SVN_ERR(svn_wc__db_read_info(NULL, &kind, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -488,6 +490,24 @@ resolve_conflict_on_node(svn_wc__db_t *d
return SVN_NO_ERROR;
}
+
+svn_error_t *
+svn_wc__resolve_text_conflict(svn_wc__db_t *db,
+ const char *local_abspath,
+ apr_pool_t *scratch_pool)
+{
+ svn_boolean_t ignored_result;
+
+ return svn_error_return(resolve_conflict_on_node(
+ db, local_abspath,
+ TRUE /* resolve_text */,
+ FALSE /* resolve_props */,
+ svn_wc_conflict_choose_merged,
+ &ignored_result,
+ scratch_pool));
+}
+
+
/* */
static svn_error_t *
resolve_one_conflict(svn_wc__db_t *db,
@@ -496,8 +516,6 @@ resolve_one_conflict(svn_wc__db_t *db,
const char *resolve_prop,
svn_boolean_t resolve_tree,
svn_wc_conflict_choice_t conflict_choice,
- svn_cancel_func_t cancel_func,
- void *cancel_baton,
svn_wc_notify_func2_t notify_func,
void *notify_baton,
apr_pool_t *scratch_pool)
@@ -519,9 +537,6 @@ resolve_one_conflict(svn_wc__db_t *db,
svn_pool_clear(iterpool);
- if (cancel_func)
- SVN_ERR(cancel_func(cancel_baton));
-
switch (cd->kind)
{
case svn_wc_conflict_kind_tree:
@@ -555,8 +570,8 @@ resolve_one_conflict(svn_wc__db_t *db,
SVN_ERR(resolve_conflict_on_node(db,
local_abspath,
- TRUE,
- FALSE,
+ TRUE /* resolve_text */,
+ FALSE /* resolve_props */,
conflict_choice,
&did_resolve,
iterpool));
@@ -569,6 +584,8 @@ resolve_one_conflict(svn_wc__db_t *db,
if (!resolve_prop)
break;
+ /* ### this is bogus. resolve_conflict_on_node() does not handle
+ ### individual property resolution. */
if (*resolve_prop != '\0' &&
strcmp(resolve_prop, cd->property_name) != 0)
{
@@ -579,8 +596,8 @@ resolve_one_conflict(svn_wc__db_t *db,
/* We don't have property name handling here yet :( */
SVN_ERR(resolve_conflict_on_node(db,
local_abspath,
- FALSE,
- TRUE,
+ FALSE /* resolve_text */,
+ TRUE /* resolve_props */,
conflict_choice,
&did_resolve,
iterpool));
@@ -657,7 +674,6 @@ recursive_resolve_conflict(svn_wc__db_t
resolve_prop,
resolve_tree,
conflict_choice,
- cancel_func, cancel_baton,
notify_func, notify_baton,
iterpool));
}
@@ -683,10 +699,9 @@ recursive_resolve_conflict(svn_wc__db_t
child_abspath = svn_dirent_join(local_abspath, name, iterpool);
- SVN_ERR(svn_wc__db_read_kind(&kind, db, child_abspath, TRUE, iterpool));
-
apr_hash_set(visited, name, APR_HASH_KEY_STRING, name);
+ SVN_ERR(svn_wc__db_read_kind(&kind, db, child_abspath, TRUE, iterpool));
if (kind == svn_wc__db_kind_dir && depth < svn_depth_immediates)
continue;
@@ -723,12 +738,10 @@ recursive_resolve_conflict(svn_wc__db_t
child_abspath = svn_dirent_join(local_abspath, name, iterpool);
SVN_ERR(svn_wc__db_node_hidden(&hidden, db, child_abspath, iterpool));
-
if (hidden)
continue;
SVN_ERR(svn_wc__db_read_kind(&kind, db, child_abspath, TRUE, iterpool));
-
if (kind == svn_wc__db_kind_dir && depth < svn_depth_immediates)
continue;
@@ -749,39 +762,7 @@ recursive_resolve_conflict(svn_wc__db_t
return SVN_NO_ERROR;
}
-svn_error_t *
-svn_wc__internal_resolved_conflict(svn_wc__db_t *db,
- const char *local_abspath,
- svn_depth_t depth,
- svn_boolean_t resolve_text,
- const char *resolve_prop,
- svn_boolean_t resolve_tree,
- svn_wc_conflict_choice_t conflict_choice,
- svn_cancel_func_t cancel_func,
- void *cancel_baton,
- svn_wc_notify_func2_t notify_func,
- void *notify_baton,
- apr_pool_t *scratch_pool)
-{
- /* When the implementation still used the entry walker, depth
- unknown was translated to infinity. */
- if (depth == svn_depth_unknown)
- depth = svn_depth_infinity;
- return svn_error_return(
- recursive_resolve_conflict(db,
- local_abspath,
- depth,
- resolve_text,
- resolve_prop,
- resolve_tree,
- conflict_choice,
- cancel_func, cancel_baton,
- notify_func, notify_baton,
- scratch_pool));
-}
-
-/* The public function */
svn_error_t *
svn_wc_resolved_conflict5(svn_wc_context_t *wc_ctx,
const char *local_abspath,
@@ -796,15 +777,27 @@ svn_wc_resolved_conflict5(svn_wc_context
void *notify_baton,
apr_pool_t *scratch_pool)
{
- return svn_error_return(
- svn_wc__internal_resolved_conflict(wc_ctx->db,
- local_abspath,
- depth,
- resolve_text,
- resolve_prop,
- resolve_tree,
- conflict_choice,
- cancel_func, cancel_baton,
- notify_func, notify_baton,
- scratch_pool));
+ /* ### the underlying code does NOT support resolving individual
+ ### properties. bail out if the caller tries it. */
+ if (resolve_prop != NULL && *resolve_prop != '\0')
+ return svn_error_create(SVN_ERR_INCORRECT_PARAMS, NULL,
+ U_("Resolving a single property is not (yet) "
+ "supported."));
+
+ /* When the implementation still used the entry walker, depth
+ unknown was translated to infinity. */
+ if (depth == svn_depth_unknown)
+ depth = svn_depth_infinity;
+
+ return svn_error_return(recursive_resolve_conflict(
+ wc_ctx->db,
+ local_abspath,
+ depth,
+ resolve_text,
+ resolve_prop,
+ resolve_tree,
+ conflict_choice,
+ cancel_func, cancel_baton,
+ notify_func, notify_baton,
+ scratch_pool));
}
Modified: subversion/trunk/subversion/libsvn_wc/conflicts.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/conflicts.h?rev=942652&r1=942651&r2=942652&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/conflicts.h (original)
+++ subversion/trunk/subversion/libsvn_wc/conflicts.h Mon May 10 03:41:06 2010
@@ -278,6 +278,13 @@ svn_wc__conflict_skel_add_obstruction(sv
apr_pool_t *scratch_pool);
+/* Resolve text conflicts on the given node. */
+svn_error_t *
+svn_wc__resolve_text_conflict(svn_wc__db_t *db,
+ const char *local_abspath,
+ apr_pool_t *scratch_pool);
+
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
Modified: subversion/trunk/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc.h?rev=942652&r1=942651&r2=942652&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc.h Mon May 10 03:41:06 2010
@@ -586,22 +586,6 @@ svn_wc__internal_remove_from_revision_co
apr_pool_t *scratch_pool);
-/* Library-internal version of svn_wc__resolved_conflict5(). */
-svn_error_t *
-svn_wc__internal_resolved_conflict(svn_wc__db_t *db,
- const char *local_abspath,
- svn_depth_t depth,
- svn_boolean_t resolve_text,
- const char *resolve_prop,
- svn_boolean_t resolve_tree,
- svn_wc_conflict_choice_t conflict_choice,
- svn_cancel_func_t cancel_func,
- void *cancel_baton,
- svn_wc_notify_func2_t notify_func,
- void *notify_baton,
- apr_pool_t *scratch_pool);
-
-
svn_error_t *
svn_wc__internal_is_replaced(svn_boolean_t *replaced,
svn_wc__db_t *db,