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 2013/10/15 10:52:18 UTC
svn commit: r1532250 [24/37] - in /subversion/branches/cache-server: ./
build/ build/ac-macros/ build/generator/ build/generator/swig/
build/generator/templates/ contrib/client-side/emacs/ contrib/hook-scripts/
contrib/server-side/fsfsfixer/ contrib/se...
Modified: subversion/branches/cache-server/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_wc/deprecated.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_wc/deprecated.c Tue Oct 15 08:52:06 2013
@@ -28,6 +28,7 @@
#include <apr_md5.h>
+#include "svn_private_config.h"
#include "svn_wc.h"
#include "svn_subst.h"
#include "svn_pools.h"
@@ -47,8 +48,6 @@
#include "translate.h"
#include "workqueue.h"
-#include "svn_private_config.h"
-
/* baton for traversal_info_update */
struct traversal_info_update_baton
{
@@ -2633,6 +2632,148 @@ svn_wc_props_modified_p(svn_boolean_t *m
}
+svn_error_t *
+svn_wc__status2_from_3(svn_wc_status2_t **status,
+ const svn_wc_status3_t *old_status,
+ svn_wc_context_t *wc_ctx,
+ const char *local_abspath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ const svn_wc_entry_t *entry = NULL;
+
+ if (old_status == NULL)
+ {
+ *status = NULL;
+ return SVN_NO_ERROR;
+ }
+
+ *status = apr_pcalloc(result_pool, sizeof(**status));
+
+ if (old_status->versioned)
+ {
+ svn_error_t *err;
+ err= svn_wc__get_entry(&entry, wc_ctx->db, local_abspath, FALSE,
+ svn_node_unknown, result_pool, scratch_pool);
+
+ if (err && err->apr_err == SVN_ERR_NODE_UNEXPECTED_KIND)
+ svn_error_clear(err);
+ else
+ SVN_ERR(err);
+ }
+
+ (*status)->entry = entry;
+ (*status)->copied = old_status->copied;
+ (*status)->repos_lock = svn_lock_dup(old_status->repos_lock, result_pool);
+
+ if (old_status->repos_relpath)
+ (*status)->url = svn_path_url_add_component2(old_status->repos_root_url,
+ old_status->repos_relpath,
+ result_pool);
+ (*status)->ood_last_cmt_rev = old_status->ood_changed_rev;
+ (*status)->ood_last_cmt_date = old_status->ood_changed_date;
+ (*status)->ood_kind = old_status->ood_kind;
+ (*status)->ood_last_cmt_author = old_status->ood_changed_author;
+
+ if (old_status->conflicted)
+ {
+ const svn_wc_conflict_description3_t *tree_conflict;
+ const svn_wc_conflict_description2_t *tree_conflict2;
+ SVN_ERR(svn_wc__get_tree_conflict(&tree_conflict, wc_ctx, local_abspath,
+ scratch_pool, scratch_pool));
+ tree_conflict2 = svn_wc__cd3_to_cd2(tree_conflict, scratch_pool);
+ (*status)->tree_conflict = svn_wc__cd2_to_cd(tree_conflict2, result_pool);
+ }
+
+ (*status)->switched = old_status->switched;
+
+ (*status)->text_status = old_status->node_status;
+ (*status)->prop_status = old_status->prop_status;
+
+ (*status)->repos_text_status = old_status->repos_node_status;
+ (*status)->repos_prop_status = old_status->repos_prop_status;
+
+ /* Some values might be inherited from properties */
+ if (old_status->node_status == svn_wc_status_modified
+ || old_status->node_status == svn_wc_status_conflicted)
+ (*status)->text_status = old_status->text_status;
+
+ /* (Currently a no-op, but just make sure it is ok) */
+ if (old_status->repos_node_status == svn_wc_status_modified
+ || old_status->repos_node_status == svn_wc_status_conflicted)
+ (*status)->repos_text_status = old_status->repos_text_status;
+
+ if (old_status->node_status == svn_wc_status_added)
+ (*status)->prop_status = svn_wc_status_none; /* No separate info */
+
+ /* Find pristine_text_status value */
+ switch (old_status->text_status)
+ {
+ case svn_wc_status_none:
+ case svn_wc_status_normal:
+ case svn_wc_status_modified:
+ (*status)->pristine_text_status = old_status->text_status;
+ break;
+ case svn_wc_status_conflicted:
+ default:
+ /* ### Fetch compare data, or fall back to the documented
+ not retrieved behavior? */
+ (*status)->pristine_text_status = svn_wc_status_none;
+ break;
+ }
+
+ /* Find pristine_prop_status value */
+ switch (old_status->prop_status)
+ {
+ case svn_wc_status_none:
+ case svn_wc_status_normal:
+ case svn_wc_status_modified:
+ if (old_status->node_status != svn_wc_status_added
+ && old_status->node_status != svn_wc_status_deleted
+ && old_status->node_status != svn_wc_status_replaced)
+ {
+ (*status)->pristine_prop_status = old_status->prop_status;
+ }
+ else
+ (*status)->pristine_prop_status = svn_wc_status_none;
+ break;
+ case svn_wc_status_conflicted:
+ default:
+ /* ### Fetch compare data, or fall back to the documented
+ not retrieved behavior? */
+ (*status)->pristine_prop_status = svn_wc_status_none;
+ break;
+ }
+
+ if (old_status->versioned
+ && old_status->conflicted
+ && old_status->node_status != svn_wc_status_obstructed
+ && (old_status->kind == svn_node_file
+ || old_status->node_status != svn_wc_status_missing))
+ {
+ svn_boolean_t text_conflict_p, prop_conflict_p;
+
+ /* The entry says there was a conflict, but the user might have
+ marked it as resolved by deleting the artifact files, so check
+ for that. */
+ SVN_ERR(svn_wc__internal_conflicted_p(&text_conflict_p,
+ &prop_conflict_p,
+ NULL,
+ wc_ctx->db, local_abspath,
+ scratch_pool));
+
+ if (text_conflict_p)
+ (*status)->text_status = svn_wc_status_conflicted;
+
+ if (prop_conflict_p)
+ (*status)->prop_status = svn_wc_status_conflicted;
+ }
+
+ return SVN_NO_ERROR;
+}
+
+
+
/*** From status.c ***/
struct status4_wrapper_baton
@@ -4580,3 +4721,98 @@ svn_wc_read_kind(svn_node_kind_t *kind,
return SVN_NO_ERROR;
}
+
+svn_wc_conflict_description2_t *
+svn_wc_conflict_description_create_text2(const char *local_abspath,
+ apr_pool_t *result_pool)
+{
+ svn_wc_conflict_description2_t *conflict;
+
+ SVN_ERR_ASSERT_NO_RETURN(svn_dirent_is_absolute(local_abspath));
+
+ conflict = apr_pcalloc(result_pool, sizeof(*conflict));
+ conflict->local_abspath = apr_pstrdup(result_pool, local_abspath);
+ conflict->node_kind = svn_node_file;
+ conflict->kind = svn_wc_conflict_kind_text;
+ conflict->action = svn_wc_conflict_action_edit;
+ conflict->reason = svn_wc_conflict_reason_edited;
+ return conflict;
+}
+
+svn_wc_conflict_description2_t *
+svn_wc_conflict_description_create_prop2(const char *local_abspath,
+ svn_node_kind_t node_kind,
+ const char *property_name,
+ apr_pool_t *result_pool)
+{
+ svn_wc_conflict_description2_t *conflict;
+
+ SVN_ERR_ASSERT_NO_RETURN(svn_dirent_is_absolute(local_abspath));
+
+ conflict = apr_pcalloc(result_pool, sizeof(*conflict));
+ conflict->local_abspath = apr_pstrdup(result_pool, local_abspath);
+ conflict->node_kind = node_kind;
+ conflict->kind = svn_wc_conflict_kind_property;
+ conflict->property_name = apr_pstrdup(result_pool, property_name);
+ return conflict;
+}
+
+svn_wc_conflict_description2_t *
+svn_wc_conflict_description_create_tree2(
+ const char *local_abspath,
+ svn_node_kind_t node_kind,
+ svn_wc_operation_t operation,
+ const svn_wc_conflict_version_t *src_left_version,
+ const svn_wc_conflict_version_t *src_right_version,
+ apr_pool_t *result_pool)
+{
+ svn_wc_conflict_description2_t *conflict;
+
+ SVN_ERR_ASSERT_NO_RETURN(svn_dirent_is_absolute(local_abspath));
+
+ conflict = apr_pcalloc(result_pool, sizeof(*conflict));
+ conflict->local_abspath = apr_pstrdup(result_pool, local_abspath);
+ conflict->node_kind = node_kind;
+ conflict->kind = svn_wc_conflict_kind_tree;
+ conflict->operation = operation;
+ conflict->src_left_version = svn_wc_conflict_version_dup(src_left_version,
+ result_pool);
+ conflict->src_right_version = svn_wc_conflict_version_dup(src_right_version,
+ result_pool);
+ return conflict;
+}
+
+svn_wc_conflict_description2_t *
+svn_wc__conflict_description2_dup(const svn_wc_conflict_description2_t *conflict,
+ apr_pool_t *pool)
+{
+ svn_wc_conflict_description2_t *new_conflict;
+
+ new_conflict = apr_pcalloc(pool, sizeof(*new_conflict));
+
+ /* Shallow copy all members. */
+ *new_conflict = *conflict;
+
+ if (conflict->local_abspath)
+ new_conflict->local_abspath = apr_pstrdup(pool, conflict->local_abspath);
+ 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);
+ if (conflict->base_abspath)
+ new_conflict->base_abspath = apr_pstrdup(pool, conflict->base_abspath);
+ if (conflict->their_abspath)
+ new_conflict->their_abspath = apr_pstrdup(pool, conflict->their_abspath);
+ if (conflict->my_abspath)
+ new_conflict->my_abspath = apr_pstrdup(pool, conflict->my_abspath);
+ 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;
+}
Modified: subversion/branches/cache-server/subversion/libsvn_wc/diff_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_wc/diff_editor.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_wc/diff_editor.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_wc/diff_editor.c Tue Oct 15 08:52:06 2013
@@ -57,6 +57,7 @@
#include <assert.h>
+#include "svn_private_config.h"
#include "svn_error.h"
#include "svn_pools.h"
#include "svn_dirent_uri.h"
@@ -75,8 +76,6 @@
#include "translate.h"
#include "diff.h"
-#include "svn_private_config.h"
-
/*-------------------------------------------------------------------------*/
@@ -474,14 +473,18 @@ svn_wc__diff_base_working_diff(svn_wc__d
{
const svn_io_dirent2_t *dirent;
+ /* Verify truename to mimic status for iota/IOTA difference on Windows */
SVN_ERR(svn_io_stat_dirent2(&dirent, local_abspath,
- FALSE /* verify truename */,
+ TRUE /* verify truename */,
TRUE /* ingore_enoent */,
scratch_pool, scratch_pool));
- if (dirent->kind == svn_node_file
- && dirent->filesize == recorded_size
- && dirent->mtime == recorded_time)
+ /* If a file does not exist on disk (missing/obstructed) then we
+ can't provide a text diff */
+ if (dirent->kind != svn_node_file
+ || (dirent->kind == svn_node_file
+ && dirent->filesize == recorded_size
+ && dirent->mtime == recorded_time))
{
files_same = TRUE;
}
@@ -2362,9 +2365,9 @@ wrap_ensure_empty_file(wc_diff_wrap_bato
return SVN_NO_ERROR;
/* Create a unique file in the tempdir */
- SVN_ERR(svn_io_open_uniquely_named(NULL, &wb->empty_file, NULL, NULL, NULL,
- svn_io_file_del_on_pool_cleanup,
- wb->result_pool, scratch_pool));
+ SVN_ERR(svn_io_open_unique_file3(NULL, &wb->empty_file, NULL,
+ svn_io_file_del_on_pool_cleanup,
+ wb->result_pool, scratch_pool));
return SVN_NO_ERROR;
}
@@ -2431,8 +2434,8 @@ wrap_dir_opened(void **new_dir_baton,
/* svn_diff_tree_processor_t function */
static svn_error_t *
wrap_dir_added(const char *relpath,
- const svn_diff_source_t *right_source,
const svn_diff_source_t *copyfrom_source,
+ const svn_diff_source_t *right_source,
/*const*/ apr_hash_t *copyfrom_props,
/*const*/ apr_hash_t *right_props,
void *dir_baton,
Modified: subversion/branches/cache-server/subversion/libsvn_wc/diff_local.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_wc/diff_local.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_wc/diff_local.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_wc/diff_local.c Tue Oct 15 08:52:06 2013
@@ -31,6 +31,7 @@
#include <apr_hash.h>
+#include "svn_private_config.h"
#include "svn_error.h"
#include "svn_pools.h"
#include "svn_dirent_uri.h"
@@ -45,8 +46,6 @@
#include "translate.h"
#include "diff.h"
-#include "svn_private_config.h"
-
/*-------------------------------------------------------------------------*/
/* Baton containing the state of a directory
@@ -195,14 +194,15 @@ diff_status_callback(void *baton,
struct diff_baton *eb = baton;
svn_wc__db_t *db = eb->db;
- switch (status->node_status)
- {
- case svn_wc_status_unversioned:
- case svn_wc_status_ignored:
- return SVN_NO_ERROR; /* No diff */
+ if (! status->versioned)
+ return SVN_NO_ERROR; /* unversioned (includes dir externals) */
- default:
- break; /* Go check other conditions */
+ if (status->node_status == svn_wc_status_conflicted
+ && status->text_status == svn_wc_status_none
+ && status->prop_status == svn_wc_status_none)
+ {
+ /* Node is an actual only node describing a tree conflict */
+ return SVN_NO_ERROR;
}
/* Not text/prop modified, not copied. Easy out */
Modified: subversion/branches/cache-server/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_wc/entries.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_wc/entries.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_wc/entries.c Tue Oct 15 08:52:06 2013
@@ -26,6 +26,7 @@
#include <apr_strings.h>
+#include "svn_private_config.h"
#include "svn_error.h"
#include "svn_types.h"
#include "svn_time.h"
@@ -45,7 +46,6 @@
#include "wc_db.h"
#include "wc-queries.h" /* for STMT_* */
-#include "svn_private_config.h"
#include "private/svn_wc_private.h"
#include "private/svn_sqlite.h"
@@ -464,9 +464,9 @@ read_one_entry(const svn_wc_entry_t **ne
for (j = 0; j < child_conflicts->nelts; j++)
{
- const svn_wc_conflict_description2_t *conflict =
+ const svn_wc_conflict_description3_t *conflict =
APR_ARRAY_IDX(child_conflicts, j,
- svn_wc_conflict_description2_t *);
+ svn_wc_conflict_description3_t *);
if (conflict->kind == svn_wc_conflict_kind_tree)
{
@@ -1565,7 +1565,9 @@ insert_actual_node(svn_sqlite__db_t *sdb
actual_node->conflict_new,
actual_node->prop_reject,
actual_node->tree_conflict_data,
- strlen(actual_node->tree_conflict_data),
+ actual_node->tree_conflict_data
+ ? strlen(actual_node->tree_conflict_data)
+ : 0,
scratch_pool, scratch_pool));
if (conflict_data)
@@ -1890,15 +1892,15 @@ write_entry(struct write_baton **entry_n
scratch_pool);
tree_conflicts = apr_hash_make(result_pool);
skel = skel->children;
- while(skel)
+ while (skel)
{
- svn_wc_conflict_description2_t *conflict;
+ svn_wc_conflict_description3_t *conflict;
svn_skel_t *new_skel;
const char *key;
/* *CONFLICT is allocated so it is safe to use a non-const pointer */
SVN_ERR(svn_wc__deserialize_conflict(
- (const svn_wc_conflict_description2_t**)&conflict,
+ (const svn_wc_conflict_description3_t**)&conflict,
skel,
svn_dirent_join(root_abspath,
local_relpath,
Modified: subversion/branches/cache-server/subversion/libsvn_wc/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_wc/externals.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_wc/externals.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_wc/externals.c Tue Oct 15 08:52:06 2013
@@ -32,6 +32,7 @@
#include <apr_general.h>
#include <apr_uri.h>
+#include "svn_private_config.h"
#include "svn_dirent_uri.h"
#include "svn_path.h"
#include "svn_error.h"
@@ -53,8 +54,6 @@
#include "translate.h"
#include "workqueue.h"
#include "conflicts.h"
-
-#include "svn_private_config.h"
/** Externals **/
@@ -1413,6 +1412,7 @@ svn_wc__external_remove(svn_wc_context_t
SVN_ERR(svn_wc__db_base_remove(wc_ctx->db, local_abspath,
FALSE /* keep_as_working */,
TRUE /* queue_deletes */,
+ FALSE /* remove_locks */,
SVN_INVALID_REVNUM,
NULL, NULL, scratch_pool));
SVN_ERR(svn_wc__wq_run(wc_ctx->db, local_abspath,
Modified: subversion/branches/cache-server/subversion/libsvn_wc/info.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_wc/info.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_wc/info.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_wc/info.c Tue Oct 15 08:52:06 2013
@@ -21,6 +21,7 @@
* @endcopyright
*/
+#include "svn_private_config.h"
#include "svn_dirent_uri.h"
#include "svn_hash.h"
#include "svn_path.h"
@@ -29,7 +30,6 @@
#include "wc.h"
-#include "svn_private_config.h"
#include "private/svn_wc_private.h"
@@ -310,10 +310,16 @@ build_info_for_node(svn_wc__info2_t **in
local_abspath, result_pool, scratch_pool));
if (conflicted)
- SVN_ERR(svn_wc__read_conflicts(&wc_info->conflicts, db,
- local_abspath,
- TRUE /* ### create tempfiles */,
- result_pool, scratch_pool));
+ {
+ const apr_array_header_t *conflicts;
+
+ SVN_ERR(svn_wc__read_conflicts(&conflicts, db,
+ local_abspath,
+ TRUE /* ### create tempfiles */,
+ result_pool, scratch_pool));
+ wc_info->conflicts = svn_wc__cd3_array_to_cd2_array(conflicts,
+ result_pool);
+ }
else
wc_info->conflicts = NULL;
@@ -373,7 +379,7 @@ struct found_entry_baton
svn_boolean_t actual_only;
svn_boolean_t first;
/* The set of tree conflicts that have been found but not (yet) visited by
- * the tree walker. Map of abspath -> svn_wc_conflict_description2_t. */
+ * the tree walker. Map of abspath -> empty string. */
apr_hash_t *tree_conflicts;
apr_pool_t *pool;
};
@@ -534,8 +540,9 @@ 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;
+ const svn_wc_conflict_description3_t *tree_conflict;
svn_wc__info2_t *info;
+ const apr_array_header_t *conflicts;
svn_pool_clear(iterpool);
@@ -548,7 +555,7 @@ svn_wc__get_info(svn_wc_context_t *wc_ct
&repos_uuid,
wc_ctx->db,
svn_dirent_dirname(
- local_abspath,
+ this_abspath,
iterpool),
scratch_pool,
iterpool));
@@ -557,21 +564,22 @@ svn_wc__get_info(svn_wc_context_t *wc_ct
info->repos_root_URL = repos_root_url;
info->repos_UUID = repos_uuid;
- SVN_ERR(svn_wc__read_conflicts(&info->wc_info->conflicts,
+ SVN_ERR(svn_wc__read_conflicts(&conflicts,
wc_ctx->db, this_abspath,
TRUE /* ### create tempfiles */,
iterpool, iterpool));
-
- if (! info->wc_info->conflicts || ! info->wc_info->conflicts->nelts)
+ if (! conflicts || ! conflicts->nelts)
continue;
- tree_conflict = APR_ARRAY_IDX(info->wc_info->conflicts, 0,
- svn_wc_conflict_description2_t *);
+ tree_conflict = APR_ARRAY_IDX(conflicts, 0,
+ const svn_wc_conflict_description3_t *);
if (!depth_includes(local_abspath, depth, tree_conflict->local_abspath,
tree_conflict->node_kind, iterpool))
continue;
+ info->wc_info->conflicts = svn_wc__cd3_array_to_cd2_array(conflicts,
+ iterpool);
SVN_ERR(receiver(receiver_baton, this_abspath, info, iterpool));
}
svn_pool_destroy(iterpool);
Modified: subversion/branches/cache-server/subversion/libsvn_wc/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_wc/lock.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_wc/lock.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_wc/lock.c Tue Oct 15 08:52:06 2013
@@ -26,6 +26,7 @@
#include <apr_pools.h>
#include <apr_time.h>
+#include "svn_private_config.h"
#include "svn_pools.h"
#include "svn_dirent_uri.h"
#include "svn_path.h"
@@ -39,7 +40,6 @@
#include "props.h"
#include "wc_db.h"
-#include "svn_private_config.h"
#include "private/svn_wc_private.h"
Modified: subversion/branches/cache-server/subversion/libsvn_wc/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_wc/merge.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_wc/merge.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_wc/merge.c Tue Oct 15 08:52:06 2013
@@ -871,10 +871,11 @@ merge_text_file(svn_skel_t **work_items,
SVN_ERR(svn_io_file_close(result_f, pool));
/* Determine the MERGE_OUTCOME, and record any conflict. */
- if (contains_conflicts && ! dry_run)
+ if (contains_conflicts)
{
*merge_outcome = svn_wc_merge_conflict;
- if (*merge_outcome == svn_wc_merge_conflict)
+
+ if (! dry_run)
{
const char *left_copy, *right_copy, *target_copy;
@@ -902,12 +903,7 @@ merge_text_file(svn_skel_t **work_items,
result_pool,
scratch_pool));
}
-
- if (*merge_outcome == svn_wc_merge_merged)
- goto done;
}
- else if (contains_conflicts && dry_run)
- *merge_outcome = svn_wc_merge_conflict;
else
{
svn_boolean_t same, special;
@@ -941,7 +937,6 @@ merge_text_file(svn_skel_t **work_items,
*work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
}
-done:
/* Remove the tempfile after use */
SVN_ERR(svn_wc__wq_build_file_remove(&work_item, mt->db, mt->local_abspath,
result_target,
Modified: subversion/branches/cache-server/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_wc/node.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_wc/node.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_wc/node.c Tue Oct 15 08:52:06 2013
@@ -38,6 +38,7 @@
#include <apr_pools.h>
#include <apr_time.h>
+#include "svn_private_config.h"
#include "svn_pools.h"
#include "svn_dirent_uri.h"
#include "svn_path.h"
@@ -49,7 +50,6 @@
#include "entries.h"
#include "wc_db.h"
-#include "svn_private_config.h"
#include "private/svn_wc_private.h"
Modified: subversion/branches/cache-server/subversion/libsvn_wc/old-and-busted.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_wc/old-and-busted.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_wc/old-and-busted.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_wc/old-and-busted.c Tue Oct 15 08:52:06 2013
@@ -23,6 +23,7 @@
+#include "svn_private_config.h"
#include "svn_time.h"
#include "svn_xml.h"
#include "svn_dirent_uri.h"
@@ -37,7 +38,6 @@
#include "lock.h"
#include "private/svn_wc_private.h"
-#include "svn_private_config.h"
/* Within the (old) entries file, boolean values have a specific string
@@ -811,11 +811,15 @@ atts_to_entry(svn_wc_entry_t **new_entry
### not used by loggy; no need to set MODIFY_FLAGS */
entry->url = extract_string(atts, ENTRIES_ATTR_URL, pool);
+ if (entry->url)
+ entry->url = svn_uri_canonicalize(entry->url, pool);
/* Set up repository root. Make sure it is a prefix of url.
### not used by loggy; no need to set MODIFY_FLAGS */
entry->repos = extract_string(atts, ENTRIES_ATTR_REPOS, pool);
+ if (entry->repos)
+ entry->repos = svn_uri_canonicalize(entry->repos, pool);
if (entry->url && entry->repos
&& !svn_uri__is_ancestor(entry->repos, entry->url))
Modified: subversion/branches/cache-server/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_wc/props.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_wc/props.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_wc/props.c Tue Oct 15 08:52:06 2013
@@ -33,6 +33,7 @@
#include <apr_strings.h>
#include <apr_general.h>
+#include "svn_private_config.h"
#include "svn_types.h"
#include "svn_string.h"
#include "svn_pools.h"
@@ -60,8 +61,6 @@
#include "workqueue.h"
#include "conflicts.h"
-#include "svn_private_config.h"
-
/* Forward declaration. */
static svn_error_t *
prop_conflict_from_skel(const svn_string_t **conflict_desc,
@@ -81,12 +80,10 @@ append_prop_conflict(svn_stream_t *strea
/* TODO: someday, perhaps prefix each conflict_description with a
timestamp or something? */
const svn_string_t *conflict_desc;
- const char *native_text;
SVN_ERR(prop_conflict_from_skel(&conflict_desc, prop_skel, pool, pool));
- native_text = svn_utf_cstring_from_utf8_fuzzy(conflict_desc->data, pool);
- return svn_stream_puts(stream, native_text);
+ return svn_stream_puts(stream, conflict_desc->data);
}
/*---------------------------------------------------------------------*/
@@ -614,12 +611,26 @@ prop_conflict_from_skel(const svn_string
const char *mine_marker = _("<<<<<<< (local property value)");
const char *incoming_marker = _(">>>>>>> (incoming property value)");
const char *separator = "=======";
+ svn_string_t *original_ascii =
+ svn_string_create(svn_utf_cstring_from_utf8_fuzzy(original->data,
+ scratch_pool),
+ scratch_pool);
+ svn_string_t *mine_ascii =
+ svn_string_create(svn_utf_cstring_from_utf8_fuzzy(mine->data,
+ scratch_pool),
+ scratch_pool);
+ svn_string_t *incoming_ascii =
+ svn_string_create(svn_utf_cstring_from_utf8_fuzzy(incoming->data,
+ scratch_pool),
+ scratch_pool);
style = svn_diff_conflict_display_modified_latest;
stream = svn_stream_from_stringbuf(buf, scratch_pool);
SVN_ERR(svn_stream_skip(stream, buf->len));
SVN_ERR(svn_diff_mem_string_output_merge2(stream, diff,
- original, mine, incoming,
+ original_ascii,
+ mine_ascii,
+ incoming_ascii,
NULL, mine_marker,
incoming_marker, separator,
style, scratch_pool));
@@ -1626,9 +1637,9 @@ validate_eol_prop_against_file(const cha
if (mime_type && svn_mime_type_is_binary(mime_type->data))
return svn_error_createf
(SVN_ERR_ILLEGAL_TARGET, NULL,
- _("Can't set '" SVN_PROP_EOL_STYLE "': "
+ _("Can't set '%s': "
"file '%s' has binary mime type property"),
- path_display);
+ SVN_PROP_EOL_STYLE, path_display);
/* Now ask the getter for the contents of the file; this will do a
newline translation. All we really care about here is whether or
Modified: subversion/branches/cache-server/subversion/libsvn_wc/revert.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_wc/revert.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_wc/revert.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_wc/revert.c Tue Oct 15 08:52:06 2013
@@ -29,6 +29,7 @@
#include <apr_pools.h>
#include <apr_tables.h>
+#include "svn_private_config.h"
#include "svn_types.h"
#include "svn_pools.h"
#include "svn_string.h"
@@ -43,7 +44,6 @@
#include "adm_files.h"
#include "workqueue.h"
-#include "svn_private_config.h"
#include "private/svn_io_private.h"
#include "private/svn_wc_private.h"
Modified: subversion/branches/cache-server/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_wc/status.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_wc/status.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_wc/status.c Tue Oct 15 08:52:06 2013
@@ -30,6 +30,7 @@
#include <apr_file_io.h>
#include <apr_hash.h>
+#include "svn_private_config.h"
#include "svn_pools.h"
#include "svn_types.h"
#include "svn_delta.h"
@@ -43,8 +44,6 @@
#include "svn_hash.h"
#include "svn_sorts.h"
-#include "svn_private_config.h"
-
#include "wc.h"
#include "props.h"
#include "entries.h"
Modified: subversion/branches/cache-server/subversion/libsvn_wc/translate.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_wc/translate.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_wc/translate.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_wc/translate.c Tue Oct 15 08:52:06 2013
@@ -30,6 +30,7 @@
#include <apr_file_io.h>
#include <apr_strings.h>
+#include "svn_private_config.h"
#include "svn_types.h"
#include "svn_string.h"
#include "svn_dirent_uri.h"
@@ -45,11 +46,9 @@
#include "translate.h"
#include "props.h"
-#include "svn_private_config.h"
#include "private/svn_wc_private.h"
-
/* */
static svn_error_t *
read_handler_unsupported(void *baton, char *buffer, apr_size_t *len)
Modified: subversion/branches/cache-server/subversion/libsvn_wc/tree_conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_wc/tree_conflicts.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_wc/tree_conflicts.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_wc/tree_conflicts.c Tue Oct 15 08:52:06 2013
@@ -196,7 +196,7 @@ read_node_version_info(const svn_wc_conf
svn_error_t *
-svn_wc__deserialize_conflict(const svn_wc_conflict_description2_t **conflict,
+svn_wc__deserialize_conflict(const svn_wc_conflict_description3_t **conflict,
const svn_skel_t *skel,
const char *dir_path,
apr_pool_t *result_pool,
@@ -211,7 +211,7 @@ svn_wc__deserialize_conflict(const svn_w
const svn_wc_conflict_version_t *src_left_version;
const svn_wc_conflict_version_t *src_right_version;
int n;
- svn_wc_conflict_description2_t *new_conflict;
+ svn_wc_conflict_description3_t *new_conflict;
if (!is_valid_conflict_skel(skel))
return svn_error_createf(SVN_ERR_WC_CORRUPT, NULL,
@@ -266,7 +266,7 @@ svn_wc__deserialize_conflict(const svn_w
SVN_ERR(read_node_version_info(&src_right_version, skel->next,
result_pool, scratch_pool));
- new_conflict = svn_wc_conflict_description_create_tree2(victim_abspath,
+ new_conflict = svn_wc_conflict_description_create_tree3(victim_abspath,
node_kind, operation, src_left_version, src_right_version,
result_pool);
new_conflict->action = action;
@@ -329,7 +329,7 @@ prepend_version_info_skel(svn_skel_t *pa
svn_error_t *
svn_wc__serialize_conflict(svn_skel_t **skel,
- const svn_wc_conflict_description2_t *conflict,
+ const svn_wc_conflict_description3_t *conflict,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
@@ -401,7 +401,7 @@ svn_wc__del_tree_conflict(svn_wc_context
svn_error_t *
svn_wc__add_tree_conflict(svn_wc_context_t *wc_ctx,
- const svn_wc_conflict_description2_t *conflict,
+ const svn_wc_conflict_description3_t *conflict,
apr_pool_t *scratch_pool)
{
svn_boolean_t existing_conflict;
@@ -443,7 +443,7 @@ svn_wc__add_tree_conflict(svn_wc_context
NULL,
scratch_pool, scratch_pool));
- switch(conflict->operation)
+ switch (conflict->operation)
{
case svn_wc_operation_update:
default:
@@ -473,7 +473,7 @@ svn_wc__add_tree_conflict(svn_wc_context
svn_error_t *
-svn_wc__get_tree_conflict(const svn_wc_conflict_description2_t **tree_conflict,
+svn_wc__get_tree_conflict(const svn_wc_conflict_description3_t **tree_conflict,
svn_wc_context_t *wc_ctx,
const char *local_abspath,
apr_pool_t *result_pool,
@@ -495,17 +495,18 @@ svn_wc__get_tree_conflict(const svn_wc_c
for (i = 0; i < conflicts->nelts; i++)
{
- const svn_wc_conflict_description2_t *desc;
+ const svn_wc_conflict_description3_t *desc;
- desc = APR_ARRAY_IDX(conflicts, i, svn_wc_conflict_description2_t *);
+ desc = APR_ARRAY_IDX(conflicts, i, svn_wc_conflict_description3_t *);
if (desc->kind == svn_wc_conflict_kind_tree)
{
- *tree_conflict = svn_wc__conflict_description2_dup(desc,
- result_pool);
+ *tree_conflict = svn_wc__conflict_description3_dup(desc, result_pool);
return SVN_NO_ERROR;
}
}
+
+ *tree_conflict = NULL;
return SVN_NO_ERROR;
}
Modified: subversion/branches/cache-server/subversion/libsvn_wc/tree_conflicts.h
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_wc/tree_conflicts.h?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_wc/tree_conflicts.h (original)
+++ subversion/branches/cache-server/subversion/libsvn_wc/tree_conflicts.h Tue Oct 15 08:52:06 2013
@@ -62,18 +62,18 @@ extern "C" {
svn_error_t *
svn_wc__serialize_conflict(svn_skel_t **skel,
- const svn_wc_conflict_description2_t *conflict,
+ const svn_wc_conflict_description3_t *conflict,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-/* Parse a newly allocated svn_wc_conflict_description2_t object from the
+/* Parse a newly allocated svn_wc_conflict_description3_t object from the
* provided SKEL. Return the result in *CONFLICT, allocated in RESULT_POOL.
* DIR_PATH is the path to the WC directory whose conflicts are being read.
* Use SCRATCH_POOL for temporary allocations.
*/
svn_error_t *
-svn_wc__deserialize_conflict(const svn_wc_conflict_description2_t **conflict,
+svn_wc__deserialize_conflict(const svn_wc_conflict_description3_t **conflict,
const svn_skel_t *skel,
const char *dir_path,
apr_pool_t *result_pool,
Modified: subversion/branches/cache-server/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_wc/update_editor.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_wc/update_editor.c Tue Oct 15 08:52:06 2013
@@ -32,6 +32,7 @@
#include <apr_tables.h>
#include <apr_strings.h>
+#include "svn_private_config.h"
#include "svn_types.h"
#include "svn_pools.h"
#include "svn_hash.h"
@@ -40,7 +41,6 @@
#include "svn_path.h"
#include "svn_error.h"
#include "svn_io.h"
-#include "svn_private_config.h"
#include "svn_time.h"
#include "wc.h"
@@ -1011,9 +1011,13 @@ window_handler(svn_txdelta_window_t *win
if (err)
{
- /* We failed to apply the delta; clean up the temporary file. */
- svn_error_clear(svn_io_remove_file2(hb->new_text_base_tmp_abspath, TRUE,
- hb->pool));
+ /* We failed to apply the delta; clean up the temporary file if it
+ already created by lazy_open_target(). */
+ if (hb->new_text_base_tmp_abspath)
+ {
+ svn_error_clear(svn_io_remove_file2(hb->new_text_base_tmp_abspath,
+ TRUE, hb->pool));
+ }
}
else
{
@@ -1706,7 +1710,7 @@ delete_entry(const char *path,
const char *base = svn_relpath_basename(path, NULL);
const char *local_abspath;
const char *repos_relpath;
- svn_node_kind_t kind, base_kind;
+ svn_node_kind_t kind;
svn_revnum_t old_revision;
svn_boolean_t conflicted;
svn_boolean_t have_work;
@@ -1735,6 +1739,7 @@ delete_entry(const char *path,
{
svn_boolean_t is_root;
+
SVN_ERR(svn_wc__db_is_wcroot(&is_root, eb->db, local_abspath,
scratch_pool));
@@ -1762,10 +1767,9 @@ delete_entry(const char *path,
if (!have_work)
{
base_status = status;
- base_kind = kind;
}
else
- SVN_ERR(svn_wc__db_base_get_info(&base_status, &base_kind, &old_revision,
+ SVN_ERR(svn_wc__db_base_get_info(&base_status, NULL, &old_revision,
&repos_relpath,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL,
@@ -1813,6 +1817,7 @@ delete_entry(const char *path,
SVN_ERR(svn_wc__db_base_remove(eb->db, local_abspath,
FALSE /* keep_as_working */,
FALSE /* queue_deletes */,
+ FALSE /* remove_locks */,
SVN_INVALID_REVNUM /* not_present_rev */,
NULL, NULL,
scratch_pool));
@@ -1836,9 +1841,7 @@ delete_entry(const char *path,
{
SVN_ERR(check_tree_conflict(&tree_conflict, eb, local_abspath,
status, TRUE,
- (kind == svn_node_dir)
- ? svn_node_dir
- : svn_node_file,
+ kind,
svn_wc_conflict_action_delete,
pb->pool, scratch_pool));
}
@@ -1911,7 +1914,7 @@ delete_entry(const char *path,
{
/* Delete, and do not leave a not-present node. */
SVN_ERR(svn_wc__db_base_remove(eb->db, local_abspath,
- keep_as_working, queue_deletes,
+ keep_as_working, queue_deletes, FALSE,
SVN_INVALID_REVNUM /* not_present_rev */,
tree_conflict, NULL,
scratch_pool));
@@ -1920,7 +1923,7 @@ delete_entry(const char *path,
{
/* Delete, leaving a not-present node. */
SVN_ERR(svn_wc__db_base_remove(eb->db, local_abspath,
- keep_as_working, queue_deletes,
+ keep_as_working, queue_deletes, FALSE,
*eb->target_revision,
tree_conflict, NULL,
scratch_pool));
@@ -1939,8 +1942,19 @@ delete_entry(const char *path,
/* Notify. */
if (tree_conflict)
- do_notification(eb, local_abspath, svn_node_unknown,
- svn_wc_notify_tree_conflict, scratch_pool);
+ {
+ if (eb->conflict_func)
+ SVN_ERR(svn_wc__conflict_invoke_resolver(eb->db, local_abspath,
+ tree_conflict,
+ NULL /* merge_options */,
+ eb->conflict_func,
+ eb->conflict_baton,
+ eb->cancel_func,
+ eb->cancel_baton,
+ scratch_pool));
+ do_notification(eb, local_abspath, svn_node_unknown,
+ svn_wc_notify_tree_conflict, scratch_pool);
+ }
else
{
svn_wc_notify_action_t action = svn_wc_notify_update_delete;
@@ -2289,6 +2303,16 @@ add_directory(const char *path,
if (tree_conflict != NULL)
{
+ if (eb->conflict_func)
+ SVN_ERR(svn_wc__conflict_invoke_resolver(eb->db, db->local_abspath,
+ tree_conflict,
+ NULL /* merge_options */,
+ eb->conflict_func,
+ eb->conflict_baton,
+ eb->cancel_func,
+ eb->cancel_baton,
+ pool));
+
db->already_notified = TRUE;
do_notification(eb, db->local_abspath, svn_node_dir,
svn_wc_notify_tree_conflict, pool);
@@ -2907,7 +2931,7 @@ close_directory(void *dir_baton,
eb->conflict_func,
eb->conflict_baton,
eb->cancel_func,
- eb->conflict_baton,
+ eb->cancel_baton,
scratch_pool));
/* Notify of any prop changes on this directory -- but do nothing if
@@ -2986,18 +3010,55 @@ absent_node(const char *path,
kind = svn_node_unknown;
}
- if (status == svn_wc__db_status_normal
- && kind == svn_node_dir)
+ if (status == svn_wc__db_status_normal)
{
- /* We found an obstructing working copy!
+ svn_boolean_t wcroot;
+ /* We found an obstructing working copy or a file external! */
- We can do two things now:
- 1) notify the user, record a skip, etc.
- 2) Just record the absent node in BASE in the parent
- working copy.
+ SVN_ERR(svn_wc__db_is_wcroot(&wcroot, eb->db, local_abspath,
+ scratch_pool));
- As option 2 happens to be exactly what we do anyway, lets do that.
- */
+ if (wcroot)
+ {
+ /*
+ We have an obstructing working copy; possibly a directory external
+
+ We can do two things now:
+ 1) notify the user, record a skip, etc.
+ 2) Just record the absent node in BASE in the parent
+ working copy.
+
+ As option 2 happens to be exactly what we do anyway, fall through.
+ */
+ }
+ else
+ {
+ /* The server asks us to replace a file external
+ (Existing BASE node; not reported by the working copy crawler or
+ there would have been a delete_entry() call.
+
+ There is no way we can store this state in the working copy as
+ the BASE layer is already filled.
+
+ We could error out, but that is not helping anybody; the user is not
+ even seeing with what the file external would be replaced, so let's
+ report a skip and continue the update.
+ */
+
+ if (eb->notify_func)
+ {
+ svn_wc_notify_t *notify;
+ notify = svn_wc_create_notify(
+ local_abspath,
+ svn_wc_notify_update_skip_obstruction,
+ scratch_pool);
+
+ eb->notify_func(eb->notify_baton, notify, scratch_pool);
+ }
+
+ svn_pool_destroy(scratch_pool);
+ return SVN_NO_ERROR;
+ }
}
else if (status == svn_wc__db_status_not_present
|| status == svn_wc__db_status_server_excluded
@@ -3380,6 +3441,16 @@ add_file(const char *path,
tree_conflict, NULL,
scratch_pool));
+ if (eb->conflict_func)
+ SVN_ERR(svn_wc__conflict_invoke_resolver(eb->db, fb->local_abspath,
+ tree_conflict,
+ NULL /* merge_options */,
+ eb->conflict_func,
+ eb->conflict_baton,
+ eb->cancel_func,
+ eb->cancel_baton,
+ scratch_pool));
+
fb->already_notified = TRUE;
do_notification(eb, fb->local_abspath, svn_node_file,
svn_wc_notify_tree_conflict, scratch_pool);
@@ -4703,6 +4774,7 @@ close_edit(void *edit_baton,
SVN_ERR(svn_wc__db_base_remove(eb->db, eb->target_abspath,
FALSE /* keep_as_working */,
FALSE /* queue_deletes */,
+ FALSE /* remove_locks */,
SVN_INVALID_REVNUM,
NULL, NULL, scratch_pool));
}
Modified: subversion/branches/cache-server/subversion/libsvn_wc/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_wc/upgrade.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_wc/upgrade.c Tue Oct 15 08:52:06 2013
@@ -23,6 +23,7 @@
#include <apr_pools.h>
+#include "svn_private_config.h"
#include "svn_types.h"
#include "svn_pools.h"
#include "svn_dirent_uri.h"
@@ -38,7 +39,6 @@
#include "wc-queries.h" /* for STMT_* */
#include "workqueue.h"
-#include "svn_private_config.h"
#include "private/svn_wc_private.h"
#include "private/svn_sqlite.h"
#include "private/svn_token.h"
@@ -654,8 +654,8 @@ ensure_repos_info(svn_wc_entry_t *entry,
/*
* Read tree conflict descriptions from @a conflict_data. Set @a *conflicts
- * to a hash of pointers to svn_wc_conflict_description2_t objects indexed by
- * svn_wc_conflict_description2_t.local_abspath, all newly allocated in @a
+ * to a hash of pointers to svn_wc_conflict_description3_t objects indexed by
+ * svn_wc_conflict_description3_t.local_abspath, all newly allocated in @a
* pool. @a dir_path is the path to the working copy directory whose conflicts
* are being read. The conflicts read are the tree conflicts on the immediate
* child nodes of @a dir_path. Do all allocations in @a pool.
@@ -692,7 +692,7 @@ read_tree_conflicts(apr_hash_t **conflic
iterpool = svn_pool_create(pool);
for (skel = skel->children; skel != NULL; skel = skel->next)
{
- const svn_wc_conflict_description2_t *conflict;
+ const svn_wc_conflict_description3_t *conflict;
svn_pool_clear(iterpool);
SVN_ERR(svn_wc__deserialize_conflict(&conflict, skel, dir_path,
@@ -727,7 +727,7 @@ migrate_single_tree_conflict_data(svn_sq
hi;
hi = apr_hash_next(hi))
{
- const svn_wc_conflict_description2_t *conflict =
+ const svn_wc_conflict_description3_t *conflict =
svn__apr_hash_index_val(hi);
const char *conflict_relpath;
const char *conflict_data;
@@ -1431,7 +1431,7 @@ svn_wc__upgrade_conflict_skel_from_raw(s
if (tree_conflict_data)
{
svn_skel_t *tc_skel;
- const svn_wc_conflict_description2_t *tc;
+ const svn_wc_conflict_description3_t *tc;
const char *local_abspath;
if (!conflict_data)
@@ -2196,13 +2196,15 @@ svn_wc_upgrade(svn_wc_context_t *wc_ctx,
upgrade_working_copy_baton_t cb_baton;
svn_error_t *err;
int result_format;
+ svn_boolean_t bumped_format;
/* Try upgrading a wc-ng-style working copy. */
SVN_ERR(svn_wc__db_open(&db, NULL /* ### config */, TRUE, FALSE,
scratch_pool, scratch_pool));
- err = svn_wc__db_bump_format(&result_format, local_abspath, db,
+ err = svn_wc__db_bump_format(&result_format, &bumped_format,
+ db, local_abspath,
scratch_pool);
if (err)
{
@@ -2224,6 +2226,17 @@ svn_wc_upgrade(svn_wc_context_t *wc_ctx,
SVN_ERR_ASSERT(result_format == SVN_WC__VERSION);
+ if (bumped_format && notify_func)
+ {
+ svn_wc_notify_t *notify;
+
+ notify = svn_wc_create_notify(local_abspath,
+ svn_wc_notify_upgraded_path,
+ scratch_pool);
+
+ notify_func(notify_baton, notify, scratch_pool);
+ }
+
return SVN_NO_ERROR;
}
Modified: subversion/branches/cache-server/subversion/libsvn_wc/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_wc/util.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_wc/util.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_wc/util.c Tue Oct 15 08:52:06 2013
@@ -188,11 +188,11 @@ svn_wc_match_ignore_list(const char *str
return svn_cstring_match_glob_list(str, list);
}
-svn_wc_conflict_description2_t *
-svn_wc_conflict_description_create_text2(const char *local_abspath,
+svn_wc_conflict_description3_t *
+svn_wc_conflict_description_create_text3(const char *local_abspath,
apr_pool_t *result_pool)
{
- svn_wc_conflict_description2_t *conflict;
+ svn_wc_conflict_description3_t *conflict;
SVN_ERR_ASSERT_NO_RETURN(svn_dirent_is_absolute(local_abspath));
@@ -205,13 +205,13 @@ svn_wc_conflict_description_create_text2
return conflict;
}
-svn_wc_conflict_description2_t *
-svn_wc_conflict_description_create_prop2(const char *local_abspath,
+svn_wc_conflict_description3_t *
+svn_wc_conflict_description_create_prop3(const char *local_abspath,
svn_node_kind_t node_kind,
const char *property_name,
apr_pool_t *result_pool)
{
- svn_wc_conflict_description2_t *conflict;
+ svn_wc_conflict_description3_t *conflict;
SVN_ERR_ASSERT_NO_RETURN(svn_dirent_is_absolute(local_abspath));
@@ -223,8 +223,8 @@ svn_wc_conflict_description_create_prop2
return conflict;
}
-svn_wc_conflict_description2_t *
-svn_wc_conflict_description_create_tree2(
+svn_wc_conflict_description3_t *
+svn_wc_conflict_description_create_tree3(
const char *local_abspath,
svn_node_kind_t node_kind,
svn_wc_operation_t operation,
@@ -232,7 +232,7 @@ svn_wc_conflict_description_create_tree2
const svn_wc_conflict_version_t *src_right_version,
apr_pool_t *result_pool)
{
- svn_wc_conflict_description2_t *conflict;
+ svn_wc_conflict_description3_t *conflict;
SVN_ERR_ASSERT_NO_RETURN(svn_dirent_is_absolute(local_abspath));
@@ -249,11 +249,11 @@ svn_wc_conflict_description_create_tree2
}
-svn_wc_conflict_description2_t *
-svn_wc__conflict_description2_dup(const svn_wc_conflict_description2_t *conflict,
+svn_wc_conflict_description3_t *
+svn_wc__conflict_description3_dup(const svn_wc_conflict_description3_t *conflict,
apr_pool_t *pool)
{
- svn_wc_conflict_description2_t *new_conflict;
+ svn_wc_conflict_description3_t *new_conflict;
new_conflict = apr_pcalloc(pool, sizeof(*new_conflict));
@@ -339,6 +339,90 @@ svn_wc_conflict_version_dup(const svn_wc
return new_version;
}
+apr_array_header_t *
+svn_wc__cd3_array_to_cd2_array(const apr_array_header_t *conflicts,
+ apr_pool_t *result_pool)
+{
+ apr_array_header_t *new_conflicts;
+ int i;
+
+ new_conflicts = apr_array_make(result_pool, conflicts->nelts,
+ sizeof (svn_wc_conflict_description2_t *));
+
+ for (i = 0; i < conflicts->nelts; i++)
+ {
+ svn_wc_conflict_description3_t *cd;
+ svn_wc_conflict_description2_t *cd2;
+
+ cd = APR_ARRAY_IDX(conflicts, i, svn_wc_conflict_description3_t *);
+ cd2 = svn_wc__cd3_to_cd2(cd, result_pool);
+ APR_ARRAY_PUSH(new_conflicts, svn_wc_conflict_description2_t *) = cd2;
+ }
+
+ return new_conflicts;
+}
+
+svn_wc_conflict_description2_t *
+svn_wc__cd3_to_cd2(const svn_wc_conflict_description3_t *conflict,
+ apr_pool_t *result_pool)
+{
+ svn_wc_conflict_description2_t *new_conflict;
+
+ if (conflict == NULL)
+ return NULL;
+
+ new_conflict = apr_pcalloc(result_pool, sizeof(*new_conflict));
+
+ if (conflict->local_abspath)
+ new_conflict->local_abspath = apr_pstrdup(result_pool,
+ conflict->local_abspath);
+ new_conflict->node_kind = conflict->node_kind;
+ new_conflict->kind = conflict->kind;
+ if (conflict->property_name)
+ new_conflict->property_name = apr_pstrdup(result_pool,
+ conflict->property_name);
+ new_conflict->is_binary = conflict->is_binary;
+ if (conflict->mime_type)
+ new_conflict->mime_type = apr_pstrdup(result_pool, conflict->mime_type);
+ new_conflict->action = conflict->action;
+ new_conflict->reason = conflict->reason;
+ if (conflict->base_abspath)
+ new_conflict->base_abspath = apr_pstrdup(result_pool,
+ conflict->base_abspath);
+
+ if (conflict->kind == svn_wc_conflict_kind_property)
+ {
+ /* For property conflicts, cd2 stored prop_reject_abspath in
+ * their_abspath, and stored theirs_abspath in merged_file. */
+ if (conflict->prop_reject_abspath)
+ new_conflict->their_abspath = apr_pstrdup(result_pool,
+ conflict->prop_reject_abspath);
+ if (conflict->their_abspath)
+ new_conflict->merged_file = apr_pstrdup(result_pool,
+ conflict->their_abspath);
+ }
+ else
+ {
+ if (conflict->their_abspath)
+ new_conflict->their_abspath = apr_pstrdup(result_pool,
+ conflict->their_abspath);
+
+ if (conflict->merged_file)
+ new_conflict->merged_file = apr_pstrdup(result_pool,
+ conflict->merged_file);
+ }
+ if (conflict->my_abspath)
+ new_conflict->my_abspath = apr_pstrdup(result_pool, conflict->my_abspath);
+ new_conflict->operation = conflict->operation;
+ 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);
+
+ return new_conflict;
+}
svn_wc_conflict_description_t *
svn_wc__cd2_to_cd(const svn_wc_conflict_description2_t *conflict,
@@ -403,145 +487,6 @@ svn_wc__cd2_to_cd(const svn_wc_conflict_
svn_error_t *
-svn_wc__status2_from_3(svn_wc_status2_t **status,
- const svn_wc_status3_t *old_status,
- svn_wc_context_t *wc_ctx,
- const char *local_abspath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- const svn_wc_entry_t *entry = NULL;
-
- if (old_status == NULL)
- {
- *status = NULL;
- return SVN_NO_ERROR;
- }
-
- *status = apr_pcalloc(result_pool, sizeof(**status));
-
- if (old_status->versioned)
- {
- svn_error_t *err;
- err= svn_wc__get_entry(&entry, wc_ctx->db, local_abspath, FALSE,
- svn_node_unknown, result_pool, scratch_pool);
-
- if (err && err->apr_err == SVN_ERR_NODE_UNEXPECTED_KIND)
- svn_error_clear(err);
- else
- SVN_ERR(err);
- }
-
- (*status)->entry = entry;
- (*status)->copied = old_status->copied;
- (*status)->repos_lock = svn_lock_dup(old_status->repos_lock, result_pool);
-
- if (old_status->repos_relpath)
- (*status)->url = svn_path_url_add_component2(old_status->repos_root_url,
- old_status->repos_relpath,
- result_pool);
- (*status)->ood_last_cmt_rev = old_status->ood_changed_rev;
- (*status)->ood_last_cmt_date = old_status->ood_changed_date;
- (*status)->ood_kind = old_status->ood_kind;
- (*status)->ood_last_cmt_author = old_status->ood_changed_author;
-
- if (old_status->conflicted)
- {
- const svn_wc_conflict_description2_t *tree_conflict;
- SVN_ERR(svn_wc__get_tree_conflict(&tree_conflict, wc_ctx, local_abspath,
- scratch_pool, scratch_pool));
- (*status)->tree_conflict = svn_wc__cd2_to_cd(tree_conflict, result_pool);
- }
-
- (*status)->switched = old_status->switched;
-
- (*status)->text_status = old_status->node_status;
- (*status)->prop_status = old_status->prop_status;
-
- (*status)->repos_text_status = old_status->repos_node_status;
- (*status)->repos_prop_status = old_status->repos_prop_status;
-
- /* Some values might be inherited from properties */
- if (old_status->node_status == svn_wc_status_modified
- || old_status->node_status == svn_wc_status_conflicted)
- (*status)->text_status = old_status->text_status;
-
- /* (Currently a no-op, but just make sure it is ok) */
- if (old_status->repos_node_status == svn_wc_status_modified
- || old_status->repos_node_status == svn_wc_status_conflicted)
- (*status)->repos_text_status = old_status->repos_text_status;
-
- if (old_status->node_status == svn_wc_status_added)
- (*status)->prop_status = svn_wc_status_none; /* No separate info */
-
- /* Find pristine_text_status value */
- switch (old_status->text_status)
- {
- case svn_wc_status_none:
- case svn_wc_status_normal:
- case svn_wc_status_modified:
- (*status)->pristine_text_status = old_status->text_status;
- break;
- case svn_wc_status_conflicted:
- default:
- /* ### Fetch compare data, or fall back to the documented
- not retrieved behavior? */
- (*status)->pristine_text_status = svn_wc_status_none;
- break;
- }
-
- /* Find pristine_prop_status value */
- switch (old_status->prop_status)
- {
- case svn_wc_status_none:
- case svn_wc_status_normal:
- case svn_wc_status_modified:
- if (old_status->node_status != svn_wc_status_added
- && old_status->node_status != svn_wc_status_deleted
- && old_status->node_status != svn_wc_status_replaced)
- {
- (*status)->pristine_prop_status = old_status->prop_status;
- }
- else
- (*status)->pristine_prop_status = svn_wc_status_none;
- break;
- case svn_wc_status_conflicted:
- default:
- /* ### Fetch compare data, or fall back to the documented
- not retrieved behavior? */
- (*status)->pristine_prop_status = svn_wc_status_none;
- break;
- }
-
- if (old_status->versioned
- && old_status->conflicted
- && old_status->node_status != svn_wc_status_obstructed
- && (old_status->kind == svn_node_file
- || old_status->node_status != svn_wc_status_missing))
- {
- svn_boolean_t text_conflict_p, prop_conflict_p;
-
- /* The entry says there was a conflict, but the user might have
- marked it as resolved by deleting the artifact files, so check
- for that. */
- SVN_ERR(svn_wc__internal_conflicted_p(&text_conflict_p,
- &prop_conflict_p,
- NULL,
- wc_ctx->db, local_abspath,
- scratch_pool));
-
- if (text_conflict_p)
- (*status)->text_status = svn_wc_status_conflicted;
-
- if (prop_conflict_p)
- (*status)->prop_status = svn_wc_status_conflicted;
- }
-
- return SVN_NO_ERROR;
-}
-
-
-svn_error_t *
svn_wc__fetch_kind_func(svn_node_kind_t *kind,
void *baton,
const char *path,
Modified: subversion/branches/cache-server/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_wc/wc-queries.sql?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/cache-server/subversion/libsvn_wc/wc-queries.sql Tue Oct 15 08:52:06 2013
@@ -472,6 +472,10 @@ WHERE wc_id = ?1
DELETE FROM lock
WHERE repos_id = ?1 AND repos_relpath = ?2
+-- STMT_DELETE_LOCK_RECURSIVELY
+DELETE FROM lock
+WHERE repos_id = ?1 AND (repos_relpath = ?2 OR IS_STRICT_DESCENDANT_OF(repos_relpath, ?2))
+
-- STMT_CLEAR_BASE_NODE_RECURSIVE_DAV_CACHE
UPDATE nodes SET dav_cache = NULL
WHERE dav_cache IS NOT NULL AND wc_id = ?1 AND op_depth = 0
@@ -1567,7 +1571,7 @@ WHERE wc_id = ?1
AND moved_to IS NOT NULL
-- STMT_SELECT_MOVED_OUTSIDE
-SELECT local_relpath, moved_to FROM nodes
+SELECT local_relpath, moved_to, op_depth FROM nodes
WHERE wc_id = ?1
AND (local_relpath = ?2 OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
AND op_depth >= ?3
Modified: subversion/branches/cache-server/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_wc/wc.h?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_wc/wc.h (original)
+++ subversion/branches/cache-server/subversion/libsvn_wc/wc.h Tue Oct 15 08:52:06 2013
@@ -157,6 +157,8 @@ extern "C" {
* The bump to 31 added the inherited_props column in the NODES table.
* Bumped in r1395109.
*
+ * == 1.8.x shipped with format 31
+ *
* Please document any further format changes here.
*/
@@ -681,7 +683,7 @@ svn_wc__write_check(svn_wc__db_t *db,
const char *local_abspath,
apr_pool_t *scratch_pool);
-/* Read into CONFLICTS svn_wc_conflict_description2_t* structs
+/* Read into CONFLICTS svn_wc_conflict_description3_t* structs
* for all conflicts that have LOCAL_ABSPATH as victim.
*
* Victim must be versioned or be part of a tree conflict.
Modified: subversion/branches/cache-server/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_wc/wc_db.c?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/cache-server/subversion/libsvn_wc/wc_db.c Tue Oct 15 08:52:06 2013
@@ -27,6 +27,7 @@
#include <apr_pools.h>
#include <apr_hash.h>
+#include "svn_private_config.h"
#include "svn_types.h"
#include "svn_error.h"
#include "svn_dirent_uri.h"
@@ -48,7 +49,6 @@
#include "workqueue.h"
#include "token-map.h"
-#include "svn_private_config.h"
#include "private/svn_sqlite.h"
#include "private/svn_skel.h"
#include "private/svn_wc_private.h"
@@ -1529,7 +1529,6 @@ svn_wc__db_init(svn_wc__db_t *db,
apr_pstrdup(db->state_pool, local_abspath),
sdb, wc_id, FORMAT_FROM_SDB,
FALSE /* auto-upgrade */,
- FALSE /* enforce_empty_wq */,
db->state_pool, scratch_pool));
/* The WCROOT is complete. Stash it into DB. */
@@ -2086,6 +2085,7 @@ db_base_remove(svn_wc__db_wcroot_t *wcro
svn_wc__db_t *db, /* For checking conflicts */
svn_boolean_t keep_as_working,
svn_boolean_t queue_deletes,
+ svn_boolean_t remove_locks,
svn_revnum_t not_present_revision,
svn_skel_t *conflict,
svn_skel_t *work_items,
@@ -2106,6 +2106,16 @@ db_base_remove(svn_wc__db_wcroot_t *wcro
wcroot, local_relpath,
scratch_pool, scratch_pool));
+ if (remove_locks)
+ {
+ svn_sqlite__stmt_t *lock_stmt;
+
+ SVN_ERR(svn_sqlite__get_statement(&lock_stmt, wcroot->sdb,
+ STMT_DELETE_LOCK_RECURSIVELY));
+ SVN_ERR(svn_sqlite__bindf(lock_stmt, "is", repos_id, repos_relpath));
+ SVN_ERR(svn_sqlite__step_done(lock_stmt));
+ }
+
if (status == svn_wc__db_status_normal
&& keep_as_working)
{
@@ -2237,6 +2247,12 @@ db_base_remove(svn_wc__db_wcroot_t *wcro
* might introduce actual-only nodes without direct parents,
* and we're not yet sure if other existing code is prepared
* to handle such nodes. To be revisited post-1.8.
+ *
+ * ### In case of a conflict we are most likely creating WORKING nodes
+ * describing a copy of what was in BASE. The move information
+ * should be updated to describe a move from the WORKING layer.
+ * When stored that way the resolver of the tree conflict still has
+ * the knowledge of what was moved.
*/
SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
STMT_SELECT_MOVED_OUTSIDE));
@@ -2333,6 +2349,7 @@ svn_wc__db_base_remove(svn_wc__db_t *db,
const char *local_abspath,
svn_boolean_t keep_as_working,
svn_boolean_t queue_deletes,
+ svn_boolean_t remove_locks,
svn_revnum_t not_present_revision,
svn_skel_t *conflict,
svn_skel_t *work_items,
@@ -2349,7 +2366,7 @@ svn_wc__db_base_remove(svn_wc__db_t *db,
SVN_WC__DB_WITH_TXN(db_base_remove(wcroot, local_relpath,
db, keep_as_working, queue_deletes,
- not_present_revision,
+ remove_locks, not_present_revision,
conflict, work_items, scratch_pool),
wcroot);
@@ -6376,6 +6393,7 @@ op_revert_txn(void *baton,
{
SVN_ERR(svn_wc__db_resolve_break_moved_away_internal(wcroot,
local_relpath,
+ op_depth,
scratch_pool));
}
else
@@ -6542,10 +6560,12 @@ op_revert_recursive_txn(void *baton,
while (have_row)
{
const char *move_src_relpath = svn_sqlite__column_text(stmt, 0, NULL);
+ int move_op_depth = svn_sqlite__column_int(stmt, 2);
svn_error_t *err;
err = svn_wc__db_resolve_break_moved_away_internal(wcroot,
move_src_relpath,
+ move_op_depth,
scratch_pool);
if (err)
return svn_error_compose_create(err, svn_sqlite__reset(stmt));
@@ -10814,7 +10834,7 @@ commit_node(svn_wc__db_wcroot_t *wcroot,
svn_sqlite__stmt_t *lock_stmt;
SVN_ERR(svn_sqlite__get_statement(&lock_stmt, wcroot->sdb,
- STMT_DELETE_LOCK));
+ STMT_DELETE_LOCK_RECURSIVELY));
SVN_ERR(svn_sqlite__bindf(lock_stmt, "is", repos_id, repos_relpath));
SVN_ERR(svn_sqlite__step_done(lock_stmt));
}
@@ -11058,7 +11078,7 @@ bump_node_revision(svn_wc__db_wcroot_t *
revision != new_rev)))
{
return svn_error_trace(db_base_remove(wcroot, local_relpath,
- db, FALSE, FALSE,
+ db, FALSE, FALSE, FALSE,
SVN_INVALID_REVNUM,
NULL, NULL, scratch_pool));
}
@@ -12117,38 +12137,6 @@ svn_wc__db_follow_moved_to(apr_array_hea
return SVN_NO_ERROR;
}
-/* Extract the moved-to information for LOCAL_RELPATH at OP-DEPTH by
- examining the lowest working node above OP_DEPTH. The output paths
- are NULL if there is no move, otherwise:
-
- *MOVE_DST_RELPATH: the moved-to destination of LOCAL_RELPATH.
-
- *MOVE_DST_OP_ROOT_RELPATH: the moved-to destination of the root of
- the move of LOCAL_RELPATH. This may be equal to *MOVE_DST_RELPATH
- if LOCAL_RELPATH is the root of the move.
-
- *MOVE_SRC_ROOT_RELPATH: the root of the move source. For moves
- inside a delete this will be different from *MOVE_SRC_OP_ROOT_RELPATH.
-
- *MOVE_SRC_OP_ROOT_RELPATH: the root of the source layer that
- contains the move. For moves inside deletes this is the root of
- the delete, for other moves this is the root of the move.
-
- Given a path A/B/C with A/B moved to X then for A/B/C
-
- MOVE_DST_RELPATH is X/C
- MOVE_DST_OP_ROOT_RELPATH is X
- MOVE_SRC_ROOT_RELPATH is A/B
- MOVE_SRC_OP_ROOT_RELPATH is A/B
-
- If A is then deleted the MOVE_DST_RELPATH, MOVE_DST_OP_ROOT_RELPATH
- and MOVE_SRC_ROOT_RELPATH remain the same but MOVE_SRC_OP_ROOT_RELPATH
- changes to A.
-
- ### Think about combining with scan_deletion? Also with
- ### scan_addition to get moved-to for replaces? Do we need to
- ### return the op-root of the move source, i.e. A/B in the example
- ### above? */
svn_error_t *
svn_wc__db_op_depth_moved_to(const char **move_dst_relpath,
const char **move_dst_op_root_relpath,
@@ -12165,6 +12153,8 @@ svn_wc__db_op_depth_moved_to(const char
int delete_op_depth;
const char *relpath = local_relpath;
+ SVN_ERR_ASSERT(local_relpath[0]); /* Not valid on the WC root */
+
*move_dst_relpath = *move_dst_op_root_relpath = NULL;
*move_src_root_relpath = *move_src_op_root_relpath = NULL;
@@ -12180,14 +12170,17 @@ svn_wc__db_op_depth_moved_to(const char
*move_dst_op_root_relpath = svn_sqlite__column_text(stmt, 3,
result_pool);
if (*move_dst_op_root_relpath)
- *move_src_root_relpath = apr_pstrdup(result_pool, relpath);
+ {
+ *move_src_root_relpath = apr_pstrdup(result_pool, relpath);
+ SVN_ERR(svn_sqlite__reset(stmt));
+
+ break;
+ }
}
SVN_ERR(svn_sqlite__reset(stmt));
- if (!*move_dst_op_root_relpath)
- relpath = svn_relpath_dirname(relpath, scratch_pool);
+ relpath = svn_relpath_dirname(relpath, scratch_pool);
}
- while (!*move_dst_op_root_relpath
- && have_row && delete_op_depth <= relpath_depth(relpath));
+ while (have_row && delete_op_depth <= relpath_depth(relpath));
if (*move_dst_op_root_relpath)
{
@@ -12288,7 +12281,6 @@ svn_wc__db_upgrade_begin(svn_sqlite__db_
dir_abspath),
*sdb, *wc_id, FORMAT_FROM_SDB,
FALSE /* auto-upgrade */,
- FALSE /* enforce_empty_wq */,
wc_db->state_pool, scratch_pool));
/* The WCROOT is complete. Stash it into DB. */
@@ -13493,6 +13485,7 @@ wclock_obtain_cb(svn_wc__db_wcroot_t *wc
const char *local_relpath,
int levels_to_lock,
svn_boolean_t steal_lock,
+ svn_boolean_t enforce_empty_wq,
apr_pool_t *scratch_pool)
{
svn_sqlite__stmt_t *stmt;
@@ -13522,6 +13515,9 @@ wclock_obtain_cb(svn_wc__db_wcroot_t *wc
scratch_pool));
}
+ if (enforce_empty_wq)
+ SVN_ERR(svn_wc__db_verify_no_work(wcroot->sdb));
+
/* Check if there are nodes locked below the new lock root */
SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb, STMT_FIND_WC_LOCK));
SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
@@ -13696,7 +13692,7 @@ svn_wc__db_wclock_obtain(svn_wc__db_t *d
SVN_WC__DB_WITH_TXN(
wclock_obtain_cb(wcroot, local_relpath, levels_to_lock, steal_lock,
- scratch_pool),
+ db->enforce_empty_wq, scratch_pool),
wcroot);
return SVN_NO_ERROR;
}
@@ -14978,14 +14974,18 @@ svn_wc__db_verify(svn_wc__db_t *db,
svn_error_t *
svn_wc__db_bump_format(int *result_format,
- const char *wcroot_abspath,
+ svn_boolean_t *bumped_format,
svn_wc__db_t *db,
+ const char *wcroot_abspath,
apr_pool_t *scratch_pool)
{
svn_sqlite__db_t *sdb;
svn_error_t *err;
int format;
+ if (bumped_format)
+ *bumped_format = FALSE;
+
/* Do not scan upwards for a working copy root here to prevent accidental
* upgrades of any working copies the WCROOT might be nested in.
* Just try to open a DB at the specified path instead. */
@@ -15020,7 +15020,10 @@ svn_wc__db_bump_format(int *result_forma
SVN_ERR(svn_sqlite__read_schema_version(&format, sdb, scratch_pool));
err = svn_wc__upgrade_sdb(result_format, wcroot_abspath,
- sdb, format, scratch_pool);
+ sdb, format, scratch_pool);
+
+ if (err == SVN_NO_ERROR && bumped_format)
+ *bumped_format = (*result_format > format);
/* Make sure we return a different error than expected for upgrades from
entries */
Modified: subversion/branches/cache-server/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_wc/wc_db.h?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/cache-server/subversion/libsvn_wc/wc_db.h Tue Oct 15 08:52:06 2013
@@ -702,6 +702,9 @@ svn_wc__db_base_add_not_present_node(svn
(With KEEP_AS_WORKING TRUE, this is a no-op, as everything is
automatically shadowed by the created copy)
+ If REMOVE_LOCKS is TRUE, all locks of this node and any subnodes
+ are also removed. This is to be done during commit of deleted nodes.
+
If NOT_PRESENT_REVISION specifies a valid revision a not-present
node is installed in BASE node with kind NOT_PRESENT_KIND after
deleting.
@@ -715,6 +718,7 @@ svn_wc__db_base_remove(svn_wc__db_t *db,
const char *local_abspath,
svn_boolean_t keep_as_working,
svn_boolean_t queue_deletes,
+ svn_boolean_t remove_locks,
svn_revnum_t not_present_revision,
svn_skel_t *conflict,
svn_skel_t *work_items,
@@ -2120,7 +2124,7 @@ svn_wc__db_read_pristine_props(apr_hash_
* paths relative to the repository root URL for cached inherited
* properties and absolute working copy paths otherwise.
*
- * If ACTUAL_PROPS is not NULL, then set *ACTUAL_PROPS to the actual
+ * If ACTUAL_PROPS is not NULL, then set *ACTUAL_PROPS to ALL the actual
* properties stored on LOCAL_ABSPATH.
*
* Allocate @a *iprops in @a result_pool. Use @a scratch_pool
@@ -2909,11 +2913,15 @@ svn_wc__db_upgrade_get_repos_id(apr_int6
* Upgrading subdirectories of a working copy is not supported.
* If WCROOT_ABSPATH is not a working copy root SVN_ERR_WC_INVALID_OP_ON_CWD
* is returned.
+ *
+ * If BUMPED_FORMAT is not NULL, set *BUMPED_FORMAT to TRUE if the format
+ * was bumped or to FALSE if the wc was already at the resulting format.
*/
svn_error_t *
svn_wc__db_bump_format(int *result_format,
- const char *wcroot_abspath,
+ svn_boolean_t *bumped_format,
svn_wc__db_t *db,
+ const char *wcroot_abspath,
apr_pool_t *scratch_pool);
/* @} */
@@ -3374,7 +3382,14 @@ svn_wc__db_resolve_delete_raise_moved_aw
apr_pool_t *scratch_pool);
/* Like svn_wc__db_resolve_delete_raise_moved_away this should be
- combined. */
+ combined.
+
+ ### LOCAL_ABSPATH specifies the move origin, but the move origin
+ ### is not necessary unique enough. This function needs an op_root_abspath
+ ### argument to differentiate between different origins.
+
+ ### See move_tests.py: move_many_update_delete for an example case.
+ */
svn_error_t *
svn_wc__db_resolve_break_moved_away(svn_wc__db_t *db,
const char *local_abspath,
Modified: subversion/branches/cache-server/subversion/libsvn_wc/wc_db_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/cache-server/subversion/libsvn_wc/wc_db_private.h?rev=1532250&r1=1532249&r2=1532250&view=diff
==============================================================================
--- subversion/branches/cache-server/subversion/libsvn_wc/wc_db_private.h (original)
+++ subversion/branches/cache-server/subversion/libsvn_wc/wc_db_private.h Tue Oct 15 08:52:06 2013
@@ -42,7 +42,8 @@ struct svn_wc__db_t {
opened, and found to be not-current? */
svn_boolean_t verify_format;
- /* Should we ensure the WORK_QUEUE is empty when a WCROOT is opened? */
+ /* Should we ensure the WORK_QUEUE is empty when a DB is locked
+ * for writing? */
svn_boolean_t enforce_empty_wq;
/* Should we open Sqlite databases EXCLUSIVE */
@@ -122,7 +123,6 @@ svn_wc__db_pdh_create_wcroot(svn_wc__db_
apr_int64_t wc_id,
int format,
svn_boolean_t verify_format,
- svn_boolean_t enforce_empty_wq,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
@@ -145,6 +145,9 @@ svn_wc__db_wcroot_parse_local_abspath(sv
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
+/* Return an error if the work queue in SDB is non-empty. */
+svn_error_t *
+svn_wc__db_verify_no_work(svn_sqlite__db_t *sdb);
/* Assert that the given WCROOT is usable.
NOTE: the expression is multiply-evaluated!! */
@@ -420,6 +423,38 @@ svn_wc__db_retract_parent_delete(svn_wc_
int op_depth,
apr_pool_t *scratch_pool);
+/* Extract the moved-to information for LOCAL_RELPATH at OP-DEPTH by
+ examining the lowest working node above OP_DEPTH. The output paths
+ are NULL if there is no move, otherwise:
+
+ *MOVE_DST_RELPATH: the moved-to destination of LOCAL_RELPATH.
+
+ *MOVE_DST_OP_ROOT_RELPATH: the moved-to destination of the root of
+ the move of LOCAL_RELPATH. This may be equal to *MOVE_DST_RELPATH
+ if LOCAL_RELPATH is the root of the move.
+
+ *MOVE_SRC_ROOT_RELPATH: the root of the move source. For moves
+ inside a delete this will be different from *MOVE_SRC_OP_ROOT_RELPATH.
+
+ *MOVE_SRC_OP_ROOT_RELPATH: the root of the source layer that
+ contains the move. For moves inside deletes this is the root of
+ the delete, for other moves this is the root of the move.
+
+ Given a path A/B/C with A/B moved to X then for A/B/C
+
+ MOVE_DST_RELPATH is X/C
+ MOVE_DST_OP_ROOT_RELPATH is X
+ MOVE_SRC_ROOT_RELPATH is A/B
+ MOVE_SRC_OP_ROOT_RELPATH is A/B
+
+ If A is then deleted the MOVE_DST_RELPATH, MOVE_DST_OP_ROOT_RELPATH
+ and MOVE_SRC_ROOT_RELPATH remain the same but MOVE_SRC_OP_ROOT_RELPATH
+ changes to A.
+
+ ### Think about combining with scan_deletion? Also with
+ ### scan_addition to get moved-to for replaces? Do we need to
+ ### return the op-root of the move source, i.e. A/B in the example
+ ### above? */
svn_error_t *
svn_wc__db_op_depth_moved_to(const char **move_dst_relpath,
const char **move_dst_op_root_relpath,
@@ -442,9 +477,12 @@ svn_wc__db_bump_moved_away(svn_wc__db_wc
svn_wc__db_t *db,
apr_pool_t *scratch_pool);
+/* Unbreak the move from LOCAL_RELPATH on op-depth in WCROOT, by making
+ the destination a normal copy */
svn_error_t *
svn_wc__db_resolve_break_moved_away_internal(svn_wc__db_wcroot_t *wcroot,
const char *local_relpath,
+ int op_depth,
apr_pool_t *scratch_pool);
svn_error_t *