You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2012/07/13 21:04:36 UTC
svn commit: r1361339 [6/14] - in /subversion/branches/master-passphrase: ./
build/generator/templates/ notes/directory-index/ notes/wc-ng/
subversion/bindings/javahl/native/
subversion/bindings/javahl/tests/org/apache/subversion/javahl/
subversion/bind...
Modified: subversion/branches/master-passphrase/subversion/libsvn_wc/conflicts.h
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_wc/conflicts.h?rev=1361339&r1=1361338&r2=1361339&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_wc/conflicts.h (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_wc/conflicts.h Fri Jul 13 19:04:32 2012
@@ -49,24 +49,44 @@ extern "C" {
#define SVN_WC__CONFLICT_KIND_REJECT "reject"
#define SVN_WC__CONFLICT_KIND_OBSTRUCTED "obstructed"
+#define SVN_WC__CONFLICT_SRC_SUBVERSION "subversion"
+/* Return a new conflict skel, allocated in RESULT_POOL.
-/* Return a new conflict skel, allocated in RESULT_POOL. */
+ Typically creating a conflict starts with calling this function and then
+ collecting details via one or more calls to svn_wc__conflict_skel_add_*().
+
+ The caller can then (when necessary) add operation details via
+ svn_wc__conflict_skel_set_op_*() and store the resulting conflict together
+ with the result of its operation in the working copy database.
+*/
svn_skel_t *
-svn_wc__conflict_skel_new(apr_pool_t *result_pool);
+svn_wc__conflict_skel_create(apr_pool_t *result_pool);
+
+/* Return a boolean in *COMPLETE indicating whether CONFLICT_SKEL contains
+ everything needed for installing in the working copy database.
+
+ This typically checks if CONFLICT_SKEL contains at least one conflict
+ and an operation.
+ */
+svn_error_t *
+svn_wc__conflict_skel_is_complete(svn_boolean_t *complete,
+ const svn_skel_t *conflict_skel);
/* Set 'update' as the conflicting operation in CONFLICT_SKEL.
Allocate data stored in the skel in RESULT_POOL.
- BASE_REVISION is the revision the node was at before the update.
- TARGET_REVISION is the revision being updated to.
+ ORIGINAL specifies the BASE node before updating.
- Do temporary allocations in SCRATCH_POOL. */
+ It is an error to set another operation to a conflict skel that
+ already has an operation.
+
+ Do temporary allocations in SCRATCH_POOL. The new skel data is
+ completely stored in RESULT-POOL. */
svn_error_t *
svn_wc__conflict_skel_set_op_update(svn_skel_t *conflict_skel,
- svn_revnum_t base_revision,
- svn_revnum_t target_revision,
+ const svn_wc_conflict_version_t *original,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
@@ -74,208 +94,296 @@ svn_wc__conflict_skel_set_op_update(svn_
/* Set 'switch' as the conflicting operation in CONFLICT_SKEL.
Allocate data stored in the skel in RESULT_POOL.
- BASE_REVISION is the revision the node was at before the switch.
- TARGET_REVISION is the revision being switched to.
- REPOS_RELPATH is the path being switched to, relative to the
- repository root.
+ ORIGINAL specifies the BASE node before switching.
+
+ It is an error to set another operation to a conflict skel that
+ already has an operation.
Do temporary allocations in SCRATCH_POOL. */
svn_error_t *
svn_wc__conflict_skel_set_op_switch(svn_skel_t *conflict_skel,
- svn_revnum_t base_revision,
- svn_revnum_t target_revision,
- const char *repos_relpath,
+ const svn_wc_conflict_version_t *original,
+ apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
/* Set 'merge' as conflicting operation in CONFLICT_SKEL.
Allocate data stored in the skel in RESULT_POOL.
- REPOS_UUID is the UUID of the repository accessed via REPOS_ROOT_URL.
+ LEFT and RIGHT paths are the merge-left and merge-right merge
+ sources of the merge.
- LEFT_REPOS_RELPATH and RIGHT_REPOS_RELPATH paths to the merge-left
- and merge-right merge sources, relative to REPOS_URL
-
- LEFT_REVISION is the merge-left revision.
- RIGHT_REVISION is the merge-right revision.
+ It is an error to set another operation to a conflict skel that
+ already has an operation.
Do temporary allocations in SCRATCH_POOL. */
svn_error_t *
svn_wc__conflict_skel_set_op_merge(svn_skel_t *conflict_skel,
- const char *repos_uuid,
- const char *repos_root_url,
- svn_revnum_t left_revision,
- const char *left_repos_relpath,
- svn_revnum_t right_revision,
- const char *right_repos_relpath,
+ const svn_wc_conflict_version_t *left,
+ const svn_wc_conflict_version_t *right,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-/* Set 'patch' as the conflicting operation in CONFLICT_SKEL.
+/* Add a text conflict to CONFLICT_SKEL.
Allocate data stored in the skel in RESULT_POOL.
- PATCH_SOURCE_LABEL is a string identifying the patch source in
- some way, for display purposes. It is usually the absolute path
- to the patch file, or a token such as "<stdin>" if the patch source
- is not a file.
+ The DB, WRI_ABSPATH pair specifies in which working copy the conflict
+ will be recorded. (Needed for making the paths relative).
+
+ MINE_ABSPATH, THEIR_OLD_ABSPATH and THEIR_ABSPATH specify the marker
+ files for this text conflict. Each of these values can be NULL to specify
+ that the node doesn't exist in this case.
+
+ ### It is expected that in a future version we will also want to store
+ ### the sha1 checksum of these files to allow reinstalling the conflict
+ ### markers from the pristine store.
+
+ It is an error to add another text conflict to a conflict skel that
+ already contains a text conflict.
Do temporary allocations in SCRATCH_POOL.
*/
svn_error_t *
-svn_wc__conflict_skel_set_op_patch(svn_skel_t *conflict_skel,
- const char *patch_source_label,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
+svn_wc__conflict_skel_add_text_conflict(svn_skel_t *conflict_skel,
+ svn_wc__db_t *db,
+ const char *wri_abspath,
+ const char *mine_abspath,
+ const char *their_old_abspath,
+ const char *their_abspath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
-/* Add a text conflict to CONFLICT_SKEL.
+/* Add property conflict details to CONFLICT_SKEL.
Allocate data stored in the skel in RESULT_POOL.
- All checksums passed should be suitable for retreiving conflicted
- versions of the file from the pristine store.
+ The DB, WRI_ABSPATH pair specifies in which working copy the conflict
+ will be recorded. (Needed for making the paths relative).
- ORIGINAL_CHECKSUM is the checksum of the BASE version of the conflicted
- file (without local modifications).
- MINE_CHECKSUM is the checksum of the WORKING version of the conflicted
- file as of the time the conflicting operation was run (i.e. including
- local modifications).
- INCOMING_CHECKSUM is the checksum of the incoming file causing the
- conflict. ### is this needed for update? what about merge?
-
- It is an error (### which one?) if no conflicting operation has been
- set on CONFLICT_SKEL before calling this function.
- It is an error (### which one?) if CONFLICT_SKEL already contains
- a text conflict.
+ The MINE_PROPS, THEIR_OLD_PROPS and THEIR_PROPS are hashes mapping a
+ const char * property name to a const svn_string_t* value.
- Do temporary allocations in SCRATCH_POOL.
-*/
-svn_error_t *
-svn_wc__conflict_skel_add_text_conflict(
- svn_skel_t *conflict_skel,
- const svn_checksum_t *original_checksum,
- const svn_checksum_t *mine_checksum,
- const svn_checksum_t *incoming_checksum,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
-
-/* Add a property conflict to SKEL.
-
- PROP_NAME is the name of the conflicted property.
-
- ORIGINAL_VALUE is the property's value at the BASE revision. MINE_VALUE
- is the property's value in WORKING (BASE + local modifications).
- INCOMING_VALUE is the incoming property value brought in by the
- operation. When merging, INCOMING_BASE_VALUE is the base value against
- which INCOMING_VALUE ws being applied. For updates, INCOMING_BASE_VALUE
- should be the same as ORIGINAL_VALUE.
-
- *_VALUE may be NULL, indicating no value was present.
-
- It is an error (### which one?) if no conflicting operation has been
- set on CONFLICT_SKEL before calling this function.
- It is an error (### which one?) if CONFLICT_SKEL already cotains
- a propery conflict for PROP_NAME.
+ The CONFLICTED_PROP_NAMES is a const char * property name value mapping
+ to "", recording which properties aren't resolved yet in the current
+ property values.
+ ### Needed for creating the marker file from this conflict data.
+ ### Would also allow per property marking as resolved.
+ ### Maybe useful for calling (legacy) conflict resolvers that expect one
+ ### property conflict per invocation.
+
+ It is an error to add another text conflict to a conflict skel that
+ already contains a text conflict.
- The conflict recorded in SKEL will be allocated from RESULT_POOL. Do
- temporary allocations in SCRATCH_POOL.
+ Do temporary allocations in SCRATCH_POOL.
*/
svn_error_t *
-svn_wc__conflict_skel_add_prop_conflict(
- svn_skel_t *skel,
- const char *prop_name,
- const svn_string_t *original_value,
- const svn_string_t *mine_value,
- const svn_string_t *incoming_value,
- const svn_string_t *incoming_base_value,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
+svn_wc__conflict_skel_add_prop_conflict(svn_skel_t *conflict_skel,
+ svn_wc__db_t *db,
+ const char *wri_abspath,
+ const char *marker_abspath,
+ apr_hash_t *mine_props,
+ apr_hash_t *their_old_props,
+ apr_hash_t *their_props,
+ apr_hash_t *conflicted_prop_names,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/* Add a tree conflict to CONFLICT_SKEL.
Allocate data stored in the skel in RESULT_POOL.
LOCAL_CHANGE is the local tree change made to the node.
- ORIGINAL_LOCAL_KIND is the kind of the local node in BASE.
- If ORIGINAL_LOCAL_KIND is svn_node_file, ORIGINAL_CHECKSUM is the checksum
- for the BASE of the file, for retrieval from the pristine store.
-
- MINE_LOCAL_KIND is the kind of the local node in WORKING at the
- time the conflict was flagged.
- If MINE_LOCAL_KIND is svn_node_file, ORIGINAL_CHECKSUM is the checksum
- of the WORKING version of the file at the time the conflict was flagged,
- for retrieval from the pristine store.
-
- INCOMING_KIND is the kind of the incoming node.
- If INCOMING_KIND is svn_node_file, INCOMING_CHECKSUM is the checksum
- of the INCOMING version of the file, for retrieval from the pristine store.
-
- It is an error (### which one?) if no conflicting operation has been
- set on CONFLICT_SKEL before calling this function.
- It is an error (### which one?) if CONFLICT_SKEL already contains
- a tree conflict.
+ INCOMING_CHANGE is the incoming change made to the node.
+
+ It is an error to add another tree conflict to a conflict skel that
+ already contains a tree conflict.
+
+ ### Is it an error to add a tree conflict to any existing conflict?
Do temporary allocations in SCRATCH_POOL.
*/
svn_error_t *
-svn_wc__conflict_skel_add_tree_conflict(
- svn_skel_t *skel,
- svn_wc_conflict_reason_t local_change,
- svn_kind_t original_local_kind,
- const svn_checksum_t *original_checksum,
- svn_kind_t mine_local_kind,
- const svn_checksum_t *mine_checksum,
- svn_wc_conflict_action_t incoming_change,
- svn_kind_t incoming_kind,
- const svn_checksum_t *incoming_checksum,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
-
-/* Add a reject conflict to CONFLICT_SKEL.
- Allocate data stored in the skel in RESULT_POOL.
-
- HUNK_ORIGINAL_OFFSET, HUNK_ORIGINAL_LENGTH, HUNK_MODIFIED_OFFSET,
- and HUNK_MODIFIED_LENGTH is hunk-header data identifying the hunk
- which was rejected.
-
- REJECT_DIFF_CHECKSUM is the checksum of the text of the rejected
- diff, for retrieval from the pristine store.
-
- It is an error (### which one?) if no conflicting operation has been
- set on CONFLICT_SKEL before calling this function.
- It is an error (### which one?) if CONFLICT_SKEL already contains
- a reject conflict for the hunk.
+svn_wc__conflict_skel_add_tree_conflict(svn_skel_t *conflict_skel,
+ svn_wc__db_t *db,
+ const char *wri_abspath,
+ svn_wc_conflict_reason_t local_change,
+ svn_wc_conflict_action_t incoming_change,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/* Allows resolving specific conflicts stored in CONFLICT_SKEL.
+
+ When RESOLVE_TEXT is TRUE and CONFLICT_SKEL contains a text conflict,
+ resolve/remove the text conflict in CONFLICT_SKEL.
+
+ When RESOLVE_PROP is "" and CONFLICT_SKEL contains a property conflict,
+ resolve/remove all property conflicts in CONFLICT_SKEL.
+
+ When RESOLVE_PROP is not NULL and not "", remove the property conflict on
+ the property RESOLVE_PROP in CONFLICT_SKEL. When RESOLVE_PROP was the last
+ property in CONFLICT_SKEL remove the property conflict info from
+ CONFLICT_SKEL.
+
+ When RESOLVE_TREE is TRUE and CONFLICT_SKEL contains a tree conflict,
+ resolve/remove the tree conflict in CONFLICT_SKEL.
+
+ If COMPLETELY_RESOLVED is not NULL, then set *COMPLETELY_RESOLVED to TRUE,
+ when no conflict registration is left in CONFLICT_SKEL after editting,
+ otherwise to FALSE.
- Do temporary allocations in SCRATCH_POOL.
-*/
+ Allocate data stored in the skel in RESULT_POOL.
+
+ This functions edits CONFLICT_SKEL. New skels might be created in
+ RESULT_POOL. Temporary allocations will use SCRATCH_POOL.
+ */
+/* ### db, wri_abspath is currently unused. Remove? */
svn_error_t *
-svn_wc__conflict_skel_add_reject_conflict(
- svn_skel_t *conflict_skel,
- svn_linenum_t hunk_original_offset,
- svn_linenum_t hunk_original_length,
- svn_linenum_t hunk_modified_offset,
- svn_linenum_t hunk_modified_length,
- const svn_checksum_t *reject_diff_checksum,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
-
-/* Add an obstruction conflict to CONFLICT_SKEL.
- Allocate data stored in the skel in RESULT_POOL.
-
- It is an error (### which one?) if no conflicting operation has been
- set on CONFLICT_SKEL before calling this function.
- It is an error (### which one?) if CONFLICT_SKEL already contains
- an obstruction.
+svn_wc__conflict_skel_resolve(svn_boolean_t *completely_resolved,
+ svn_skel_t *conflict_skel,
+ svn_wc__db_t *db,
+ const char *wri_abspath,
+ svn_boolean_t resolve_text,
+ const char *resolve_prop,
+ svn_boolean_t resolve_tree,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
- Do temporary allocations in SCRATCH_POOL.
-*/
+/*
+ * -----------------------------------------------------------
+ * Reading conflict skels. Maybe this can be made private later
+ * -----------------------------------------------------------
+ */
+
+/* Read common information from CONFLICT_SKEL to determine the operation
+ * and merge origins.
+ *
+ * Output arguments can be NULL if the value is not necessary.
+ *
+ * TEXT_, PROP_ and TREE_CONFLICTED (when not NULL) will be set to TRUE
+ * when the conflict contains the specified kind of conflict, otherwise
+ * to false.
+ *
+ * Allocate the result in RESULT_POOL. Perform temporary allocations in
+ * SCRATCH_POOL.
+ */
+svn_error_t *
+svn_wc__conflict_read_info(svn_wc_operation_t *operation,
+ const apr_array_header_t **locations,
+ svn_boolean_t *text_conflicted,
+ svn_boolean_t *prop_conflicted,
+ svn_boolean_t *tree_conflicted,
+ svn_wc__db_t *db,
+ const char *wri_abspath,
+ const svn_skel_t *conflict_skel,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/* Reads back the original data stored by svn_wc__conflict_add_text_conflict()
+ * in CONFLICT_SKEL for a node in DB, WRI_ABSPATH.
+ *
+ * Values as documented for svn_wc__conflict_add_text_conflict().
+ *
+ * Output arguments can be NULL if the value is not necessary.
+ *
+ * Allocate the result in RESULT_POOL. Perform temporary allocations in
+ * SCRATCH_POOL.
+ */
+svn_error_t *
+svn_wc__conflict_read_text_conflict(const char **mine_abspath,
+ const char **their_old_abspath,
+ const char **their_abspath,
+ svn_wc__db_t *db,
+ const char *wri_abspath,
+ const svn_skel_t *conflict_skel,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/* Reads back the original data stored by svn_wc__conflict_add_prop_conflict()
+ * in CONFLICT_SKEL for a node in DB, WRI_ABSPATH.
+ *
+ * Values as documented for svn_wc__conflict_add_prop_conflict().
+ *
+ * Output arguments can be NULL if the value is not necessary
+ * Allocate the result in RESULT_POOL. Perform temporary allocations in
+ * SCRATCH_POOL.
+ */
+svn_error_t *
+svn_wc__conflict_read_prop_conflict(const char **marker_abspath,
+ apr_hash_t **mine_props,
+ apr_hash_t **their_old_props,
+ apr_hash_t **their_props,
+ apr_hash_t **conflicted_prop_names,
+ svn_wc__db_t *db,
+ const char *wri_abspath,
+ const svn_skel_t *conflict_skel,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/* Reads back the original data stored by svn_wc__conflict_add_tree_conflict()
+ * in CONFLICT_SKEL for a node in DB, WRI_ABSPATH.
+ *
+ * Values as documented for svn_wc__conflict_add_tree_conflict().
+ *
+ * Output arguments can be NULL if the value is not necessary
+ * Allocate the result in RESULT_POOL. Perform temporary allocations in
+ * SCRATCH_POOL.
+ */
+svn_error_t *
+svn_wc__conflict_read_tree_conflict(svn_wc_conflict_reason_t *local_change,
+ svn_wc_conflict_action_t *incoming_change,
+ svn_wc__db_t *db,
+ const char *wri_abspath,
+ const svn_skel_t *conflict_skel,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/* Reads in *MARKERS a list of const char * absolute paths of the marker files
+ referenced from CONFLICT_SKEL.
+ * Allocate the result in RESULT_POOL. Perform temporary allocations in
+ * SCRATCH_POOL.
+ */
+svn_error_t *
+svn_wc__conflict_read_markers(const apr_array_header_t **markers,
+ svn_wc__db_t *db,
+ const char *wri_abspath,
+ const svn_skel_t *conflict_skel,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/* Create the necessary marker files for the conflicts stored in
+ * CONFLICT_SKEL and return the work items to fill the markers from
+ * the work queue.
+ *
+ * Currently only used for property conflicts as text conflict markers
+ * are just in-wc files.
+ *
+ * Allocate the result in RESULT_POOL. Perform temporary allocations in
+ * SCRATCH_POOL.
+ */
+svn_error_t *
+svn_wc__conflict_create_markers(svn_skel_t **work_item,
+ svn_wc__db_t *db,
+ const char *local_abspath,
+ svn_skel_t *conflict_skel,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/* Call the interactive conflict resolver RESOLVER_FUNC with RESOLVER_BATON to
+ allow resolving the conflicts on LOCAL_ABSPATH.
+
+ CONFLICT_SKEL contains the details of the conflicts on LOCAL_ABSPATH.
+ Resolver actions are directly applied to the in-db state of LOCAL_ABSPATH,
+ so the conflict and the state in CONFLICT_SKEL must already be installed in
+ wc.db. */
svn_error_t *
-svn_wc__conflict_skel_add_obstruction(svn_skel_t *conflict_skel,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
+svn_wc__conflict_invoke_resolver(svn_wc__db_t *db,
+ const char *local_abspath,
+ const svn_skel_t *conflict_skel,
+ const apr_array_header_t *merge_options,
+ svn_wc_conflict_resolver_func2_t resolver_func,
+ void *resolver_baton,
+ apr_pool_t *scratch_pool);
/* Resolve text conflicts on the given node. */
Modified: subversion/branches/master-passphrase/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_wc/copy.c?rev=1361339&r1=1361338&r2=1361339&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_wc/copy.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_wc/copy.c Fri Jul 13 19:04:32 2012
@@ -218,8 +218,8 @@ copy_versioned_file(svn_wc__db_t *db,
const char *conflict_working = NULL;
/* Is there a text conflict at the source path? */
- SVN_ERR(svn_wc__db_read_conflicts(&conflicts, db, src_abspath,
- scratch_pool, scratch_pool));
+ SVN_ERR(svn_wc__read_conflicts(&conflicts, db, src_abspath,
+ scratch_pool, scratch_pool));
for (i = 0; i < conflicts->nelts; i++)
{
@@ -484,10 +484,6 @@ copy_versioned_dir(svn_wc__db_t *db,
if (svn_wc_is_adm_dir(name, iterpool))
continue;
- if (marker_files &&
- apr_hash_get(marker_files, name, APR_HASH_KEY_STRING))
- continue;
-
if (cancel_func)
SVN_ERR(cancel_func(cancel_baton));
@@ -495,6 +491,11 @@ copy_versioned_dir(svn_wc__db_t *db,
unver_src_abspath = svn_dirent_join(src_abspath, name, iterpool);
unver_dst_abspath = svn_dirent_join(dst_abspath, name, iterpool);
+ if (marker_files &&
+ apr_hash_get(marker_files, unver_src_abspath,
+ APR_HASH_KEY_STRING))
+ continue;
+
SVN_ERR(copy_to_tmpdir(&work_item, NULL, db, unver_src_abspath,
unver_dst_abspath, tmpdir_abspath,
TRUE /* recursive */, TRUE /* unversioned */,
@@ -793,8 +794,8 @@ remove_node_conflict_markers(svn_wc__db_
{
const apr_array_header_t *conflicts;
- SVN_ERR(svn_wc__db_read_conflicts(&conflicts, db, src_abspath,
- scratch_pool, scratch_pool));
+ SVN_ERR(svn_wc__read_conflicts(&conflicts, db, src_abspath,
+ scratch_pool, scratch_pool));
/* Do we have conflict markers that should be removed? */
if (conflicts != NULL)
Modified: subversion/branches/master-passphrase/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_wc/entries.c?rev=1361339&r1=1361338&r2=1361339&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_wc/entries.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_wc/entries.c Fri Jul 13 19:04:32 2012
@@ -37,6 +37,7 @@
#include "wc.h"
#include "adm_files.h"
+#include "conflicts.h"
#include "entries.h"
#include "lock.h"
#include "tree_conflicts.h"
@@ -452,9 +453,9 @@ read_one_entry(const svn_wc_entry_t **ne
child_abspath = svn_dirent_join(dir_abspath, child_name,
scratch_pool);
- SVN_ERR(svn_wc__db_read_conflicts(&child_conflicts,
- db, child_abspath,
- scratch_pool, scratch_pool));
+ SVN_ERR(svn_wc__read_conflicts(&child_conflicts,
+ db, child_abspath,
+ scratch_pool, scratch_pool));
for (j = 0; j < child_conflicts->nelts; j++)
{
@@ -875,8 +876,8 @@ read_one_entry(const svn_wc_entry_t **ne
{
const apr_array_header_t *conflicts;
int j;
- SVN_ERR(svn_wc__db_read_conflicts(&conflicts, db, entry_abspath,
- scratch_pool, scratch_pool));
+ SVN_ERR(svn_wc__read_conflicts(&conflicts, db, entry_abspath,
+ scratch_pool, scratch_pool));
for (j = 0; j < conflicts->nelts; j++)
{
@@ -1501,10 +1502,15 @@ insert_node(svn_sqlite__db_t *sdb,
/* */
static svn_error_t *
insert_actual_node(svn_sqlite__db_t *sdb,
+ svn_wc__db_t *db,
+ const char *wri_abspath,
const db_actual_node_t *actual_node,
apr_pool_t *scratch_pool)
{
svn_sqlite__stmt_t *stmt;
+#if SVN_WC__VERSION >= SVN_WC__USES_CONFLICT_SKELS
+ svn_skel_t *conflict_data = NULL;
+#endif
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_INSERT_ACTUAL_NODE));
@@ -1516,21 +1522,44 @@ insert_actual_node(svn_sqlite__db_t *sdb
SVN_ERR(svn_sqlite__bind_properties(stmt, 4, actual_node->properties,
scratch_pool));
- if (actual_node->conflict_old)
- {
- SVN_ERR(svn_sqlite__bind_text(stmt, 5, actual_node->conflict_old));
- SVN_ERR(svn_sqlite__bind_text(stmt, 6, actual_node->conflict_new));
- SVN_ERR(svn_sqlite__bind_text(stmt, 7, actual_node->conflict_working));
+ if (actual_node->changelist)
+ SVN_ERR(svn_sqlite__bind_text(stmt, 5, actual_node->changelist));
+
+#if SVN_WC__VERSION < SVN_WC__USES_CONFLICT_SKELS
+ if (actual_node->conflict_old
+ || actual_node->conflict_new
+ || actual_node->conflict_working)
+ {
+ SVN_ERR(svn_sqlite__bind_text(stmt, 7, actual_node->conflict_old));
+ SVN_ERR(svn_sqlite__bind_text(stmt, 8, actual_node->conflict_new));
+ SVN_ERR(svn_sqlite__bind_text(stmt, 9, actual_node->conflict_working));
}
if (actual_node->prop_reject)
- SVN_ERR(svn_sqlite__bind_text(stmt, 8, actual_node->prop_reject));
-
- if (actual_node->changelist)
- SVN_ERR(svn_sqlite__bind_text(stmt, 9, actual_node->changelist));
+ SVN_ERR(svn_sqlite__bind_text(stmt, 10, actual_node->prop_reject));
if (actual_node->tree_conflict_data)
- SVN_ERR(svn_sqlite__bind_text(stmt, 10, actual_node->tree_conflict_data));
+ SVN_ERR(svn_sqlite__bind_text(stmt, 11, actual_node->tree_conflict_data));
+#else
+ SVN_ERR(svn_wc__upgrade_conflict_skel_from_raw(
+ &conflict_data,
+ db, wri_abspath,
+ actual_node->local_relpath,
+ actual_node->conflict_old,
+ actual_node->conflict_working,
+ actual_node->conflict_new,
+ actual_node->prop_reject,
+ actual_node->tree_conflict_data,
+ strlen(actual_node->tree_conflict_data),
+ scratch_pool, scratch_pool));
+
+ if (conflict_data)
+ {
+ svn_stringbuf_t *data = svn_skel__unparse(conflict_data, scratch_pool);
+
+ SVN_ERR(svn_sqlite__bind_blob(stmt, 6, data->data, data->len));
+ }
+#endif
/* Execute and reset the insert clause. */
return svn_error_trace(svn_sqlite__insert(NULL, stmt));
@@ -2189,7 +2218,8 @@ write_entry(struct write_baton **entry_n
actual_node->local_relpath = local_relpath;
actual_node->parent_relpath = parent_relpath;
- SVN_ERR(insert_actual_node(sdb, actual_node, scratch_pool));
+ SVN_ERR(insert_actual_node(sdb, db, tmp_entry_abspath,
+ actual_node, scratch_pool));
}
if (entry_node)
@@ -2217,6 +2247,8 @@ write_entry(struct write_baton **entry_n
static svn_error_t *
write_actual_only_entries(apr_hash_t *tree_conflicts,
svn_sqlite__db_t *sdb,
+ svn_wc__db_t *db,
+ const char *wri_abspath,
apr_int64_t wc_id,
const char *parent_relpath,
apr_pool_t *scratch_pool)
@@ -2235,7 +2267,8 @@ write_actual_only_entries(apr_hash_t *tr
actual_node->parent_relpath = parent_relpath;
actual_node->tree_conflict_data = svn__apr_hash_index_val(hi);
- SVN_ERR(insert_actual_node(sdb, actual_node, scratch_pool));
+ SVN_ERR(insert_actual_node(sdb, db, wri_abspath, actual_node,
+ scratch_pool));
}
return SVN_NO_ERROR;
@@ -2317,8 +2350,9 @@ svn_wc__write_upgraded_entries(void **di
}
if (dir_node->tree_conflicts)
- SVN_ERR(write_actual_only_entries(dir_node->tree_conflicts, sdb,
- wc_id, dir_relpath, iterpool));
+ SVN_ERR(write_actual_only_entries(dir_node->tree_conflicts, sdb, db,
+ new_root_abspath, wc_id, dir_relpath,
+ iterpool));
*dir_baton = dir_node;
svn_pool_destroy(iterpool);
Modified: subversion/branches/master-passphrase/subversion/libsvn_wc/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_wc/externals.c?rev=1361339&r1=1361338&r2=1361339&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_wc/externals.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_wc/externals.c Fri Jul 13 19:04:32 2012
@@ -600,10 +600,11 @@ close_file(void *file_baton,
eb->new_pristine_abspath = NULL;
}
- /* ### TODO: Merge the changes */
+ /* Merge the changes */
{
svn_skel_t *all_work_items = NULL;
+ svn_skel_t *conflict_skel = NULL;
svn_skel_t *work_item;
apr_hash_t *base_props = NULL;
apr_hash_t *actual_props = NULL;
@@ -675,26 +676,20 @@ close_file(void *file_baton,
if (regular_prop_changes->nelts > 0)
{
- SVN_ERR(svn_wc__merge_props(&work_item, &prop_state,
+ SVN_ERR(svn_wc__merge_props(&conflict_skel,
+ &prop_state,
&new_pristine_props,
&new_actual_props,
eb->db, eb->local_abspath,
svn_kind_file,
- NULL, NULL,
NULL /* server_baseprops*/,
base_props,
actual_props,
regular_prop_changes,
TRUE /* base_merge */,
FALSE /* dry_run */,
- eb->conflict_func,
- eb->conflict_baton,
eb->cancel_func, eb->cancel_baton,
pool, pool));
-
- if (work_item)
- all_work_items = svn_wc__wq_merge(all_work_items, work_item,
- pool);
}
else
{
@@ -740,6 +735,7 @@ close_file(void *file_baton,
enum svn_wc_merge_outcome_t merge_outcome;
/* Ok, we have to do some work to merge a local change */
SVN_ERR(svn_wc__perform_file_merge(&work_item,
+ &conflict_skel,
&merge_outcome,
eb->db,
eb->local_abspath,
@@ -752,8 +748,6 @@ close_file(void *file_baton,
*eb->target_revision,
eb->propchanges,
eb->diff3cmd,
- eb->conflict_func,
- eb->conflict_baton,
eb->cancel_func,
eb->cancel_baton,
pool, pool));
@@ -784,6 +778,29 @@ close_file(void *file_baton,
/* ### Retranslate on magic property changes, etc. */
}
+ if (conflict_skel)
+ {
+ SVN_ERR(svn_wc__conflict_skel_set_op_switch(
+ conflict_skel,
+ svn_wc_conflict_version_create2(
+ eb->repos_root_url,
+ eb->repos_uuid,
+ repos_relpath,
+ eb->original_revision,
+ svn_node_file,
+ pool),
+ pool, pool));
+
+
+ SVN_ERR(svn_wc__conflict_create_markers(&work_item,
+ eb->db, eb->local_abspath,
+ conflict_skel,
+ pool, pool));
+
+ all_work_items = svn_wc__wq_merge(all_work_items, work_item,
+ pool);
+ }
+
SVN_ERR(svn_wc__db_external_add_file(
eb->db,
eb->local_abspath,
@@ -804,6 +821,7 @@ close_file(void *file_baton,
eb->recorded_revision,
TRUE, new_actual_props,
FALSE /* keep_recorded_info */,
+ conflict_skel,
all_work_items,
pool));
@@ -1292,8 +1310,12 @@ svn_wc__external_remove(svn_wc_context_t
scratch_pool));
else
{
- SVN_ERR(svn_wc__db_base_remove(wc_ctx->db, local_abspath, scratch_pool));
- SVN_ERR(svn_io_remove_file2(local_abspath, TRUE, scratch_pool));
+ SVN_ERR(svn_wc__db_base_remove(wc_ctx->db, local_abspath,
+ FALSE, SVN_INVALID_REVNUM,
+ NULL, NULL, scratch_pool));
+ SVN_ERR(svn_wc__wq_run(wc_ctx->db, local_abspath,
+ cancel_func, cancel_baton,
+ scratch_pool));
}
return SVN_NO_ERROR;
Modified: subversion/branches/master-passphrase/subversion/libsvn_wc/info.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_wc/info.c?rev=1361339&r1=1361338&r2=1361339&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_wc/info.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_wc/info.c Fri Jul 13 19:04:32 2012
@@ -279,9 +279,9 @@ build_info_for_node(svn_wc__info2_t **in
local_abspath, result_pool, scratch_pool));
if (conflicted)
- SVN_ERR(svn_wc__db_read_conflicts(&wc_info->conflicts, db,
- local_abspath,
- result_pool, scratch_pool));
+ SVN_ERR(svn_wc__read_conflicts(&wc_info->conflicts, db,
+ local_abspath,
+ result_pool, scratch_pool));
else
wc_info->conflicts = NULL;
@@ -385,21 +385,21 @@ info_found_node_callback(const char *loc
* are not visited will remain in the list. */
if (fe_baton->actual_only && kind == svn_node_dir)
{
- apr_hash_t *conflicts;
- apr_hash_index_t *hi;
+ const apr_array_header_t *victims;
+ int i;
- SVN_ERR(svn_wc__db_op_read_all_tree_conflicts(
- &conflicts, fe_baton->db, local_abspath,
- fe_baton->pool, scratch_pool));
- for (hi = apr_hash_first(scratch_pool, conflicts); hi;
- hi = apr_hash_next(hi))
+ SVN_ERR(svn_wc__db_read_conflict_victims(&victims,
+ fe_baton->db, local_abspath,
+ scratch_pool, scratch_pool));
+
+ for (i = 0; i < victims->nelts; i++)
{
- const char *this_basename = svn__apr_hash_index_key(hi);
+ const char *this_basename = APR_ARRAY_IDX(victims, i, const char *);
apr_hash_set(fe_baton->tree_conflicts,
svn_dirent_join(local_abspath, this_basename,
fe_baton->pool),
- APR_HASH_KEY_STRING, svn__apr_hash_index_val(hi));
+ APR_HASH_KEY_STRING, "");
}
}
@@ -449,6 +449,8 @@ svn_wc__get_info(svn_wc_context_t *wc_ct
svn_error_t *err;
apr_pool_t *iterpool = svn_pool_create(scratch_pool);
apr_hash_index_t *hi;
+ const char *repos_root_url = NULL;
+ const char *repos_uuid = NULL;
fe_baton.receiver = receiver;
fe_baton.receiver_baton = receiver_baton;
@@ -476,9 +478,9 @@ svn_wc__get_info(svn_wc_context_t *wc_ct
const svn_wc_conflict_description2_t *root_tree_conflict;
svn_error_t *err2;
- err2 = svn_wc__db_op_read_tree_conflict(&root_tree_conflict,
- wc_ctx->db, local_abspath,
- scratch_pool, iterpool);
+ err2 = svn_wc__get_tree_conflict(&root_tree_conflict,
+ wc_ctx, local_abspath,
+ scratch_pool, iterpool);
if ((err2 && err2->apr_err == SVN_ERR_WC_PATH_NOT_FOUND))
{
@@ -502,30 +504,41 @@ svn_wc__get_info(svn_wc_context_t *wc_ct
hi = apr_hash_next(hi))
{
const char *this_abspath = svn__apr_hash_index_key(hi);
- const svn_wc_conflict_description2_t *tree_conflict
- = svn__apr_hash_index_val(hi);
+ const svn_wc_conflict_description2_t *tree_conflict;
+ svn_wc__info2_t *info;
svn_pool_clear(iterpool);
- if (depth_includes(local_abspath, depth, tree_conflict->local_abspath,
- tree_conflict->node_kind, iterpool))
+ SVN_ERR(build_info_for_unversioned(&info, iterpool));
+
+ if (!repos_root_url)
{
- apr_array_header_t *conflicts = apr_array_make(iterpool,
- 1, sizeof(const svn_wc_conflict_description2_t *));
- svn_wc__info2_t *info;
-
- SVN_ERR(build_info_for_unversioned(&info, iterpool));
- SVN_ERR(svn_wc__internal_get_repos_info(&info->repos_root_URL,
- &info->repos_UUID,
- fe_baton.db,
+ SVN_ERR(svn_wc__internal_get_repos_info(&repos_root_url,
+ &repos_uuid,
+ wc_ctx->db,
local_abspath,
- iterpool, iterpool));
- APR_ARRAY_PUSH(conflicts, const svn_wc_conflict_description2_t *)
- = tree_conflict;
- info->wc_info->conflicts = conflicts;
-
- SVN_ERR(receiver(receiver_baton, this_abspath, info, 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,
+ wc_ctx->db, this_abspath,
+ iterpool, iterpool));
+
+ if (! info->wc_info->conflicts || ! info->wc_info->conflicts->nelts)
+ continue;
+
+ tree_conflict = APR_ARRAY_IDX(info->wc_info->conflicts, 0,
+ svn_wc_conflict_description2_t *);
+
+ if (!depth_includes(local_abspath, depth, tree_conflict->local_abspath,
+ tree_conflict->node_kind, iterpool))
+ continue;
+
+ SVN_ERR(receiver(receiver_baton, this_abspath, info, iterpool));
}
svn_pool_destroy(iterpool);
Modified: subversion/branches/master-passphrase/subversion/libsvn_wc/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_wc/merge.c?rev=1361339&r1=1361338&r2=1361339&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_wc/merge.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_wc/merge.c Fri Jul 13 19:04:32 2012
@@ -29,6 +29,7 @@
#include "wc.h"
#include "adm_files.h"
+#include "conflicts.h"
#include "translate.h"
#include "workqueue.h"
@@ -450,198 +451,6 @@ do_text_merge_external(svn_boolean_t *co
return SVN_NO_ERROR;
}
-/* Create a new file in the same directory as VERSIONED_ABSPATH, with the
- same basename as VERSIONED_ABSPATH, with a ".edited" extension, and set
- *WORK_ITEM to a new work item that will copy and translate from the file
- SOURCE to that new file. It will be translated from repository-normal
- form to working-copy form according to the versioned properties of
- VERSIONED_ABSPATH that are current when the work item is executed.
-
- DB should have a write lock for the directory containing SOURCE.
-
- Allocate *WORK_ITEM in RESULT_POOL. */
-static svn_error_t*
-save_merge_result(svn_skel_t **work_item,
- const merge_target_t *mt,
- const char *source,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- const char *edited_copy_abspath;
- const char *dir_abspath;
- const char *filename;
-
- svn_dirent_split(&dir_abspath, &filename, mt->local_abspath, scratch_pool);
-
- /* ### Should use preserved-conflict-file-exts. */
- /* Create the .edited file within this file's DIR_ABSPATH */
- SVN_ERR(svn_io_open_uniquely_named(NULL,
- &edited_copy_abspath,
- dir_abspath,
- filename,
- ".edited",
- svn_io_file_del_none,
- scratch_pool, scratch_pool));
- SVN_ERR(svn_wc__wq_build_file_copy_translated(work_item,
- mt->db, mt->local_abspath,
- source, edited_copy_abspath,
- result_pool, scratch_pool));
-
- return SVN_NO_ERROR;
-}
-
-/* Deal with the result of the conflict resolution callback, as indicated by
- * CHOICE.
- *
- * Set *WORK_ITEMS to new work items that will ...
- * Set *MERGE_OUTCOME to the result of the 3-way merge.
- *
- * LEFT_ABSPATH, RIGHT_ABSPATH, and TARGET_ABSPATH are the input files to
- * the 3-way merge, and MERGED_FILE is the merged result as generated by the
- * internal or external merge or by the conflict resolution callback.
- *
- * DETRANSLATED_TARGET is the detranslated version of TARGET_ABSPATH
- * (see detranslate_wc_file() above). DIFF3_OPTIONS are passed to the
- * diff3 implementation in case a 3-way merge has to be carried out. */
-static svn_error_t*
-eval_conflict_func_result(svn_skel_t **work_items,
- enum svn_wc_merge_outcome_t *merge_outcome,
- svn_wc_conflict_choice_t choice,
- const merge_target_t *mt,
- const char *left_abspath,
- const char *right_abspath,
- const char *merged_file,
- const char *detranslated_target,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- const char *install_from = NULL;
- svn_boolean_t remove_source = FALSE;
-
- *work_items = NULL;
-
- switch (choice)
- {
- /* If the callback wants to use one of the fulltexts
- to resolve the conflict, so be it.*/
- case svn_wc_conflict_choose_base:
- {
- install_from = left_abspath;
- *merge_outcome = svn_wc_merge_merged;
- break;
- }
- case svn_wc_conflict_choose_theirs_full:
- {
- install_from = right_abspath;
- *merge_outcome = svn_wc_merge_merged;
- break;
- }
- case svn_wc_conflict_choose_mine_full:
- {
- /* Do nothing to merge_target, let it live untouched! */
- *merge_outcome = svn_wc_merge_merged;
- return SVN_NO_ERROR;
- }
- case svn_wc_conflict_choose_theirs_conflict:
- case svn_wc_conflict_choose_mine_conflict:
- {
- const char *chosen_path;
- const char *temp_dir;
- svn_stream_t *chosen_stream;
- svn_diff_t *diff;
- svn_diff_conflict_display_style_t style;
- svn_diff_file_options_t *diff3_options;
-
- diff3_options = svn_diff_file_options_create(scratch_pool);
-
- if (mt->merge_options)
- SVN_ERR(svn_diff_file_options_parse(diff3_options,
- mt->merge_options,
- scratch_pool));
-
- style = choice == svn_wc_conflict_choose_theirs_conflict
- ? svn_diff_conflict_display_latest
- : svn_diff_conflict_display_modified;
-
- SVN_ERR(svn_wc__db_temp_wcroot_tempdir(&temp_dir, mt->db,
- mt->wri_abspath,
- scratch_pool, scratch_pool));
- SVN_ERR(svn_stream_open_unique(&chosen_stream, &chosen_path,
- temp_dir, svn_io_file_del_none,
- scratch_pool, scratch_pool));
-
- SVN_ERR(svn_diff_file_diff3_2(&diff,
- left_abspath,
- detranslated_target, right_abspath,
- diff3_options, scratch_pool));
- SVN_ERR(svn_diff_file_output_merge2(chosen_stream, diff,
- left_abspath,
- detranslated_target,
- right_abspath,
- /* markers ignored */
- NULL, NULL,
- NULL, NULL,
- style,
- scratch_pool));
- SVN_ERR(svn_stream_close(chosen_stream));
-
- install_from = chosen_path;
- remove_source = TRUE;
- *merge_outcome = svn_wc_merge_merged;
- break;
- }
-
- /* For the case of 3-way file merging, we don't
- really distinguish between these return values;
- if the callback claims to have "generally
- resolved" the situation, we still interpret
- that as "OK, we'll assume the merged version is
- good to use". */
- case svn_wc_conflict_choose_merged:
- {
- install_from = merged_file;
- *merge_outcome = svn_wc_merge_merged;
- break;
- }
- case svn_wc_conflict_choose_postpone:
- default:
- {
-#if 0
- /* ### what should this value be? no caller appears to initialize
- ### it, so we really SHOULD be setting a value here. */
- *merge_outcome = svn_wc_merge_merged;
-#endif
-
- /* Assume conflict remains. */
- return SVN_NO_ERROR;
- }
- }
-
- SVN_ERR_ASSERT(install_from != NULL);
-
- {
- svn_skel_t *work_item;
-
- SVN_ERR(svn_wc__wq_build_file_install(&work_item,
- mt->db, mt->local_abspath,
- install_from,
- FALSE /* use_commit_times */,
- FALSE /* record_fileinfo */,
- result_pool, scratch_pool));
- *work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
-
- if (remove_source)
- {
- SVN_ERR(svn_wc__wq_build_file_remove(&work_item,
- mt->db, install_from,
- result_pool, scratch_pool));
- *work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
- }
- }
-
- return SVN_NO_ERROR;
-}
-
/* Preserve the three pre-merge files.
Create three empty files, with unique names that each include the
@@ -722,7 +531,8 @@ preserve_pre_merge_files(svn_skel_t **wo
SVN_ERR(svn_io_copy_file(left_abspath, tmp_left, TRUE, scratch_pool));
/* And create a wq item to remove the file later */
- SVN_ERR(svn_wc__wq_build_file_remove(&work_item, mt->db, tmp_left,
+ SVN_ERR(svn_wc__wq_build_file_remove(&work_item, mt->db, wcroot_abspath,
+ tmp_left,
result_pool, scratch_pool));
last_items = svn_wc__wq_merge(last_items, work_item, result_pool);
@@ -738,7 +548,8 @@ preserve_pre_merge_files(svn_skel_t **wo
SVN_ERR(svn_io_copy_file(right_abspath, tmp_right, TRUE, scratch_pool));
/* And create a wq item to remove the file later */
- SVN_ERR(svn_wc__wq_build_file_remove(&work_item, mt->db, tmp_right,
+ SVN_ERR(svn_wc__wq_build_file_remove(&work_item, mt->db, wcroot_abspath,
+ tmp_right,
result_pool, scratch_pool));
last_items = svn_wc__wq_merge(last_items, work_item, result_pool);
@@ -788,7 +599,7 @@ preserve_pre_merge_files(svn_skel_t **wo
*work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
/* And maybe delete some tempfiles */
- SVN_ERR(svn_wc__wq_build_file_remove(&work_item, mt->db,
+ SVN_ERR(svn_wc__wq_build_file_remove(&work_item, mt->db, wcroot_abspath,
detranslated_target_copy,
result_pool, scratch_pool));
*work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
@@ -798,133 +609,6 @@ preserve_pre_merge_files(svn_skel_t **wo
return SVN_NO_ERROR;
}
-/* Helper for maybe_resolve_conflicts() below. */
-static const svn_wc_conflict_description2_t *
-setup_text_conflict_desc(const char *left_abspath,
- const char *right_abspath,
- const char *target_abspath,
- const svn_wc_conflict_version_t *left_version,
- const svn_wc_conflict_version_t *right_version,
- const char *result_target,
- const char *detranslated_target,
- const svn_prop_t *mimeprop,
- svn_boolean_t is_binary,
- apr_pool_t *pool)
-{
- svn_wc_conflict_description2_t *cdesc;
-
- cdesc = svn_wc_conflict_description_create_text2(target_abspath, pool);
- cdesc->is_binary = is_binary;
- cdesc->mime_type = (mimeprop && mimeprop->value)
- ? mimeprop->value->data : NULL,
- cdesc->base_abspath = left_abspath;
- cdesc->their_abspath = right_abspath;
- cdesc->my_abspath = detranslated_target;
- cdesc->merged_file = result_target;
-
- cdesc->src_left_version = left_version;
- cdesc->src_right_version = right_version;
-
- return cdesc;
-}
-
-/* XXX Insane amount of parameters... */
-/* RESULT_TARGET is the path to the merged file produced by the internal or
- external 3-way merge. */
-static svn_error_t*
-maybe_resolve_conflicts(svn_skel_t **work_items,
- const merge_target_t *mt,
- const char *left_abspath,
- const char *right_abspath,
- const char *left_label,
- const char *right_label,
- const char *target_label,
- enum svn_wc_merge_outcome_t *merge_outcome,
- const svn_wc_conflict_version_t *left_version,
- const svn_wc_conflict_version_t *right_version,
- const char *result_target,
- const char *detranslated_target,
- svn_wc_conflict_resolver_func2_t conflict_func,
- void *conflict_baton,
- svn_cancel_func_t cancel_func,
- void *cancel_baton,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- svn_wc_conflict_result_t *result;
- svn_skel_t *work_item;
-
- *work_items = NULL;
-
- /* Give the conflict resolution callback a chance to clean
- up the conflicts before we mark the file 'conflicted' */
- if (!conflict_func)
- {
- /* If there is no interactive conflict resolution then we are effectively
- postponing conflict resolution. */
- result = svn_wc_create_conflict_result(svn_wc_conflict_choose_postpone,
- NULL, result_pool);
- }
- else
- {
- const svn_wc_conflict_description2_t *cdesc;
-
- cdesc = setup_text_conflict_desc(left_abspath,
- right_abspath,
- mt->local_abspath,
- left_version,
- right_version,
- result_target,
- detranslated_target,
- get_prop(mt, SVN_PROP_MIME_TYPE),
- FALSE,
- scratch_pool);
-
- SVN_ERR(conflict_func(&result, cdesc, conflict_baton, scratch_pool,
- scratch_pool));
- if (result == NULL)
- return svn_error_create(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE,
- NULL, _("Conflict callback violated API:"
- " returned no results"));
-
- if (result->save_merged)
- {
- SVN_ERR(save_merge_result(work_items,
- mt,
- /* Look for callback's own
- merged-file first: */
- result->merged_file
- ? result->merged_file
- : result_target,
- result_pool, scratch_pool));
- }
- }
-
- SVN_ERR(eval_conflict_func_result(&work_item,
- merge_outcome,
- result->choice,
- mt,
- left_abspath,
- right_abspath,
- result->merged_file
- ? result->merged_file
- : result_target,
- detranslated_target,
- result_pool, scratch_pool));
- *work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
-
- if (result->choice != svn_wc_conflict_choose_postpone)
- /* The conflicts have been dealt with, nothing else
- * to do for us here. */
- return SVN_NO_ERROR;
-
- /* The conflicts have not been dealt with. */
- *merge_outcome = svn_wc_merge_conflict;
-
- return SVN_NO_ERROR;
-}
-
-
/* Attempt a trivial merge of LEFT_ABSPATH and RIGHT_ABSPATH to TARGET_ABSPATH.
* The merge is trivial if the file at LEFT_ABSPATH equals the detranslated
* form of the target at DETRANSLATED_TARGET_ABSPATH, because in this case
@@ -944,11 +628,15 @@ merge_file_trivial(svn_skel_t **work_ite
const char *detranslated_target_abspath,
svn_boolean_t dry_run,
svn_wc__db_t *db,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
svn_skel_t *work_item;
- svn_boolean_t same_contents = FALSE;
+ svn_boolean_t same_left_right;
+ svn_boolean_t same_right_target;
+ svn_boolean_t same_left_target;
svn_node_kind_t kind;
svn_boolean_t is_special;
@@ -961,19 +649,23 @@ merge_file_trivial(svn_skel_t **work_ite
return SVN_NO_ERROR;
}
+ /* Check the files */
+ SVN_ERR(svn_io_files_contents_three_same_p(&same_left_right,
+ &same_right_target,
+ &same_left_target,
+ left_abspath,
+ right_abspath,
+ detranslated_target_abspath,
+ scratch_pool));
+
/* If the LEFT side of the merge is equal to WORKING, then we can
* copy RIGHT directly. */
- SVN_ERR(svn_io_files_contents_same_p(&same_contents, left_abspath,
- detranslated_target_abspath,
- scratch_pool));
- if (same_contents)
+ if (same_left_target)
{
/* Check whether the left side equals the right side.
* If it does, there is no change to merge so we leave the target
* unchanged. */
- SVN_ERR(svn_io_files_contents_same_p(&same_contents, left_abspath,
- right_abspath, scratch_pool));
- if (same_contents)
+ if (same_left_right)
{
*merge_outcome = svn_wc_merge_unchanged;
}
@@ -982,6 +674,43 @@ merge_file_trivial(svn_skel_t **work_ite
*merge_outcome = svn_wc_merge_merged;
if (!dry_run)
{
+ const char *wcroot_abspath;
+ svn_boolean_t delete_src = FALSE;
+
+ /* The right_abspath might be outside our working copy. In that
+ case we should copy the file to a safe location before
+ installing to avoid breaking the workqueue.
+
+ This matches the behavior in preserve_pre_merge_files */
+
+ SVN_ERR(svn_wc__db_get_wcroot(&wcroot_abspath,
+ db, target_abspath,
+ scratch_pool, scratch_pool));
+
+ if (!svn_dirent_is_child(wcroot_abspath, right_abspath, NULL))
+ {
+ svn_stream_t *tmp_src;
+ svn_stream_t *tmp_dst;
+
+ SVN_ERR(svn_stream_open_readonly(&tmp_src, right_abspath,
+ scratch_pool,
+ scratch_pool));
+
+ SVN_ERR(svn_wc__open_writable_base(&tmp_dst, &right_abspath,
+ NULL, NULL,
+ db, target_abspath,
+ scratch_pool,
+ scratch_pool));
+
+ SVN_ERR(svn_stream_copy3(tmp_src, tmp_dst,
+ cancel_func, cancel_baton,
+ scratch_pool));
+
+ /* no need to strdup right_abspath, as the wq_build_()
+ call already does that for us */
+ delete_src = TRUE;
+ }
+
SVN_ERR(svn_wc__wq_build_file_install(
&work_item, db, target_abspath, right_abspath,
FALSE /* use_commit_times */,
@@ -989,6 +718,16 @@ merge_file_trivial(svn_skel_t **work_ite
result_pool, scratch_pool));
*work_items = svn_wc__wq_merge(*work_items, work_item,
result_pool);
+
+ if (delete_src)
+ {
+ SVN_ERR(svn_wc__wq_build_file_remove(
+ &work_item, db, wcroot_abspath,
+ right_abspath,
+ result_pool, scratch_pool));
+ *work_items = svn_wc__wq_merge(*work_items, work_item,
+ result_pool);
+ }
}
}
@@ -1002,10 +741,7 @@ merge_file_trivial(svn_skel_t **work_ite
* conflicted them needlessly, while merge_text_file figured it out
* eventually and returned svn_wc_merge_unchanged for them, which
* is what we do here. */
- SVN_ERR(svn_io_files_contents_same_p(&same_contents,
- detranslated_target_abspath,
- right_abspath, scratch_pool));
- if (same_contents)
+ if (same_right_target)
{
*merge_outcome = svn_wc_merge_unchanged;
return SVN_NO_ERROR;
@@ -1020,6 +756,7 @@ merge_file_trivial(svn_skel_t **work_ite
/* XXX Insane amount of parameters... */
static svn_error_t*
merge_text_file(svn_skel_t **work_items,
+ svn_skel_t **conflict_skel,
enum svn_wc_merge_outcome_t *merge_outcome,
const merge_target_t *mt,
const char *left_abspath,
@@ -1028,11 +765,7 @@ merge_text_file(svn_skel_t **work_items,
const char *right_label,
const char *target_label,
svn_boolean_t dry_run,
- const svn_wc_conflict_version_t *left_version,
- const svn_wc_conflict_version_t *right_version,
const char *detranslated_target_abspath,
- svn_wc_conflict_resolver_func2_t conflict_func,
- void *conflict_baton,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *result_pool,
@@ -1088,22 +821,7 @@ merge_text_file(svn_skel_t **work_items,
if (contains_conflicts && ! dry_run)
{
- SVN_ERR(maybe_resolve_conflicts(work_items,
- mt,
- left_abspath,
- right_abspath,
- left_label,
- right_label,
- target_label,
- merge_outcome,
- left_version,
- right_version,
- result_target,
- detranslated_target_abspath,
- conflict_func, conflict_baton,
- cancel_func, cancel_baton,
- result_pool, scratch_pool));
-
+ *merge_outcome = svn_wc_merge_conflict;
if (*merge_outcome == svn_wc_merge_conflict)
{
const char *left_copy, *right_copy, *target_copy;
@@ -1119,14 +837,18 @@ merge_text_file(svn_skel_t **work_items,
result_pool, scratch_pool));
*work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
- /* Track the three conflict files in the metadata.
- * ### TODO WC-NG: Do this outside the work queue: see
- * svn_wc__wq_tmp_build_set_text_conflict_markers()'s doc string. */
- SVN_ERR(svn_wc__wq_tmp_build_set_text_conflict_markers(
- &work_item, mt->db, mt->local_abspath,
- left_copy, right_copy, target_copy,
- result_pool, scratch_pool));
- *work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
+ /* Track the conflict marker files in the metadata. */
+
+ if (!*conflict_skel)
+ *conflict_skel = svn_wc__conflict_skel_create(result_pool);
+
+ SVN_ERR(svn_wc__conflict_skel_add_text_conflict(*conflict_skel,
+ mt->db, mt->local_abspath,
+ target_copy,
+ left_copy,
+ right_copy,
+ result_pool,
+ scratch_pool));
}
if (*merge_outcome == svn_wc_merge_merged)
@@ -1169,8 +891,8 @@ merge_text_file(svn_skel_t **work_items,
done:
/* Remove the tempfile after use */
- SVN_ERR(svn_wc__wq_build_file_remove(&work_item,
- mt->db, result_target,
+ SVN_ERR(svn_wc__wq_build_file_remove(&work_item, mt->db, mt->local_abspath,
+ result_target,
result_pool, scratch_pool));
*work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
@@ -1178,10 +900,10 @@ done:
return SVN_NO_ERROR;
}
-
/* XXX Insane amount of parameters... */
static svn_error_t *
merge_binary_file(svn_skel_t **work_items,
+ svn_skel_t **conflict_skel,
enum svn_wc_merge_outcome_t *merge_outcome,
const merge_target_t *mt,
const char *left_abspath,
@@ -1190,11 +912,7 @@ merge_binary_file(svn_skel_t **work_item
const char *right_label,
const char *target_label,
svn_boolean_t dry_run,
- const svn_wc_conflict_version_t *left_version,
- const svn_wc_conflict_version_t *right_version,
const char *detranslated_target_abspath,
- svn_wc_conflict_resolver_func2_t conflict_func,
- void *conflict_baton,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
@@ -1204,7 +922,6 @@ merge_binary_file(svn_skel_t **work_item
const char *left_copy, *right_copy;
const char *merge_dirpath, *merge_filename;
const char *conflict_wrk;
- svn_skel_t *work_item;
*work_items = NULL;
@@ -1219,92 +936,6 @@ merge_binary_file(svn_skel_t **work_item
return SVN_NO_ERROR;
}
- /* Give the conflict resolution callback a chance to clean
- up the conflict before we mark the file 'conflicted' */
- if (conflict_func)
- {
- svn_wc_conflict_result_t *result = NULL;
- const svn_wc_conflict_description2_t *cdesc;
- const char *install_from = NULL;
-
- cdesc = setup_text_conflict_desc(left_abspath, right_abspath,
- mt->local_abspath,
- left_version, right_version,
- NULL /* result_target */,
- detranslated_target_abspath,
- get_prop(mt, SVN_PROP_MIME_TYPE),
- TRUE, pool);
-
- SVN_ERR(conflict_func(&result, cdesc, conflict_baton, pool, pool));
- if (result == NULL)
- return svn_error_create(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE,
- NULL, _("Conflict callback violated API:"
- " returned no results"));
-
- switch (result->choice)
- {
- /* For a binary file, there's no merged file to look at,
- unless the conflict-callback did the merging itself. */
- case svn_wc_conflict_choose_base:
- {
- install_from = left_abspath;
- *merge_outcome = svn_wc_merge_merged;
- break;
- }
- case svn_wc_conflict_choose_theirs_full:
- {
- install_from = right_abspath;
- *merge_outcome = svn_wc_merge_merged;
- break;
- }
- /* For a binary file, if the response is to use the
- user's file, we do nothing. We also do nothing if
- the response claims to have already resolved the
- problem.*/
- case svn_wc_conflict_choose_mine_full:
- {
- *merge_outcome = svn_wc_merge_merged;
- return SVN_NO_ERROR;
- }
- case svn_wc_conflict_choose_merged:
- {
- if (! result->merged_file)
- {
- /* Callback asked us to choose its own
- merged file, but didn't provide one! */
- return svn_error_create
- (SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE,
- NULL, _("Conflict callback violated API:"
- " returned no merged file"));
- }
- else
- {
- install_from = result->merged_file;
- *merge_outcome = svn_wc_merge_merged;
- break;
- }
- }
- case svn_wc_conflict_choose_postpone:
- default:
- {
- /* Assume conflict remains, fall through to code below. */
- }
- }
-
- if (install_from != NULL)
- {
- SVN_ERR(svn_wc__wq_build_file_install(work_items,
- mt->db, mt->local_abspath,
- install_from,
- FALSE /* use_commit_times */,
- FALSE /* record_fileinfo */,
- result_pool, scratch_pool));
-
- /* A merge choice was made, so we're done here. */
- return SVN_NO_ERROR;
- }
- }
-
/* reserve names for backups of left and right fulltexts */
SVN_ERR(svn_io_open_uniquely_named(NULL,
&left_copy,
@@ -1350,16 +981,15 @@ merge_binary_file(svn_skel_t **work_item
/* Mark target_abspath's entry as "Conflicted", and start tracking
the backup files in the entry as well. */
- SVN_ERR(svn_wc__wq_tmp_build_set_text_conflict_markers(&work_item,
- mt->db,
- mt->local_abspath,
- left_copy,
- right_copy,
- conflict_wrk,
- result_pool,
- scratch_pool));
+ if (!*conflict_skel)
+ *conflict_skel = svn_wc__conflict_skel_create(result_pool);
- *work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
+ SVN_ERR(svn_wc__conflict_skel_add_text_conflict(*conflict_skel,
+ mt->db, mt->local_abspath,
+ conflict_wrk,
+ left_copy,
+ right_copy,
+ result_pool, scratch_pool));
*merge_outcome = svn_wc_merge_conflict; /* a conflict happened */
@@ -1369,12 +999,11 @@ merge_binary_file(svn_skel_t **work_item
/* XXX Insane amount of parameters... */
svn_error_t *
svn_wc__internal_merge(svn_skel_t **work_items,
+ svn_skel_t **conflict_skel,
enum svn_wc_merge_outcome_t *merge_outcome,
svn_wc__db_t *db,
const char *left_abspath,
- const svn_wc_conflict_version_t *left_version,
const char *right_abspath,
- const svn_wc_conflict_version_t *right_version,
const char *target_abspath,
const char *wri_abspath,
const char *left_label,
@@ -1385,8 +1014,6 @@ svn_wc__internal_merge(svn_skel_t **work
const char *diff3_cmd,
const apr_array_header_t *merge_options,
const apr_array_header_t *prop_diff,
- svn_wc_conflict_resolver_func2_t conflict_func,
- void *conflict_baton,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *result_pool,
@@ -1441,12 +1068,14 @@ svn_wc__internal_merge(svn_skel_t **work
SVN_ERR(merge_file_trivial(work_items, merge_outcome,
left_abspath, right_abspath,
target_abspath, detranslated_target_abspath,
- dry_run, db, result_pool, scratch_pool));
+ dry_run, db, cancel_func, cancel_baton,
+ result_pool, scratch_pool));
if (*merge_outcome == svn_wc_merge_no_merge)
{
if (is_binary)
{
SVN_ERR(merge_binary_file(work_items,
+ conflict_skel,
merge_outcome,
&mt,
left_abspath,
@@ -1455,16 +1084,13 @@ svn_wc__internal_merge(svn_skel_t **work
right_label,
target_label,
dry_run,
- left_version,
- right_version,
detranslated_target_abspath,
- conflict_func,
- conflict_baton,
result_pool, scratch_pool));
}
else
{
SVN_ERR(merge_text_file(work_items,
+ conflict_skel,
merge_outcome,
&mt,
left_abspath,
@@ -1473,10 +1099,7 @@ svn_wc__internal_merge(svn_skel_t **work
right_label,
target_label,
dry_run,
- left_version,
- right_version,
detranslated_target_abspath,
- conflict_func, conflict_baton,
cancel_func, cancel_baton,
result_pool, scratch_pool));
}
@@ -1521,8 +1144,8 @@ svn_wc_merge5(enum svn_wc_merge_outcome_
apr_pool_t *scratch_pool)
{
const char *dir_abspath = svn_dirent_dirname(target_abspath, scratch_pool);
- svn_skel_t *prop_items = NULL;
svn_skel_t *work_items;
+ svn_skel_t *conflict_skel = NULL;
apr_hash_t *pristine_props = NULL;
apr_hash_t *actual_props = NULL;
apr_hash_t *new_actual_props = NULL;
@@ -1541,12 +1164,13 @@ svn_wc_merge5(enum svn_wc_merge_outcome_
svn_kind_t kind;
svn_boolean_t had_props;
svn_boolean_t props_mod;
+ svn_boolean_t conflicted;
SVN_ERR(svn_wc__db_read_info(&status, &kind, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, &had_props, &props_mod, NULL, NULL,
- NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL,
+ &conflicted, NULL, &had_props, &props_mod,
+ NULL, NULL, NULL,
wc_ctx->db, target_abspath,
scratch_pool, scratch_pool));
@@ -1559,6 +1183,31 @@ svn_wc_merge5(enum svn_wc_merge_outcome_
return SVN_NO_ERROR;
}
+ if (conflicted)
+ {
+ svn_boolean_t text_conflicted;
+ svn_boolean_t prop_conflicted;
+ svn_boolean_t tree_conflicted;
+
+ SVN_ERR(svn_wc__internal_conflicted_p(&text_conflicted,
+ &prop_conflicted,
+ &tree_conflicted,
+ wc_ctx->db, target_abspath,
+ scratch_pool));
+
+ /* We can't install two prop conflicts on a single node, so
+ avoid even checking that we have to merge it */
+ if (text_conflicted || prop_conflicted || tree_conflicted)
+ {
+ return svn_error_createf(
+ SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL,
+ _("Can't merge into conflicted node '%s'"),
+ svn_dirent_local_style(target_abspath,
+ scratch_pool));
+ }
+ /* else: Conflict was resolved by removing markers */
+ }
+
if (merge_props_outcome && had_props)
{
SVN_ERR(svn_wc__db_read_pristine_props(&pristine_props,
@@ -1600,24 +1249,24 @@ svn_wc_merge5(enum svn_wc_merge_outcome_
scratch_pool));
}
- SVN_ERR(svn_wc__merge_props(&prop_items, merge_props_outcome,
+ SVN_ERR(svn_wc__merge_props(&conflict_skel,
+ merge_props_outcome,
&new_pristine_props, &new_actual_props,
wc_ctx->db, target_abspath, svn_kind_file,
- left_version, right_version,
original_props, pristine_props, actual_props,
prop_diff, FALSE /* base_merge */,
dry_run,
- conflict_func, conflict_baton,
cancel_func, cancel_baton,
scratch_pool, scratch_pool));
}
/* Queue all the work. */
SVN_ERR(svn_wc__internal_merge(&work_items,
+ &conflict_skel,
merge_content_outcome,
wc_ctx->db,
- left_abspath, left_version,
- right_abspath, right_version,
+ left_abspath,
+ right_abspath,
target_abspath,
target_abspath,
left_label, right_label, target_label,
@@ -1626,26 +1275,54 @@ svn_wc_merge5(enum svn_wc_merge_outcome_
diff3_cmd,
merge_options,
prop_diff,
- conflict_func, conflict_baton,
cancel_func, cancel_baton,
scratch_pool, scratch_pool));
- work_items = svn_wc__wq_merge(prop_items, work_items, scratch_pool);
-
/* If this isn't a dry run, then run the work! */
if (!dry_run)
{
+ if (conflict_skel)
+ {
+ svn_skel_t *work_item;
+
+ SVN_ERR(svn_wc__conflict_skel_set_op_merge(conflict_skel,
+ left_version,
+ right_version,
+ scratch_pool,
+ scratch_pool));
+
+ SVN_ERR(svn_wc__conflict_create_markers(&work_item,
+ wc_ctx->db, target_abspath,
+ conflict_skel,
+ scratch_pool, scratch_pool));
+
+ work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
+ }
+
if (new_actual_props)
SVN_ERR(svn_wc__db_op_set_props(wc_ctx->db, target_abspath,
new_actual_props,
svn_wc__has_magic_property(prop_diff),
- NULL, work_items, scratch_pool));
- else
+ conflict_skel, work_items,
+ scratch_pool));
+ else if (conflict_skel)
+ SVN_ERR(svn_wc__db_op_mark_conflict(wc_ctx->db, target_abspath,
+ conflict_skel, work_items,
+ scratch_pool));
+ else if (work_items)
SVN_ERR(svn_wc__db_wq_add(wc_ctx->db, target_abspath, work_items,
scratch_pool));
- SVN_ERR(svn_wc__wq_run(wc_ctx->db, target_abspath,
- cancel_func, cancel_baton,
- scratch_pool));
+
+ if (work_items)
+ SVN_ERR(svn_wc__wq_run(wc_ctx->db, target_abspath,
+ cancel_func, cancel_baton,
+ scratch_pool));
+
+ if (conflict_skel && conflict_func)
+ SVN_ERR(svn_wc__conflict_invoke_resolver(wc_ctx->db, target_abspath,
+ conflict_skel, merge_options,
+ conflict_func, conflict_baton,
+ scratch_pool));
}
return SVN_NO_ERROR;
Modified: subversion/branches/master-passphrase/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_wc/node.c?rev=1361339&r1=1361338&r2=1361339&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_wc/node.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_wc/node.c Fri Jul 13 19:04:32 2012
@@ -1250,78 +1250,6 @@ svn_wc__node_get_schedule(svn_wc_schedul
}
svn_error_t *
-svn_wc__node_get_conflict_info(const char **conflict_old,
- const char **conflict_new,
- const char **conflict_wrk,
- const char **prejfile,
- svn_wc_context_t *wc_ctx,
- const char *local_abspath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- svn_boolean_t conflicted;
-
- SVN_ERR(svn_wc__db_read_info(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, &conflicted,
- NULL, NULL, NULL, NULL, NULL, NULL,
- wc_ctx->db, local_abspath,
- scratch_pool, scratch_pool));
-
- if (conflict_old)
- *conflict_old = NULL;
- if (conflict_new)
- *conflict_new = NULL;
- if (conflict_wrk)
- *conflict_wrk = NULL;
- if (prejfile)
- *prejfile = NULL;
-
- if (conflicted
- && (conflict_old || conflict_new || conflict_wrk || prejfile))
- {
- const apr_array_header_t *conflicts;
- int j;
- SVN_ERR(svn_wc__db_read_conflicts(&conflicts, wc_ctx->db, local_abspath,
- scratch_pool, scratch_pool));
-
- for (j = 0; j < conflicts->nelts; j++)
- {
- const svn_wc_conflict_description2_t *cd;
- cd = APR_ARRAY_IDX(conflicts, j,
- const svn_wc_conflict_description2_t *);
-
- switch (cd->kind)
- {
- case svn_wc_conflict_kind_text:
- if (conflict_old)
- *conflict_old = svn_dirent_basename(cd->base_abspath,
- result_pool);
-
- if (conflict_new)
- *conflict_new = svn_dirent_basename(cd->their_abspath,
- result_pool);
-
- if (conflict_wrk)
- *conflict_wrk = svn_dirent_basename(cd->my_abspath,
- result_pool);
- break;
-
- case svn_wc_conflict_kind_property:
- if (prejfile)
- *prejfile = svn_dirent_basename(cd->their_abspath,
- result_pool);
- break;
- case svn_wc_conflict_kind_tree:
- break;
- }
- }
- }
-
- return SVN_NO_ERROR;
-}
-
-svn_error_t *
svn_wc__node_clear_dav_cache_recursive(svn_wc_context_t *wc_ctx,
const char *local_abspath,
apr_pool_t *scratch_pool)