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/03/30 21:02:33 UTC
svn commit: r1462850 [12/14] - in /subversion/branches/fsfs-format7: ./
build/ build/ac-macros/ build/generator/ contrib/client-side/svncopy/
notes/ subversion/bindings/javahl/native/
subversion/bindings/javahl/src/org/apache/subversion/javahl/ subvers...
Modified: subversion/branches/fsfs-format7/subversion/libsvn_wc/wc_db_update_move.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_wc/wc_db_update_move.c?rev=1462850&r1=1462849&r2=1462850&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_wc/wc_db_update_move.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_wc/wc_db_update_move.c Sat Mar 30 20:02:27 2013
@@ -324,7 +324,8 @@ mark_tree_conflict(const char *local_rel
scratch_pool,
scratch_pool));
- if (reason != svn_wc_conflict_reason_unversioned)
+ if (reason != svn_wc_conflict_reason_unversioned
+ && old_repos_relpath != NULL /* no local additions */)
{
conflict_old_version = svn_wc_conflict_version_create2(
old_version->repos_url, old_version->repos_uuid,
@@ -460,7 +461,7 @@ tc_editor_add_directory(void *baton,
struct tc_editor_baton *b = baton;
int op_depth = relpath_depth(b->move_root_dst_relpath);
const char *move_dst_repos_relpath;
- svn_kind_t move_dst_kind;
+ svn_node_kind_t move_dst_kind;
svn_boolean_t is_conflicted;
const char *abspath;
svn_node_kind_t old_kind;
@@ -470,7 +471,7 @@ tc_editor_add_directory(void *baton,
/* Update NODES, only the bits not covered by the later call to
replace_moved_layer. */
- SVN_ERR(svn_wc__db_extend_parent_delete(b->wcroot, relpath, svn_kind_dir,
+ SVN_ERR(svn_wc__db_extend_parent_delete(b->wcroot, relpath, svn_node_dir,
op_depth, scratch_pool));
err = svn_wc__db_depth_get_info(NULL, &move_dst_kind, NULL,
@@ -482,13 +483,13 @@ tc_editor_add_directory(void *baton,
if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
{
svn_error_clear(err);
- old_kind = svn_kind_none;
+ old_kind = svn_node_none;
move_dst_repos_relpath = NULL;
}
else
{
SVN_ERR(err);
- old_kind = svn__node_kind_from_kind(move_dst_kind);
+ old_kind = move_dst_kind;
}
/* Check for NODES tree-conflict. */
@@ -552,7 +553,7 @@ tc_editor_add_file(void *baton,
struct tc_editor_baton *b = baton;
int op_depth = relpath_depth(b->move_root_dst_relpath);
const char *move_dst_repos_relpath;
- svn_kind_t move_dst_kind;
+ svn_node_kind_t move_dst_kind;
svn_node_kind_t old_kind;
svn_boolean_t is_conflicted;
const char *abspath;
@@ -561,7 +562,7 @@ tc_editor_add_file(void *baton,
/* Update NODES, only the bits not covered by the later call to
replace_moved_layer. */
- SVN_ERR(svn_wc__db_extend_parent_delete(b->wcroot, relpath, svn_kind_file,
+ SVN_ERR(svn_wc__db_extend_parent_delete(b->wcroot, relpath, svn_node_file,
op_depth, scratch_pool));
err = svn_wc__db_depth_get_info(NULL, &move_dst_kind, NULL,
@@ -579,7 +580,7 @@ tc_editor_add_file(void *baton,
else
{
SVN_ERR(err);
- old_kind = svn__node_kind_from_kind(move_dst_kind);
+ old_kind = move_dst_kind;
}
/* Check for NODES tree-conflict. */
@@ -642,7 +643,7 @@ tc_editor_add_symlink(void *baton,
static svn_error_t *
tc_editor_add_absent(void *baton,
const char *relpath,
- svn_kind_t kind,
+ svn_node_kind_t kind,
svn_revnum_t replaces_rev,
apr_pool_t *scratch_pool)
{
@@ -780,7 +781,7 @@ tc_editor_alter_directory(void *baton,
struct tc_editor_baton *b = baton;
const char *move_dst_repos_relpath;
svn_revnum_t move_dst_revision;
- svn_kind_t move_dst_kind;
+ svn_node_kind_t move_dst_kind;
working_node_version_t old_version, new_version;
svn_wc__db_status_t status;
svn_boolean_t is_conflicted;
@@ -794,11 +795,22 @@ tc_editor_alter_directory(void *baton,
b->wcroot, dst_relpath,
relpath_depth(b->move_root_dst_relpath),
scratch_pool, scratch_pool));
- SVN_ERR_ASSERT(move_dst_revision == expected_move_dst_revision);
- SVN_ERR_ASSERT(move_dst_kind == svn_kind_dir);
+
+ /* If the node would be recorded as svn_wc__db_status_base_deleted it
+ wouldn't have a repos_relpath */
+ /* ### Can svn_wc__db_depth_get_info() do this for us without this hint? */
+ if (status == svn_wc__db_status_deleted && move_dst_repos_relpath)
+ status = svn_wc__db_status_not_present;
+
+ /* There might be not-present nodes of a different revision as the same
+ depth as a copy. This is commonly caused by copying/moving mixed revision
+ directories */
+ SVN_ERR_ASSERT(move_dst_revision == expected_move_dst_revision
+ || status == svn_wc__db_status_not_present);
+ SVN_ERR_ASSERT(move_dst_kind == svn_node_dir);
SVN_ERR(check_tree_conflict(&is_conflicted, b, dst_relpath,
- svn__node_kind_from_kind(move_dst_kind),
+ move_dst_kind,
svn_node_dir,
move_dst_repos_relpath,
svn_wc_conflict_action_edit,
@@ -899,53 +911,62 @@ update_working_file(const char *local_re
if (!svn_checksum_match(new_version->checksum, old_version->checksum))
{
- /*
- * Run a 3-way merge to update the file, using the pre-update
- * pristine text as the merge base, the post-update pristine
- * text as the merge-left version, and the current content of the
- * moved-here working file as the merge-right version.
- */
- SVN_ERR(svn_wc__db_pristine_get_path(&old_pristine_abspath,
- db, wcroot->abspath,
- old_version->checksum,
- scratch_pool, scratch_pool));
- SVN_ERR(svn_wc__db_pristine_get_path(&new_pristine_abspath,
- db, wcroot->abspath,
- new_version->checksum,
- scratch_pool, scratch_pool));
- SVN_ERR(svn_wc__internal_merge(&work_item, &conflict_skel,
- &merge_outcome, db,
- old_pristine_abspath,
- new_pristine_abspath,
- local_abspath,
- local_abspath,
- NULL, NULL, NULL, /* diff labels */
- actual_props,
- FALSE, /* dry-run */
- NULL, /* diff3-cmd */
- NULL, /* merge options */
- propchanges,
- NULL, NULL, /* cancel_func + baton */
- scratch_pool, scratch_pool));
-
- work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
+ svn_boolean_t is_locally_modified;
- if (merge_outcome == svn_wc_merge_conflict)
+ SVN_ERR(svn_wc__internal_file_modified_p(&is_locally_modified,
+ db, local_abspath,
+ FALSE /* exact_comparison */,
+ scratch_pool));
+ if (!is_locally_modified)
{
- content_state = svn_wc_notify_state_conflicted;
+ SVN_ERR(svn_wc__wq_build_file_install(&work_item, db,
+ local_abspath,
+ NULL,
+ FALSE /* FIXME: use_commit_times? */,
+ TRUE /* record_file_info */,
+ scratch_pool, scratch_pool));
+
+ work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
+
+ content_state = svn_wc_notify_state_changed;
}
else
{
- svn_boolean_t is_locally_modified;
-
- SVN_ERR(svn_wc__internal_file_modified_p(&is_locally_modified,
- db, local_abspath,
- FALSE /* exact_comparison */,
- scratch_pool));
- if (is_locally_modified)
- content_state = svn_wc_notify_state_merged;
+ /*
+ * Run a 3-way merge to update the file, using the pre-update
+ * pristine text as the merge base, the post-update pristine
+ * text as the merge-left version, and the current content of the
+ * moved-here working file as the merge-right version.
+ */
+ SVN_ERR(svn_wc__db_pristine_get_path(&old_pristine_abspath,
+ db, wcroot->abspath,
+ old_version->checksum,
+ scratch_pool, scratch_pool));
+ SVN_ERR(svn_wc__db_pristine_get_path(&new_pristine_abspath,
+ db, wcroot->abspath,
+ new_version->checksum,
+ scratch_pool, scratch_pool));
+ SVN_ERR(svn_wc__internal_merge(&work_item, &conflict_skel,
+ &merge_outcome, db,
+ old_pristine_abspath,
+ new_pristine_abspath,
+ local_abspath,
+ local_abspath,
+ NULL, NULL, NULL, /* diff labels */
+ actual_props,
+ FALSE, /* dry-run */
+ NULL, /* diff3-cmd */
+ NULL, /* merge options */
+ propchanges,
+ NULL, NULL, /* cancel_func + baton */
+ scratch_pool, scratch_pool));
+
+ work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
+
+ if (merge_outcome == svn_wc_merge_conflict)
+ content_state = svn_wc_notify_state_conflicted;
else
- content_state = svn_wc_notify_state_changed;
+ content_state = svn_wc_notify_state_merged;
}
}
else
@@ -995,22 +1016,31 @@ tc_editor_alter_file(void *baton,
struct tc_editor_baton *b = baton;
const char *move_dst_repos_relpath;
svn_revnum_t move_dst_revision;
- svn_kind_t move_dst_kind;
+ svn_node_kind_t move_dst_kind;
working_node_version_t old_version, new_version;
svn_boolean_t is_conflicted;
+ svn_wc__db_status_t status;
- SVN_ERR(svn_wc__db_depth_get_info(NULL, &move_dst_kind, &move_dst_revision,
+ SVN_ERR(svn_wc__db_depth_get_info(&status, &move_dst_kind, &move_dst_revision,
&move_dst_repos_relpath, NULL, NULL, NULL,
NULL, NULL, &old_version.checksum, NULL,
NULL, &old_version.props,
b->wcroot, dst_relpath,
relpath_depth(b->move_root_dst_relpath),
scratch_pool, scratch_pool));
- SVN_ERR_ASSERT(move_dst_revision == expected_move_dst_revision);
- SVN_ERR_ASSERT(move_dst_kind == svn_kind_file);
+
+ /* If the node would be recorded as svn_wc__db_status_base_deleted it
+ wouldn't have a repos_relpath */
+ /* ### Can svn_wc__db_depth_get_info() do this for us without this hint? */
+ if (status == svn_wc__db_status_deleted && move_dst_repos_relpath)
+ status = svn_wc__db_status_not_present;
+
+ SVN_ERR_ASSERT(move_dst_revision == expected_move_dst_revision
+ || status == svn_wc__db_status_not_present);
+ SVN_ERR_ASSERT(move_dst_kind == svn_node_file);
SVN_ERR(check_tree_conflict(&is_conflicted, b, dst_relpath,
- svn__node_kind_from_kind(move_dst_kind),
+ move_dst_kind,
svn_node_file,
move_dst_repos_relpath,
svn_wc_conflict_action_edit,
@@ -1058,11 +1088,14 @@ tc_editor_delete(void *baton,
svn_sqlite__stmt_t *stmt;
int op_depth = relpath_depth(b->move_root_dst_relpath);
const char *move_dst_repos_relpath;
- svn_kind_t move_dst_kind;
+ svn_node_kind_t move_dst_kind;
svn_boolean_t is_conflicted;
svn_boolean_t must_delete_working_nodes = FALSE;
const char *local_abspath = svn_dirent_join(b->wcroot->abspath, relpath,
scratch_pool);
+ const char *parent_relpath = svn_relpath_dirname(relpath, scratch_pool);
+ int op_depth_below;
+ svn_boolean_t have_row;
SVN_ERR(svn_wc__db_depth_get_info(NULL, &move_dst_kind, NULL,
&move_dst_repos_relpath, NULL, NULL, NULL,
@@ -1075,7 +1108,7 @@ tc_editor_delete(void *baton,
conflicts. This catches conflicts on the node itself; deleted
children are caught as local modifications below.*/
SVN_ERR(check_tree_conflict(&is_conflicted, b, relpath,
- svn__node_kind_from_kind(move_dst_kind),
+ move_dst_kind,
svn_node_unknown,
move_dst_repos_relpath,
svn_wc_conflict_action_delete,
@@ -1120,7 +1153,7 @@ tc_editor_delete(void *baton,
SVN_ERR(mark_tree_conflict(relpath, b->wcroot, b->db, b->old_version,
b->new_version, b->move_root_dst_relpath,
b->operation,
- svn__node_kind_from_kind(move_dst_kind),
+ move_dst_kind,
svn_node_none,
move_dst_repos_relpath, reason,
svn_wc_conflict_action_delete, NULL,
@@ -1131,10 +1164,9 @@ tc_editor_delete(void *baton,
if (!is_conflicted || must_delete_working_nodes)
{
- svn_boolean_t have_row;
apr_pool_t *iterpool = svn_pool_create(scratch_pool);
svn_skel_t *work_item;
- svn_kind_t del_kind;
+ svn_node_kind_t del_kind;
const char *del_abspath;
SVN_ERR(svn_sqlite__get_statement(&stmt, b->wcroot->sdb,
@@ -1152,7 +1184,7 @@ tc_editor_delete(void *baton,
del_abspath = svn_dirent_join(b->wcroot->abspath,
svn_sqlite__column_text(stmt, 0, NULL),
iterpool);
- if (del_kind == svn_kind_dir)
+ if (del_kind == svn_node_dir)
err = svn_wc__wq_build_dir_remove(&work_item, b->db,
b->wcroot->abspath, del_abspath,
FALSE /* recursive */,
@@ -1176,7 +1208,7 @@ tc_editor_delete(void *baton,
NULL, NULL,
b->wcroot, relpath, op_depth,
iterpool, iterpool));
- if (del_kind == svn_kind_dir)
+ if (del_kind == svn_node_dir)
SVN_ERR(svn_wc__wq_build_dir_remove(&work_item, b->db,
b->wcroot->abspath, local_abspath,
FALSE /* recursive */,
@@ -1191,18 +1223,48 @@ tc_editor_delete(void *baton,
if (!is_conflicted)
SVN_ERR(update_move_list_add(b->wcroot, relpath,
svn_wc_notify_update_delete,
- svn__node_kind_from_kind(del_kind),
+ del_kind,
svn_wc_notify_state_inapplicable,
svn_wc_notify_state_inapplicable));
svn_pool_destroy(iterpool);
}
/* Deleting the ROWS is valid so long as we update the parent before
- committing the transaction. */
+ committing the transaction. The removed rows could have been
+ replacing a lower layer in which case we need to add base-deleted
+ rows. */
SVN_ERR(svn_sqlite__get_statement(&stmt, b->wcroot->sdb,
- STMT_DELETE_WORKING_OP_DEPTH));
- SVN_ERR(svn_sqlite__bindf(stmt, "isd", b->wcroot->wc_id, relpath, op_depth));
- SVN_ERR(svn_sqlite__step_done(stmt));
+ STMT_SELECT_HIGHEST_WORKING_NODE));
+ SVN_ERR(svn_sqlite__bindf(stmt, "isd", b->wcroot->wc_id, parent_relpath,
+ op_depth));
+ SVN_ERR(svn_sqlite__step(&have_row, stmt));
+ if (have_row)
+ op_depth_below = svn_sqlite__column_int(stmt, 0);
+ SVN_ERR(svn_sqlite__reset(stmt));
+ if (have_row)
+ {
+ /* Remove non-shadowing nodes. */
+ SVN_ERR(svn_sqlite__get_statement(&stmt, b->wcroot->sdb,
+ STMT_DELETE_NO_LOWER_LAYER));
+ SVN_ERR(svn_sqlite__bindf(stmt, "isdd", b->wcroot->wc_id, relpath,
+ op_depth, op_depth_below));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+
+ /* Convert remaining shadowing nodes to presence='base-deleted'. */
+ SVN_ERR(svn_sqlite__get_statement(&stmt, b->wcroot->sdb,
+ STMT_REPLACE_WITH_BASE_DELETED));
+ SVN_ERR(svn_sqlite__bindf(stmt, "isd", b->wcroot->wc_id, relpath,
+ op_depth));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+ }
+ else
+ {
+ SVN_ERR(svn_sqlite__get_statement(&stmt, b->wcroot->sdb,
+ STMT_DELETE_WORKING_OP_DEPTH));
+ SVN_ERR(svn_sqlite__bindf(stmt, "isd", b->wcroot->wc_id, relpath,
+ op_depth));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+ }
/* Retract any base-delete. */
SVN_ERR(svn_wc__db_retract_parent_delete(b->wcroot, relpath, op_depth,
@@ -1355,7 +1417,7 @@ get_tc_info(svn_wc_operation_t *operatio
}
/* Return *PROPS, *CHECKSUM, *CHILDREN and *KIND for LOCAL_RELPATH at
- OP_DEPTH provided the row exists. Return *KIND of svn_kind_none if
+ OP_DEPTH provided the row exists. Return *KIND of svn_node_none if
the row does not exist. *CHILDREN is a sorted array of basenames of
type 'const char *', rather than a hash, to allow the driver to
process children in a defined order. */
@@ -1363,7 +1425,7 @@ static svn_error_t *
get_info(apr_hash_t **props,
const svn_checksum_t **checksum,
apr_array_header_t **children,
- svn_kind_t *kind,
+ svn_node_kind_t *kind,
const char *local_relpath,
int op_depth,
svn_wc__db_wcroot_t *wcroot,
@@ -1382,7 +1444,7 @@ get_info(apr_hash_t **props,
if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
{
svn_error_clear(err);
- *kind = svn_kind_none;
+ *kind = svn_node_none;
}
else
SVN_ERR(err);
@@ -1466,7 +1528,7 @@ update_moved_away_node(svn_editor_t *tc_
svn_wc__db_wcroot_t *wcroot,
apr_pool_t *scratch_pool)
{
- svn_kind_t src_kind, dst_kind;
+ svn_node_kind_t src_kind, dst_kind;
const svn_checksum_t *src_checksum, *dst_checksum;
apr_hash_t *src_props, *dst_props;
apr_array_header_t *src_children, *dst_children;
@@ -1480,16 +1542,16 @@ update_moved_away_node(svn_editor_t *tc_
dst_relpath, dst_op_depth,
wcroot, scratch_pool, scratch_pool));
- if (src_kind == svn_kind_none
- || (dst_kind != svn_kind_none && src_kind != dst_kind))
+ if (src_kind == svn_node_none
+ || (dst_kind != svn_node_none && src_kind != dst_kind))
{
SVN_ERR(svn_editor_delete(tc_editor, dst_relpath,
move_root_dst_revision));
}
- if (src_kind != svn_kind_none && src_kind != dst_kind)
+ if (src_kind != svn_node_none && src_kind != dst_kind)
{
- if (src_kind == svn_kind_file || src_kind == svn_kind_symlink)
+ if (src_kind == svn_node_file || src_kind == svn_node_symlink)
{
svn_stream_t *contents;
@@ -1500,14 +1562,14 @@ update_moved_away_node(svn_editor_t *tc_
src_checksum, contents, src_props,
move_root_dst_revision));
}
- else if (src_kind == svn_kind_dir)
+ else if (src_kind == svn_node_dir)
{
SVN_ERR(svn_editor_add_directory(tc_editor, dst_relpath,
src_children, src_props,
move_root_dst_revision));
}
}
- else if (src_kind != svn_kind_none)
+ else if (src_kind != svn_node_none)
{
svn_boolean_t match;
apr_hash_t *props;
@@ -1516,7 +1578,7 @@ update_moved_away_node(svn_editor_t *tc_
props = match ? NULL: src_props;
- if (src_kind == svn_kind_file || src_kind == svn_kind_symlink)
+ if (src_kind == svn_node_file || src_kind == svn_node_symlink)
{
svn_stream_t *contents;
@@ -1535,7 +1597,7 @@ update_moved_away_node(svn_editor_t *tc_
move_root_dst_revision,
props, src_checksum, contents));
}
- else if (src_kind == svn_kind_dir)
+ else if (src_kind == svn_node_dir)
{
apr_array_header_t *children
= children_match(src_children, dst_children) ? NULL : src_children;
@@ -1547,7 +1609,7 @@ update_moved_away_node(svn_editor_t *tc_
}
}
- if (src_kind == svn_kind_dir)
+ if (src_kind == svn_node_dir)
{
apr_pool_t *iterpool = svn_pool_create(scratch_pool);
int i = 0, j = 0;
@@ -2016,8 +2078,8 @@ bump_mark_tree_conflict(svn_wc__db_wcroo
svn_revnum_t new_rev;
const char *old_repos_url;
const char *new_repos_url;
- svn_kind_t old_kind;
- svn_kind_t new_kind;
+ svn_node_kind_t old_kind;
+ svn_node_kind_t new_kind;
svn_wc_conflict_version_t *old_version;
svn_wc_conflict_version_t *new_version;
@@ -2051,17 +2113,16 @@ bump_mark_tree_conflict(svn_wc__db_wcroo
old_version = svn_wc_conflict_version_create2(
old_repos_url, repos_uuid, old_repos_relpath, old_rev,
- svn__node_kind_from_kind(old_kind), scratch_pool);
+ old_kind, scratch_pool);
new_version = svn_wc_conflict_version_create2(
new_repos_url, repos_uuid, new_repos_relpath, new_rev,
- svn__node_kind_from_kind(new_kind), scratch_pool);
+ new_kind, scratch_pool);
SVN_ERR(mark_tree_conflict(move_src_root_relpath,
wcroot, db, old_version, new_version,
move_dst_op_root_relpath,
svn_wc_operation_update,
- svn__node_kind_from_kind(old_kind),
- svn__node_kind_from_kind(new_kind),
+ old_kind, new_kind,
old_repos_relpath,
svn_wc_conflict_reason_moved_away,
svn_wc_conflict_action_edit,
@@ -2113,7 +2174,7 @@ bump_moved_away(svn_wc__db_wcroot_t *wcr
if (depth != svn_depth_infinity)
{
svn_boolean_t skip_this_src = FALSE;
- svn_kind_t src_kind;
+ svn_node_kind_t src_kind;
if (strcmp(src_relpath, local_relpath))
{
@@ -2124,7 +2185,7 @@ bump_moved_away(svn_wc__db_wcroot_t *wcr
break;
case svn_depth_files:
src_kind = svn_sqlite__column_token(stmt, 3, kind_map);
- if (src_kind != svn_kind_file)
+ if (src_kind != svn_node_file)
{
skip_this_src = TRUE;
break;
@@ -2188,10 +2249,10 @@ bump_moved_away(svn_wc__db_wcroot_t *wcr
src_root_relpath = svn_relpath_dirname(src_root_relpath,
iterpool);
- if (!apr_hash_get(src_done, src_relpath, APR_HASH_KEY_STRING))
+ if (!svn_hash_gets(src_done, src_relpath))
{
- apr_hash_set(src_done, apr_pstrdup(result_pool, src_relpath),
- APR_HASH_KEY_STRING, "");
+ svn_hash_sets(src_done,
+ apr_pstrdup(result_pool, src_relpath), "");
err = svn_wc__db_read_conflict_internal(&conflict, wcroot,
src_root_relpath,
iterpool, iterpool);
Modified: subversion/branches/fsfs-format7/subversion/libsvn_wc/wc_db_wcroot.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_wc/wc_db_wcroot.c?rev=1462850&r1=1462849&r2=1462850&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_wc/wc_db_wcroot.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_wc/wc_db_wcroot.c Sat Mar 30 20:02:27 2013
@@ -26,6 +26,7 @@
#include <assert.h>
#include "svn_dirent_uri.h"
+#include "svn_hash.h"
#include "svn_path.h"
#include "svn_version.h"
@@ -104,7 +105,7 @@ get_old_version(int *version,
This function may do strange things, but at long as it comes up with the
Right Answer, we should be happy. */
static svn_error_t *
-get_path_kind(svn_kind_t *kind,
+get_path_kind(svn_node_kind_t *kind,
svn_wc__db_t *db,
const char *local_abspath,
apr_pool_t *scratch_pool)
@@ -137,7 +138,7 @@ get_path_kind(svn_kind_t *kind,
SVN_ERR(svn_io_check_special_path(local_abspath, &node_kind,
&special, scratch_pool));
- db->parse_cache.kind = svn__kind_from_node_kind(node_kind, special);
+ db->parse_cache.kind = (special ? svn_node_symlink : node_kind);
*kind = db->parse_cache.kind;
return SVN_NO_ERROR;
@@ -239,9 +240,9 @@ svn_wc__db_close(svn_wc__db_t *db)
const char *local_abspath = svn__apr_hash_index_key(hi);
if (wcroot->sdb)
- apr_hash_set(roots, wcroot->abspath, APR_HASH_KEY_STRING, wcroot);
+ svn_hash_sets(roots, wcroot->abspath, wcroot);
- apr_hash_set(db->dir_data, local_abspath, APR_HASH_KEY_STRING, NULL);
+ svn_hash_sets(db->dir_data, local_abspath, NULL);
}
/* Run the cleanup for each WCROOT. */
@@ -423,7 +424,7 @@ svn_wc__db_wcroot_parse_local_abspath(sv
{
const char *local_dir_abspath;
const char *original_abspath = local_abspath;
- svn_kind_t kind;
+ svn_node_kind_t kind;
const char *build_relpath;
svn_wc__db_wcroot_t *probe_wcroot;
svn_wc__db_wcroot_t *found_wcroot = NULL;
@@ -438,8 +439,7 @@ svn_wc__db_wcroot_parse_local_abspath(sv
### outside of the wcroot) and then managing all of that within DB.
### for now: play quick & dirty. */
- probe_wcroot = apr_hash_get(db->dir_data, local_abspath,
- APR_HASH_KEY_STRING);
+ probe_wcroot = svn_hash_gets(db->dir_data, local_abspath);
if (probe_wcroot != NULL)
{
*wcroot = probe_wcroot;
@@ -460,7 +460,7 @@ svn_wc__db_wcroot_parse_local_abspath(sv
### into wc_db which references a file. calls for directories could
### get an early-exit in the hash lookup just above. */
SVN_ERR(get_path_kind(&kind, db, local_abspath, scratch_pool));
- if (kind != svn_kind_dir)
+ if (kind != svn_node_dir)
{
/* If the node specified by the path is NOT present, then it cannot
possibly be a directory containing ".svn/wc.db".
@@ -474,8 +474,7 @@ svn_wc__db_wcroot_parse_local_abspath(sv
scratch_pool);
/* Is this directory in our hash? */
- probe_wcroot = apr_hash_get(db->dir_data, local_dir_abspath,
- APR_HASH_KEY_STRING);
+ probe_wcroot = svn_hash_gets(db->dir_data, local_dir_abspath);
if (probe_wcroot != NULL)
{
const char *dir_relpath;
@@ -495,7 +494,7 @@ svn_wc__db_wcroot_parse_local_abspath(sv
many ancestors need to be scanned until we start hitting content
on the disk. Set ALWAYS_CHECK to keep looking for .svn/entries
rather than bailing out after the first check. */
- if (kind == svn_kind_none)
+ if (kind == svn_node_none)
always_check = TRUE;
/* Start the scanning at LOCAL_DIR_ABSPATH. */
@@ -587,7 +586,7 @@ svn_wc__db_wcroot_parse_local_abspath(sv
* (Issue #2557, #3987). If so, try again, this time scanning
* for a db within the directory the symlink points to,
* rather than within the symlink's parent directory. */
- if (kind == svn_kind_symlink)
+ if (kind == svn_node_symlink)
{
svn_node_kind_t resolved_kind;
@@ -599,15 +598,14 @@ svn_wc__db_wcroot_parse_local_abspath(sv
if (resolved_kind == svn_node_dir)
{
/* Is this directory recorded in our hash? */
- found_wcroot = apr_hash_get(db->dir_data, local_abspath,
- APR_HASH_KEY_STRING);
+ found_wcroot = svn_hash_gets(db->dir_data, local_abspath);
if (found_wcroot)
break;
SVN_ERR(read_link_target(&local_abspath, local_abspath,
scratch_pool));
try_symlink_as_dir:
- kind = svn_kind_dir;
+ kind = svn_node_dir;
moved_upwards = FALSE;
local_dir_abspath = local_abspath;
build_relpath = "";
@@ -627,8 +625,7 @@ try_symlink_as_dir:
moved_upwards = TRUE;
/* Is the parent directory recorded in our hash? */
- found_wcroot = apr_hash_get(db->dir_data, local_abspath,
- APR_HASH_KEY_STRING);
+ found_wcroot = svn_hash_gets(db->dir_data, local_abspath);
if (found_wcroot != NULL)
break;
}
@@ -669,7 +666,7 @@ try_symlink_as_dir:
db->state_pool, scratch_pool);
if (err && (err->apr_err == SVN_ERR_WC_UNSUPPORTED_FORMAT ||
err->apr_err == SVN_ERR_WC_UPGRADE_REQUIRED) &&
- kind == svn_kind_symlink)
+ kind == svn_node_symlink)
{
/* We found an unsupported WC after traversing upwards from a
* symlink. Fall through to code below to check if the symlink
@@ -749,7 +746,7 @@ try_symlink_as_dir:
*local_relpath = svn_relpath_join(dir_relpath, build_relpath, result_pool);
}
- if (kind == svn_kind_symlink)
+ if (kind == svn_node_symlink)
{
svn_boolean_t retry_if_dir = FALSE;
svn_wc__db_status_t status;
@@ -816,10 +813,9 @@ try_symlink_as_dir:
/* We've found the appropriate WCROOT for the requested path. Stash
it into that path's directory. */
- apr_hash_set(db->dir_data,
- apr_pstrdup(db->state_pool, local_dir_abspath),
- APR_HASH_KEY_STRING,
- *wcroot);
+ svn_hash_sets(db->dir_data,
+ apr_pstrdup(db->state_pool, local_dir_abspath),
+ *wcroot);
/* Did we traverse up to parent directories? */
if (!moved_upwards)
@@ -842,12 +838,11 @@ try_symlink_as_dir:
const char *parent_dir = svn_dirent_dirname(scan_abspath, scratch_pool);
svn_wc__db_wcroot_t *parent_wcroot;
- parent_wcroot = apr_hash_get(db->dir_data, parent_dir,
- APR_HASH_KEY_STRING);
+ parent_wcroot = svn_hash_gets(db->dir_data, parent_dir);
if (parent_wcroot == NULL)
{
- apr_hash_set(db->dir_data, apr_pstrdup(db->state_pool, parent_dir),
- APR_HASH_KEY_STRING, *wcroot);
+ svn_hash_sets(db->dir_data, apr_pstrdup(db->state_pool, parent_dir),
+ *wcroot);
}
/* Move up a directory, stopping when we reach the directory where
@@ -865,8 +860,7 @@ svn_wc__db_drop_root(svn_wc__db_t *db,
const char *local_abspath,
apr_pool_t *scratch_pool)
{
- svn_wc__db_wcroot_t *root_wcroot = apr_hash_get(db->dir_data, local_abspath,
- APR_HASH_KEY_STRING);
+ svn_wc__db_wcroot_t *root_wcroot = svn_hash_gets(db->dir_data, local_abspath);
apr_hash_index_t *hi;
apr_status_t result;
@@ -886,8 +880,7 @@ svn_wc__db_drop_root(svn_wc__db_t *db,
svn_wc__db_wcroot_t *wcroot = svn__apr_hash_index_val(hi);
if (wcroot == root_wcroot)
- apr_hash_set(db->dir_data,
- svn__apr_hash_index_key(hi), APR_HASH_KEY_STRING, NULL);
+ svn_hash_sets(db->dir_data, svn__apr_hash_index_key(hi), NULL);
}
result = apr_pool_cleanup_run(db->state_pool, root_wcroot, close_wcroot);
Modified: subversion/branches/fsfs-format7/subversion/libsvn_wc/wcroot_anchor.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_wc/wcroot_anchor.c?rev=1462850&r1=1462849&r2=1462850&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_wc/wcroot_anchor.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_wc/wcroot_anchor.c Sat Mar 30 20:02:27 2013
@@ -145,7 +145,7 @@
svn_error_t *
svn_wc_check_root(svn_boolean_t *is_wcroot,
svn_boolean_t *is_switched,
- svn_kind_t *kind,
+ svn_node_kind_t *kind,
svn_wc_context_t *wc_ctx,
const char *local_abspath,
apr_pool_t *scratch_pool)
@@ -191,7 +191,7 @@ svn_wc_get_actual_target2(const char **a
apr_pool_t *scratch_pool)
{
svn_boolean_t is_wc_root, is_switched;
- svn_kind_t kind;
+ svn_node_kind_t kind;
const char *local_abspath;
svn_error_t *err;
@@ -213,7 +213,7 @@ svn_wc_get_actual_target2(const char **a
}
/* If PATH is not a WC root, or if it is a file, lop off a basename. */
- if (!(is_wc_root || is_switched) || (kind != svn_kind_dir))
+ if (!(is_wc_root || is_switched) || (kind != svn_node_dir))
{
svn_dirent_split(anchor, target, path, result_pool);
}
Modified: subversion/branches/fsfs-format7/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_wc/workqueue.c?rev=1462850&r1=1462849&r2=1462850&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_wc/workqueue.c Sat Mar 30 20:02:27 2013
@@ -620,14 +620,14 @@ run_file_install(work_item_baton_t *wqb,
/* Tweak the on-disk file according to its properties. */
#ifndef WIN32
- if (props && apr_hash_get(props, SVN_PROP_EXECUTABLE, APR_HASH_KEY_STRING))
+ if (props && svn_hash_gets(props, SVN_PROP_EXECUTABLE))
SVN_ERR(svn_io_set_file_executable(local_abspath, TRUE, FALSE,
scratch_pool));
#endif
/* Note that this explicitly checks the pristine properties, to make sure
that when the lock is locally set (=modification) it is not read only */
- if (props && apr_hash_get(props, SVN_PROP_NEEDS_LOCK, APR_HASH_KEY_STRING))
+ if (props && svn_hash_gets(props, SVN_PROP_NEEDS_LOCK))
{
svn_wc__db_status_t status;
svn_wc__db_lock_t *lock;
Modified: subversion/branches/fsfs-format7/subversion/mod_authz_svn/INSTALL
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/mod_authz_svn/INSTALL?rev=1462850&r1=1462849&r2=1462850&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/mod_authz_svn/INSTALL (original)
+++ subversion/branches/fsfs-format7/subversion/mod_authz_svn/INSTALL Sat Mar 30 20:02:27 2013
@@ -171,7 +171,7 @@ II. Configuration
AuthUserFile /path/to/htpasswd/file
AuthzSVNAccessFile /path/to/access/file
- # Implicit Satisfy All
+ # implicit Satisfy All
Require valid-user
</Location>
Modified: subversion/branches/fsfs-format7/subversion/mod_dav_svn/activity.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/mod_dav_svn/activity.c?rev=1462850&r1=1462849&r2=1462850&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/mod_dav_svn/activity.c (original)
+++ subversion/branches/fsfs-format7/subversion/mod_dav_svn/activity.c Sat Mar 30 20:02:27 2013
@@ -28,6 +28,7 @@
#include <httpd.h>
#include <mod_dav.h>
+#include "svn_hash.h"
#include "svn_checksum.h"
#include "svn_error.h"
#include "svn_io.h"
@@ -254,8 +255,9 @@ dav_svn__create_txn(const dav_svn_repos
if (repos->username)
{
- apr_hash_set(revprops, SVN_PROP_REVISION_AUTHOR, APR_HASH_KEY_STRING,
- svn_string_create(repos->username, pool));
+ svn_hash_sets(revprops,
+ SVN_PROP_REVISION_AUTHOR,
+ svn_string_create(repos->username, pool));
}
serr = svn_fs_youngest_rev(&rev, repos->fs, pool);
Modified: subversion/branches/fsfs-format7/subversion/mod_dav_svn/deadprops.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/mod_dav_svn/deadprops.c?rev=1462850&r1=1462849&r2=1462850&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/mod_dav_svn/deadprops.c (original)
+++ subversion/branches/fsfs-format7/subversion/mod_dav_svn/deadprops.c Sat Mar 30 20:02:27 2013
@@ -28,6 +28,7 @@
#include <httpd.h>
#include <mod_dav.h>
+#include "svn_hash.h"
#include "svn_xml.h"
#include "svn_pools.h"
#include "svn_dav.h"
@@ -177,7 +178,7 @@ save_value(dav_db *db, const dav_prop_na
if (propname == NULL)
{
- if (db->resource->info->repos->autoversioning)
+ if (resource->info->repos->autoversioning)
/* ignore the unknown namespace of the incoming prop. */
propname = name->name;
else
@@ -207,10 +208,10 @@ save_value(dav_db *db, const dav_prop_na
/* A subpool to cope with mod_dav making multiple calls, e.g. during
PROPPATCH with multiple values. */
- subpool = svn_pool_create(db->resource->pool);
- if (db->resource->baselined)
+ subpool = svn_pool_create(resource->pool);
+ if (resource->baselined)
{
- if (db->resource->working)
+ if (resource->working)
{
serr = svn_repos_fs_change_txn_prop(resource->info->root.txn,
propname, value,
Modified: subversion/branches/fsfs-format7/subversion/mod_dav_svn/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/mod_dav_svn/lock.c?rev=1462850&r1=1462849&r2=1462850&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/mod_dav_svn/lock.c (original)
+++ subversion/branches/fsfs-format7/subversion/mod_dav_svn/lock.c Sat Mar 30 20:02:27 2013
@@ -28,6 +28,7 @@
#include <http_log.h>
#include <mod_dav.h>
+#include "svn_hash.h"
#include "svn_fs.h"
#include "svn_repos.h"
#include "svn_dav.h"
@@ -640,6 +641,19 @@ append_locks(dav_lockdb *lockdb,
svn_lock_t *slock;
svn_error_t *serr;
dav_error *derr;
+ dav_svn_repos *repos = resource->info->repos;
+
+ /* We don't allow anonymous locks */
+ if (! repos->username)
+ return dav_svn__new_error(resource->pool, HTTP_UNAUTHORIZED,
+ DAV_ERR_LOCK_SAVE_LOCK,
+ "Anonymous lock creation is not allowed.");
+
+ /* Not a path in the repository so can't lock it. */
+ if (! resource->info->repos_path)
+ return dav_svn__new_error(resource->pool, HTTP_BAD_REQUEST,
+ DAV_ERR_LOCK_SAVE_LOCK,
+ "Attempted to lock path not in repository.");
/* If the resource's fs path is unreadable, we don't allow a lock to
be created on it. */
@@ -663,11 +677,10 @@ append_locks(dav_lockdb *lockdb,
svn_fs_txn_t *txn;
svn_fs_root_t *txn_root;
const char *conflict_msg;
- dav_svn_repos *repos = resource->info->repos;
apr_hash_t *revprop_table = apr_hash_make(resource->pool);
- apr_hash_set(revprop_table, SVN_PROP_REVISION_AUTHOR,
- APR_HASH_KEY_STRING, svn_string_create(repos->username,
- resource->pool));
+ svn_hash_sets(revprop_table,
+ SVN_PROP_REVISION_AUTHOR,
+ svn_string_create(repos->username, resource->pool));
if (resource->info->repos->is_svn_client)
return dav_svn__new_error(resource->pool, HTTP_METHOD_NOT_ALLOWED,
@@ -741,14 +754,14 @@ append_locks(dav_lockdb *lockdb,
/* Convert the dav_lock into an svn_lock_t. */
derr = dav_lock_to_svn_lock(&slock, lock, resource->info->repos_path,
- info, resource->info->repos->is_svn_client,
+ info, repos->is_svn_client,
resource->pool);
if (derr)
return derr;
/* Now use the svn_lock_t to actually perform the lock. */
serr = svn_repos_fs_lock(&slock,
- resource->info->repos->repos,
+ repos->repos,
slock->path,
slock->token,
slock->comment,
Modified: subversion/branches/fsfs-format7/subversion/mod_dav_svn/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/mod_dav_svn/merge.c?rev=1462850&r1=1462849&r2=1462850&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/mod_dav_svn/merge.c (original)
+++ subversion/branches/fsfs-format7/subversion/mod_dav_svn/merge.c Sat Mar 30 20:02:27 2013
@@ -29,6 +29,7 @@
#include <httpd.h>
#include <util_filter.h>
+#include "svn_hash.h"
#include "svn_pools.h"
#include "svn_fs.h"
#include "svn_props.h"
@@ -169,14 +170,14 @@ do_resources(const dav_svn_repos *repos,
{
/* If we haven't already sent this path, send it (and then
remember that we sent it). */
- if (! apr_hash_get(sent, path, APR_HASH_KEY_STRING))
+ if (! svn_hash_gets(sent, path))
{
svn_node_kind_t kind;
SVN_ERR(svn_fs_check_path(&kind, root, path, subpool));
SVN_ERR(send_response(repos, root, path,
kind == svn_node_dir,
output, bb, subpool));
- apr_hash_set(sent, path, APR_HASH_KEY_STRING, (void *)1);
+ svn_hash_sets(sent, path, (void *)1);
}
}
if (send_parent)
@@ -186,11 +187,11 @@ do_resources(const dav_svn_repos *repos,
pool, not subpool, because it stays in the sent hash
afterwards. */
const char *parent = svn_fspath__dirname(path, pool);
- if (! apr_hash_get(sent, parent, APR_HASH_KEY_STRING))
+ if (! svn_hash_gets(sent, parent))
{
SVN_ERR(send_response(repos, root, parent,
TRUE, output, bb, subpool));
- apr_hash_set(sent, parent, APR_HASH_KEY_STRING, (void *)1);
+ svn_hash_sets(sent, parent, (void *)1);
}
}
}
Modified: subversion/branches/fsfs-format7/subversion/mod_dav_svn/mod_dav_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/mod_dav_svn/mod_dav_svn.c?rev=1462850&r1=1462849&r2=1462850&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/mod_dav_svn/mod_dav_svn.c (original)
+++ subversion/branches/fsfs-format7/subversion/mod_dav_svn/mod_dav_svn.c Sat Mar 30 20:02:27 2013
@@ -34,6 +34,7 @@
#include <ap_provider.h>
#include <mod_dav.h>
+#include "svn_hash.h"
#include "svn_version.h"
#include "svn_cache_config.h"
#include "svn_utf.h"
Modified: subversion/branches/fsfs-format7/subversion/mod_dav_svn/reports/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/mod_dav_svn/reports/log.c?rev=1462850&r1=1462849&r2=1462850&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/mod_dav_svn/reports/log.c (original)
+++ subversion/branches/fsfs-format7/subversion/mod_dav_svn/reports/log.c Sat Mar 30 20:02:27 2013
@@ -341,10 +341,9 @@ dav_svn__log_report(const dav_resource *
dav_xml_get_cdata(child, resource->pool, 1));
if (serr)
{
- derr = dav_svn__convert_err(serr, HTTP_BAD_REQUEST,
+ return dav_svn__convert_err(serr, HTTP_BAD_REQUEST,
"Malformed CDATA in element "
"\"limit\"", resource->pool);
- goto cleanup;
}
}
else if (strcmp(child->name, "discover-changed-paths") == 0)
Modified: subversion/branches/fsfs-format7/subversion/mod_dav_svn/reports/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/mod_dav_svn/reports/update.c?rev=1462850&r1=1462849&r2=1462850&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/mod_dav_svn/reports/update.c (original)
+++ subversion/branches/fsfs-format7/subversion/mod_dav_svn/reports/update.c Sat Mar 30 20:02:27 2013
@@ -29,6 +29,7 @@
#include <http_log.h>
#include <mod_dav.h>
+#include "svn_hash.h"
#include "svn_pools.h"
#include "svn_repos.h"
#include "svn_fs.h"
@@ -153,7 +154,7 @@ add_to_path_map(apr_hash_t *hash, const
const char *repos_path = linkpath ? linkpath : norm_path;
/* now, geez, put the path in the map already! */
- apr_hash_set(hash, path, APR_HASH_KEY_STRING, repos_path);
+ svn_hash_sets(hash, path, repos_path);
}
@@ -169,7 +170,7 @@ get_from_path_map(apr_hash_t *hash, cons
if (! hash)
return apr_pstrdup(pool, path);
- if ((repos_path = apr_hash_get(hash, path, APR_HASH_KEY_STRING)))
+ if ((repos_path = svn_hash_gets(hash, path)))
{
/* what luck! this path is a hash key! if there is a linkpath,
use that, else return the path itself. */
Modified: subversion/branches/fsfs-format7/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/mod_dav_svn/repos.c?rev=1462850&r1=1462849&r2=1462850&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/fsfs-format7/subversion/mod_dav_svn/repos.c Sat Mar 30 20:02:27 2013
@@ -37,6 +37,7 @@
#define CORE_PRIVATE /* To make ap_show_mpm public in 2.2 */
#include <http_config.h>
+#include "svn_hash.h"
#include "svn_types.h"
#include "svn_pools.h"
#include "svn_error.h"
@@ -2127,8 +2128,9 @@ get_resource(request_rec *r,
more than that). */
/* Start out assuming no capabilities. */
- apr_hash_set(repos->client_capabilities, SVN_RA_CAPABILITY_MERGEINFO,
- APR_HASH_KEY_STRING, capability_no);
+ svn_hash_sets(repos->client_capabilities,
+ SVN_RA_CAPABILITY_MERGEINFO,
+ capability_no);
/* Then see what we can find. */
val = apr_table_get(r->headers_in, "DAV");
@@ -2139,9 +2141,8 @@ get_resource(request_rec *r,
if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_MERGEINFO, vals))
{
- apr_hash_set(repos->client_capabilities,
- SVN_RA_CAPABILITY_MERGEINFO,
- APR_HASH_KEY_STRING, capability_yes);
+ svn_hash_sets(repos->client_capabilities,
+ SVN_RA_CAPABILITY_MERGEINFO, capability_yes);
}
}
}
@@ -2157,18 +2158,12 @@ get_resource(request_rec *r,
/* construct FS configuration parameters */
fs_config = apr_hash_make(r->connection->pool);
- apr_hash_set(fs_config,
- SVN_FS_CONFIG_FSFS_CACHE_DELTAS,
- APR_HASH_KEY_STRING,
- dav_svn__get_txdelta_cache_flag(r) ? "1" : "0");
- apr_hash_set(fs_config,
- SVN_FS_CONFIG_FSFS_CACHE_FULLTEXTS,
- APR_HASH_KEY_STRING,
- dav_svn__get_fulltext_cache_flag(r) ? "1" : "0");
- apr_hash_set(fs_config,
- SVN_FS_CONFIG_FSFS_CACHE_REVPROPS,
- APR_HASH_KEY_STRING,
- dav_svn__get_revprop_cache_flag(r) ? "1" : "0");
+ svn_hash_sets(fs_config, SVN_FS_CONFIG_FSFS_CACHE_DELTAS,
+ dav_svn__get_txdelta_cache_flag(r) ? "1" :"0");
+ svn_hash_sets(fs_config, SVN_FS_CONFIG_FSFS_CACHE_FULLTEXTS,
+ dav_svn__get_fulltext_cache_flag(r) ? "1" :"0");
+ svn_hash_sets(fs_config, SVN_FS_CONFIG_FSFS_CACHE_REVPROPS,
+ dav_svn__get_revprop_cache_flag(r) ? "1" :"0");
/* Disallow BDB/event until issue 4157 is fixed. */
if (!strcmp(ap_show_mpm(), "event"))
@@ -3216,7 +3211,7 @@ deliver(const dav_resource *resource, ap
ent->id = NULL; /* ### does it matter? */
ent->kind = dirent->kind;
- apr_hash_set(entries, key, APR_HASH_KEY_STRING, ent);
+ svn_hash_sets(entries, key, ent);
}
}
Modified: subversion/branches/fsfs-format7/subversion/mod_dav_svn/version.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/mod_dav_svn/version.c?rev=1462850&r1=1462849&r2=1462850&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/mod_dav_svn/version.c (original)
+++ subversion/branches/fsfs-format7/subversion/mod_dav_svn/version.c Sat Mar 30 20:02:27 2013
@@ -28,6 +28,7 @@
#include <http_log.h>
#include <mod_dav.h>
+#include "svn_hash.h"
#include "svn_fs.h"
#include "svn_xml.h"
#include "svn_repos.h"
@@ -150,7 +151,7 @@ get_vsn_options(apr_pool_t *p, apr_text_
apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_PARTIAL_REPLAY);
apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_INHERITED_PROPS);
apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_INLINE_PROPS);
- apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_GET_FILE_REVS_REVERSE);
+ apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_REVERSE_FILE_REVS);
/* Mergeinfo is a special case: here we merely say that the server
* knows how to handle mergeinfo -- whether the repository does too
* is a separate matter.
@@ -1327,7 +1328,7 @@ dav_svn__build_lock_hash(apr_hash_t **lo
lockpath = svn_fspath__join(path_prefix, cdata, pool);
if (lockpath && locktoken)
{
- apr_hash_set(hash, lockpath, APR_HASH_KEY_STRING, locktoken);
+ svn_hash_sets(hash, lockpath, locktoken);
lockpath = NULL;
locktoken = NULL;
}
@@ -1337,7 +1338,7 @@ dav_svn__build_lock_hash(apr_hash_t **lo
locktoken = dav_xml_get_cdata(lfchild, pool, 1);
if (lockpath && *locktoken)
{
- apr_hash_set(hash, lockpath, APR_HASH_KEY_STRING, locktoken);
+ svn_hash_sets(hash, lockpath, locktoken);
lockpath = NULL;
locktoken = NULL;
}
Modified: subversion/branches/fsfs-format7/subversion/svn/cl-conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/svn/cl-conflicts.c?rev=1462850&r1=1462849&r2=1462850&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/svn/cl-conflicts.c (original)
+++ subversion/branches/fsfs-format7/subversion/svn/cl-conflicts.c Sat Mar 30 20:02:27 2013
@@ -22,6 +22,7 @@
*/
#include "cl-conflicts.h"
+#include "svn_hash.h"
#include "svn_xml.h"
#include "svn_dirent_uri.h"
#include "svn_path.h"
@@ -161,23 +162,20 @@ add_conflict_version_xml(svn_stringbuf_t
apr_hash_t *att_hash = apr_hash_make(pool);
- apr_hash_set(att_hash, "side", APR_HASH_KEY_STRING, side);
+ svn_hash_sets(att_hash, "side", side);
if (version->repos_url)
- apr_hash_set(att_hash, "repos-url", APR_HASH_KEY_STRING,
- version->repos_url);
+ svn_hash_sets(att_hash, "repos-url", version->repos_url);
if (version->path_in_repos)
- apr_hash_set(att_hash, "path-in-repos", APR_HASH_KEY_STRING,
- version->path_in_repos);
+ svn_hash_sets(att_hash, "path-in-repos", version->path_in_repos);
if (SVN_IS_VALID_REVNUM(version->peg_rev))
- apr_hash_set(att_hash, "revision", APR_HASH_KEY_STRING,
- apr_ltoa(pool, version->peg_rev));
+ svn_hash_sets(att_hash, "revision", apr_ltoa(pool, version->peg_rev));
if (version->node_kind != svn_node_unknown)
- apr_hash_set(att_hash, "kind", APR_HASH_KEY_STRING,
- svn_cl__node_kind_str_xml(version->node_kind));
+ svn_hash_sets(att_hash, "kind",
+ svn_cl__node_kind_str_xml(version->node_kind));
svn_xml_make_open_tag_hash(pstr, pool, svn_xml_self_closing,
"version", att_hash);
@@ -193,20 +191,20 @@ append_tree_conflict_info_xml(svn_string
apr_hash_t *att_hash = apr_hash_make(pool);
const char *tmp;
- apr_hash_set(att_hash, "victim", APR_HASH_KEY_STRING,
- svn_dirent_basename(conflict->local_abspath, pool));
+ svn_hash_sets(att_hash, "victim",
+ svn_dirent_basename(conflict->local_abspath, pool));
- apr_hash_set(att_hash, "kind", APR_HASH_KEY_STRING,
- svn_cl__node_kind_str_xml(conflict->node_kind));
+ svn_hash_sets(att_hash, "kind",
+ svn_cl__node_kind_str_xml(conflict->node_kind));
- apr_hash_set(att_hash, "operation", APR_HASH_KEY_STRING,
- svn_cl__operation_str_xml(conflict->operation, pool));
+ svn_hash_sets(att_hash, "operation",
+ svn_cl__operation_str_xml(conflict->operation, pool));
tmp = svn_token__to_word(map_conflict_action_xml, conflict->action);
- apr_hash_set(att_hash, "action", APR_HASH_KEY_STRING, tmp);
+ svn_hash_sets(att_hash, "action", tmp);
tmp = svn_token__to_word(map_conflict_reason_xml, conflict->reason);
- apr_hash_set(att_hash, "reason", APR_HASH_KEY_STRING, tmp);
+ svn_hash_sets(att_hash, "reason", tmp);
/* Open the tree-conflict tag. */
svn_xml_make_open_tag_hash(&str, pool, svn_xml_normal,
@@ -247,15 +245,15 @@ svn_cl__append_conflict_info_xml(svn_str
att_hash = apr_hash_make(scratch_pool);
- apr_hash_set(att_hash, "operation", APR_HASH_KEY_STRING,
- svn_cl__operation_str_xml(conflict->operation, scratch_pool));
+ svn_hash_sets(att_hash, "operation",
+ svn_cl__operation_str_xml(conflict->operation, scratch_pool));
kind = svn_token__to_word(map_conflict_kind_xml, conflict->kind);
- apr_hash_set(att_hash, "type", APR_HASH_KEY_STRING, kind);
+ svn_hash_sets(att_hash, "type", kind);
- apr_hash_set(att_hash, "operation", APR_HASH_KEY_STRING,
- svn_cl__operation_str_xml(conflict->operation, scratch_pool));
+ svn_hash_sets(att_hash, "operation",
+ svn_cl__operation_str_xml(conflict->operation, scratch_pool));
/* "<conflict>" */
Modified: subversion/branches/fsfs-format7/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/svn/cl.h?rev=1462850&r1=1462849&r2=1462850&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/svn/cl.h (original)
+++ subversion/branches/fsfs-format7/subversion/svn/cl.h Sat Mar 30 20:02:27 2013
@@ -180,17 +180,17 @@ typedef struct svn_cl__opt_state_t
svn_boolean_t no_auth_cache; /* do not cache authentication information */
struct
{
- const char *diff_cmd; /* the external diff command to use */
- svn_boolean_t internal_diff; /* override diff_cmd in config file */
- svn_boolean_t no_diff_added; /* do not show diffs for deleted files */
- svn_boolean_t no_diff_deleted; /* do not show diffs for deleted files */
+ const char *diff_cmd; /* the external diff command to use */
+ svn_boolean_t internal_diff; /* override diff_cmd in config file */
+ svn_boolean_t no_diff_added; /* do not show diffs for deleted files */
+ svn_boolean_t no_diff_deleted; /* do not show diffs for deleted files */
svn_boolean_t show_copies_as_adds; /* do not diff copies with their source */
- svn_boolean_t notice_ancestry; /* notice ancestry for diff-y operations */
- svn_boolean_t summarize; /* create a summary of a diff */
+ svn_boolean_t notice_ancestry; /* notice ancestry for diff-y operations */
+ svn_boolean_t summarize; /* create a summary of a diff */
svn_boolean_t use_git_diff_format; /* Use git's extended diff format */
- svn_boolean_t ignore_properties; /* ignore properties */
- svn_boolean_t properties_only; /* Show properties only */
- svn_boolean_t patch_compatible; /* Output compatible with GNU patch */
+ svn_boolean_t ignore_properties; /* ignore properties */
+ svn_boolean_t properties_only; /* Show properties only */
+ svn_boolean_t patch_compatible; /* Output compatible with GNU patch */
} diff;
svn_boolean_t ignore_ancestry; /* ignore ancestry for merge-y operations */
svn_boolean_t ignore_externals;/* ignore externals definitions */
@@ -219,21 +219,21 @@ typedef struct svn_cl__opt_state_t
apr_hash_t *revprop_table; /* table of revision properties to get/set */
svn_boolean_t parents; /* create intermediate directories */
svn_boolean_t use_merge_history; /* use/display extra merge information */
- svn_cl__accept_t accept_which; /* how to handle conflicts */
- svn_cl__show_revs_t show_revs; /* mergeinfo flavor */
- svn_depth_t set_depth; /* new sticky ambient depth value */
- svn_boolean_t reintegrate; /* use "reintegrate" merge-source heuristic */
+ svn_cl__accept_t accept_which; /* how to handle conflicts */
+ svn_cl__show_revs_t show_revs; /* mergeinfo flavor */
+ svn_depth_t set_depth; /* new sticky ambient depth value */
+ svn_boolean_t reintegrate; /* use "reintegrate" merge-source heuristic */
svn_boolean_t trust_server_cert; /* trust server SSL certs that would
otherwise be rejected as "untrusted" */
int strip; /* number of leading path components to strip */
- svn_boolean_t ignore_keywords; /* do not expand keywords */
- svn_boolean_t reverse_diff; /* reverse a diff (e.g. when patching) */
+ svn_boolean_t ignore_keywords; /* do not expand keywords */
+ svn_boolean_t reverse_diff; /* reverse a diff (e.g. when patching) */
svn_boolean_t ignore_whitespace; /* don't account for whitespace when
patching */
- svn_boolean_t show_diff; /* produce diff output (maps to --diff) */
- svn_boolean_t allow_mixed_rev; /* Allow operation on mixed-revision WC */
+ svn_boolean_t show_diff; /* produce diff output (maps to --diff) */
+ svn_boolean_t allow_mixed_rev; /* Allow operation on mixed-revision WC */
svn_boolean_t include_externals; /* Recurses (in)to file & dir externals */
- svn_boolean_t show_inherited_props; /* get inherited properties */
+ svn_boolean_t show_inherited_props; /* get inherited properties */
apr_array_header_t* search_patterns; /* pattern arguments for --search */
} svn_cl__opt_state_t;
@@ -344,10 +344,16 @@ svn_cl__get_conflict_func_interactive_ba
void *cancel_baton,
apr_pool_t *result_pool);
-/* A conflict-resolution callback which prompts the user to choose
- one of the 3 fulltexts, edit the merged file on the spot, or just
- skip the conflict (to be resolved later).
- Implements @c svn_wc_conflict_resolver_func_t. */
+/* A callback capable of doing interactive conflict resolution.
+
+ The BATON must come from svn_cl__get_conflict_func_interactive_baton().
+ Resolves based on the --accept option if one was given to that function,
+ otherwise prompts the user to choose one of the three fulltexts, edit
+ the merged file on the spot, or just skip the conflict (to be resolved
+ later), among other options.
+
+ Implements svn_wc_conflict_resolver_func2_t.
+ */
svn_error_t *
svn_cl__conflict_func_interactive(svn_wc_conflict_result_t **result,
const svn_wc_conflict_description2_t *desc,
@@ -355,44 +361,6 @@ svn_cl__conflict_func_interactive(svn_wc
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-/* Create and return a baton for use with svn_cl__conflict_func_postpone()
- * and svn_cl__resolve_postponed_conflicts(), allocated in RESULT_POOL.
- */
-void *
-svn_cl__get_conflict_func_postpone_baton(apr_pool_t *result_pool);
-
-/* A conflict-resolution callback which postpones all conflicts and
- * remembers conflicted paths in BATON. BATON must have been obtained
- * from svn_cl__get_conflict_func_postpone_baton().
- *
- * Implements svn_wc_conflict_resolver_func2_t.
- */
-svn_error_t *
-svn_cl__conflict_func_postpone(svn_wc_conflict_result_t **result,
- const svn_wc_conflict_description2_t *desc,
- void *baton,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
-/* Perform conflict resolution on any conflicted paths stored in the BATON
- * which was obtained from svn_cl__get_conflict_func_postpone_baton().
- *
- * If CONFLICTS_ALL_RESOLVED is not null, set *CONFLICTS_ALL_RESOLVED to
- * true if this resolves all the conflicts on the paths that were
- * recorded (or if none were recorded); or to false if some conflicts
- * remain.
- *
- * The conflict resolution will be interactive if ACCEPT_WHICH is
- * svn_cl__accept_unspecified.
- */
-svn_error_t *
-svn_cl__resolve_postponed_conflicts(svn_boolean_t *conflicts_all_resolved,
- void *baton,
- svn_cl__accept_t accept_which,
- const char *editor_cmd,
- svn_client_ctx_t *ctx,
- apr_pool_t *scratch_pool);
-
/*** Command-line output functions -- printing to the user. ***/
Modified: subversion/branches/fsfs-format7/subversion/svn/commit-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/svn/commit-cmd.c?rev=1462850&r1=1462849&r2=1462850&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/svn/commit-cmd.c (original)
+++ subversion/branches/fsfs-format7/subversion/svn/commit-cmd.c Sat Mar 30 20:02:27 2013
@@ -29,6 +29,7 @@
#include <apr_general.h>
+#include "svn_hash.h"
#include "svn_error.h"
#include "svn_error_codes.h"
#include "svn_wc.h"
@@ -136,8 +137,7 @@ svn_cl__commit(apr_getopt_t *os,
if (opt_state->depth == svn_depth_unknown)
opt_state->depth = svn_depth_infinity;
- cfg = apr_hash_get(ctx->config, SVN_CONFIG_CATEGORY_CONFIG,
- APR_HASH_KEY_STRING);
+ cfg = svn_hash_gets(ctx->config, SVN_CONFIG_CATEGORY_CONFIG);
if (cfg)
SVN_ERR(svn_config_get_bool(cfg, &no_unlock,
SVN_CONFIG_SECTION_MISCELLANY,
Modified: subversion/branches/fsfs-format7/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/svn/conflict-callbacks.c?rev=1462850&r1=1462849&r2=1462850&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/svn/conflict-callbacks.c (original)
+++ subversion/branches/fsfs-format7/subversion/svn/conflict-callbacks.c Sat Mar 30 20:02:27 2013
@@ -27,6 +27,7 @@
#define APR_WANT_STRFUNC
#include <apr_want.h>
+#include "svn_hash.h"
#include "svn_cmdline.h"
#include "svn_client.h"
#include "svn_dirent_uri.h"
@@ -971,8 +972,6 @@ handle_obstructed_add(svn_wc_conflict_re
return SVN_NO_ERROR;
}
-/* Implement svn_wc_conflict_resolver_func2_t; resolves based on
- --accept option if given, else by prompting. */
svn_error_t *
svn_cl__conflict_func_interactive(svn_wc_conflict_result_t **result,
const svn_wc_conflict_description2_t *desc,
@@ -1153,134 +1152,3 @@ svn_cl__conflict_func_interactive(svn_wc
return SVN_NO_ERROR;
}
-
-svn_error_t *
-svn_cl__conflict_func_postpone(svn_wc_conflict_result_t **result,
- const svn_wc_conflict_description2_t *desc,
- void *baton,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- apr_hash_t *conflicted_paths = baton;
-
- apr_hash_set(conflicted_paths,
- apr_pstrdup(apr_hash_pool_get(conflicted_paths),
- desc->local_abspath),
- APR_HASH_KEY_STRING, "");
-
- *result = svn_wc_create_conflict_result(svn_wc_conflict_choose_postpone,
- NULL, result_pool);
- return SVN_NO_ERROR;
-}
-
-void *
-svn_cl__get_conflict_func_postpone_baton(apr_pool_t *result_pool)
-{
- return apr_hash_make(result_pool);
-}
-
-static apr_array_header_t *
-get_postponed_conflicted_paths(void *baton, apr_pool_t *result_pool)
-{
- apr_hash_t *conflicted_paths = baton;
- apr_array_header_t *sorted_array;
- apr_array_header_t *result_array;
- int i;
-
- sorted_array = svn_sort__hash(conflicted_paths,
- svn_sort_compare_items_as_paths,
- apr_hash_pool_get(conflicted_paths));
- result_array = apr_array_make(result_pool, sorted_array->nelts,
- sizeof(const char *));
- for (i = 0; i < sorted_array->nelts; i++)
- {
- svn_sort__item_t item;
-
- item = APR_ARRAY_IDX(sorted_array, i, svn_sort__item_t);
- APR_ARRAY_PUSH(result_array, const char *) = apr_pstrdup(result_pool,
- item.key);
- }
-
- return result_array;
-}
-
-svn_error_t *
-svn_cl__resolve_postponed_conflicts(svn_boolean_t *conflicts_all_resolved,
- void *baton,
- svn_cl__accept_t accept_which,
- const char *editor_cmd,
- svn_client_ctx_t *ctx,
- apr_pool_t *scratch_pool)
-{
- apr_array_header_t *targets;
- int i;
- apr_pool_t *iterpool;
-
- targets = get_postponed_conflicted_paths(baton, scratch_pool);
-
- if (conflicts_all_resolved != NULL)
- *conflicts_all_resolved = TRUE;
-
- iterpool = svn_pool_create(scratch_pool);
- for (i = 0; i < targets->nelts; i++)
- {
- const char *target = APR_ARRAY_IDX(targets, i, const char *);
- svn_error_t *err = SVN_NO_ERROR;
- const char *local_abspath;
- svn_wc_conflict_resolver_func2_t conflict_func2;
- void *conflict_baton2;
- svn_cl__interactive_conflict_baton_t *b;
- svn_boolean_t text_c, prop_c, tree_c;
-
- svn_pool_clear(iterpool);
-
- SVN_ERR(svn_dirent_get_absolute(&local_abspath, target, iterpool));
-
- /* Store old state */
- conflict_func2 = ctx->conflict_func2;
- conflict_baton2 = ctx->conflict_baton2;
-
- /* Set up the interactive resolver. */
- ctx->conflict_func2 = svn_cl__conflict_func_interactive;
- SVN_ERR(svn_cl__get_conflict_func_interactive_baton(&b, accept_which,
- ctx->config,
- editor_cmd,
- ctx->cancel_func,
- ctx->cancel_baton,
- scratch_pool));
- ctx->conflict_baton2 = b;
-
- err = svn_client_resolve(local_abspath, svn_depth_empty,
- svn_wc_conflict_choose_unspecified,
- ctx, iterpool);
-
- /* Restore state */
- ctx->conflict_func2 = conflict_func2;
- ctx->conflict_baton2 = conflict_baton2;
-
- if (err)
- {
- if ((err->apr_err != SVN_ERR_WC_NOT_WORKING_COPY)
- && (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND))
- return svn_error_trace(err);
-
- svn_error_clear(err);
- }
-
- /* Report if we left any of the conflicts unresolved */
- if (conflicts_all_resolved != NULL)
- {
- SVN_ERR(svn_wc_conflicted_p3(&text_c, &prop_c, &tree_c,
- ctx->wc_ctx, local_abspath,
- scratch_pool));
- if (text_c || prop_c || tree_c)
- *conflicts_all_resolved = FALSE;
- }
-
- if (b->quit)
- break;
- }
- svn_pool_destroy(iterpool);
-
- return SVN_NO_ERROR;
-}
Modified: subversion/branches/fsfs-format7/subversion/svn/help-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/svn/help-cmd.c?rev=1462850&r1=1462849&r2=1462850&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/svn/help-cmd.c (original)
+++ subversion/branches/fsfs-format7/subversion/svn/help-cmd.c Sat Mar 30 20:02:27 2013
@@ -27,6 +27,7 @@
/*** Includes. ***/
+#include "svn_hash.h"
#include "svn_string.h"
#include "svn_config.h"
#include "svn_error.h"
@@ -92,9 +93,8 @@ svn_cl__help(apr_getopt_t *os,
if (cmd_baton->ctx->config)
{
- cfg = apr_hash_get(cmd_baton->ctx->config,
- SVN_CONFIG_CATEGORY_CONFIG,
- APR_HASH_KEY_STRING);
+ cfg = svn_hash_gets(cmd_baton->ctx->config,
+ SVN_CONFIG_CATEGORY_CONFIG);
if (cfg)
{
SVN_ERR(svn_config_get_bool(cfg, &store_auth_creds,
@@ -106,9 +106,8 @@ svn_cl__help(apr_getopt_t *os,
SVN_CONFIG_OPTION_STORE_PASSWORDS,
store_passwords));
}
- cfg = apr_hash_get(cmd_baton->ctx->config,
- SVN_CONFIG_CATEGORY_SERVERS,
- APR_HASH_KEY_STRING);
+ cfg = svn_hash_gets(cmd_baton->ctx->config,
+ SVN_CONFIG_CATEGORY_SERVERS);
if (cfg)
{
const char *value;
Modified: subversion/branches/fsfs-format7/subversion/svn/merge-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/svn/merge-cmd.c?rev=1462850&r1=1462849&r2=1462850&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/svn/merge-cmd.c (original)
+++ subversion/branches/fsfs-format7/subversion/svn/merge-cmd.c Sat Mar 30 20:02:27 2013
@@ -542,30 +542,6 @@ svn_cl__merge(apr_getopt_t *os,
"with --reintegrate"));
}
- /* Decide how to handle conflicts. If the user wants interactive
- * conflict resolution, postpone conflict resolution during the merge
- * and if any conflicts occur we'll run the conflict resolver later.
- * Otherwise install the appropriate resolver now. */
- if (opt_state->accept_which == svn_cl__accept_unspecified
- || opt_state->accept_which == svn_cl__accept_postpone
- || opt_state->accept_which == svn_cl__accept_edit
- || opt_state->accept_which == svn_cl__accept_launch)
- {
- /* 'svn.c' has already installed the 'postpone' handler for us. */
- }
- else
- {
- svn_cl__interactive_conflict_baton_t *b;
-
- ctx->conflict_func2 = svn_cl__conflict_func_interactive;
- SVN_ERR(svn_cl__get_conflict_func_interactive_baton(
- &b,
- opt_state->accept_which,
- ctx->config, opt_state->editor_cmd,
- ctx->cancel_func, ctx->cancel_baton, pool));
- ctx->conflict_baton2 = b;
- }
-
merge_err = run_merge(two_sources_specified,
sourcepath1, peg_revision1,
sourcepath2,
@@ -580,22 +556,12 @@ svn_cl__merge(apr_getopt_t *os,
_("Merge tracking not possible, use --ignore-ancestry or\n"
"fix invalid mergeinfo in target with 'svn propset'"));
}
- if (! merge_err || merge_err->apr_err == SVN_ERR_WC_FOUND_CONFLICT)
- {
- svn_error_t *err = SVN_NO_ERROR;
- if (! opt_state->quiet)
- err = svn_cl__notifier_print_conflict_stats(ctx->notify_baton2,
- pool);
+ if (!opt_state->quiet)
+ {
+ svn_error_t *err = svn_cl__notifier_print_conflict_stats(
+ ctx->notify_baton2, pool);
- /* Resolve any postponed conflicts. (Only if we've been using the
- * default 'postpone' resolver which remembers what was postponed.) */
- if (!err && ctx->conflict_func2 == svn_cl__conflict_func_postpone)
- err = svn_cl__resolve_postponed_conflicts(NULL,
- ctx->conflict_baton2,
- opt_state->accept_which,
- opt_state->editor_cmd,
- ctx, pool);
merge_err = svn_error_compose_create(merge_err, err);
}
Modified: subversion/branches/fsfs-format7/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/svn/notify.c?rev=1462850&r1=1462849&r2=1462850&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/svn/notify.c (original)
+++ subversion/branches/fsfs-format7/subversion/svn/notify.c Sat Mar 30 20:02:27 2013
@@ -36,7 +36,10 @@
#include "svn_dirent_uri.h"
#include "svn_path.h"
#include "svn_sorts.h"
+#include "svn_hash.h"
#include "cl.h"
+#include "private/svn_subr_private.h"
+#include "private/svn_dep_compat.h"
#include "svn_private_config.h"
@@ -54,9 +57,9 @@ struct notify_baton
when we've already had one print error. */
/* Conflict stats for update and merge. */
- int text_conflicts;
- int prop_conflicts;
- int tree_conflicts;
+ apr_pool_t *stats_pool;
+ apr_hash_t *text_conflicts, *prop_conflicts, *tree_conflicts;
+ int text_conflicts_resolved, prop_conflicts_resolved, tree_conflicts_resolved;
int skipped_paths;
/* The cwd, for use in decomposing absolute paths. */
@@ -64,14 +67,24 @@ struct notify_baton
};
+/* Add the PATH (as a key, with a meaningless value) into the HASH in NB. */
+static void
+store_path(struct notify_baton *nb, apr_hash_t *hash, const char *path)
+{
+ svn_hash_sets(hash, apr_pstrdup(nb->stats_pool, path), "");
+}
+
svn_error_t *
svn_cl__notifier_reset_conflict_stats(void *baton)
{
struct notify_baton *nb = baton;
- nb->text_conflicts = 0;
- nb->prop_conflicts = 0;
- nb->tree_conflicts = 0;
+ apr_hash_clear(nb->text_conflicts);
+ apr_hash_clear(nb->prop_conflicts);
+ apr_hash_clear(nb->tree_conflicts);
+ nb->text_conflicts_resolved = 0;
+ nb->prop_conflicts_resolved = 0;
+ nb->tree_conflicts_resolved = 0;
nb->skipped_paths = 0;
return SVN_NO_ERROR;
}
@@ -80,24 +93,50 @@ svn_error_t *
svn_cl__notifier_print_conflict_stats(void *baton, apr_pool_t *scratch_pool)
{
struct notify_baton *nb = baton;
-
- if (nb->text_conflicts > 0 || nb->prop_conflicts > 0
- || nb->tree_conflicts > 0 || nb->skipped_paths > 0)
+ int n_text = apr_hash_count(nb->text_conflicts);
+ int n_prop = apr_hash_count(nb->prop_conflicts);
+ int n_tree = apr_hash_count(nb->tree_conflicts);
+ int n_text_r = nb->text_conflicts_resolved;
+ int n_prop_r = nb->prop_conflicts_resolved;
+ int n_tree_r = nb->tree_conflicts_resolved;
+
+ if (n_text > 0 || n_text_r > 0
+ || n_prop > 0 || n_prop_r > 0
+ || n_tree > 0 || n_tree_r > 0
+ || nb->skipped_paths > 0)
SVN_ERR(svn_cmdline_printf(scratch_pool,
_("Summary of conflicts:\n")));
- if (nb->text_conflicts > 0)
- SVN_ERR(svn_cmdline_printf(scratch_pool,
- _(" Text conflicts: %d\n"),
- nb->text_conflicts));
- if (nb->prop_conflicts > 0)
- SVN_ERR(svn_cmdline_printf(scratch_pool,
- _(" Property conflicts: %d\n"),
- nb->prop_conflicts));
- if (nb->tree_conflicts > 0)
- SVN_ERR(svn_cmdline_printf(scratch_pool,
- _(" Tree conflicts: %d\n"),
- nb->tree_conflicts));
+ if (n_text_r == 0 && n_prop_r == 0 && n_tree_r == 0)
+ {
+ if (n_text > 0)
+ SVN_ERR(svn_cmdline_printf(scratch_pool,
+ _(" Text conflicts: %d\n"),
+ n_text));
+ if (n_prop > 0)
+ SVN_ERR(svn_cmdline_printf(scratch_pool,
+ _(" Property conflicts: %d\n"),
+ n_prop));
+ if (n_tree > 0)
+ SVN_ERR(svn_cmdline_printf(scratch_pool,
+ _(" Tree conflicts: %d\n"),
+ n_tree));
+ }
+ else
+ {
+ if (n_text > 0 || n_text_r > 0)
+ SVN_ERR(svn_cmdline_printf(scratch_pool,
+ _(" Text conflicts: %d remaining (and %d already resolved)\n"),
+ n_text, n_text_r));
+ if (n_prop > 0 || n_prop_r > 0)
+ SVN_ERR(svn_cmdline_printf(scratch_pool,
+ _(" Property conflicts: %d remaining (and %d already resolved)\n"),
+ n_prop, n_prop_r));
+ if (n_tree > 0 || n_tree_r > 0)
+ SVN_ERR(svn_cmdline_printf(scratch_pool,
+ _(" Tree conflicts: %d remaining (and %d already resolved)\n"),
+ n_tree, n_tree_r));
+ }
if (nb->skipped_paths > 0)
SVN_ERR(svn_cmdline_printf(scratch_pool,
_(" Skipped paths: %d\n"),
@@ -224,7 +263,7 @@ notify(void *baton, const svn_wc_notify_
nb->received_some_change = TRUE;
if (n->content_state == svn_wc_notify_state_conflicted)
{
- nb->text_conflicts++;
+ store_path(nb, nb->text_conflicts, path_local);
if ((err = svn_cmdline_printf(pool, "C %s\n", path_local)))
goto print_error;
}
@@ -239,7 +278,7 @@ notify(void *baton, const svn_wc_notify_
nb->received_some_change = TRUE;
if (n->content_state == svn_wc_notify_state_conflicted)
{
- nb->text_conflicts++;
+ store_path(nb, nb->text_conflicts, path_local);
statchar_buf[0] = 'C';
}
else
@@ -247,7 +286,7 @@ notify(void *baton, const svn_wc_notify_
if (n->prop_state == svn_wc_notify_state_conflicted)
{
- nb->prop_conflicts++;
+ store_path(nb, nb->prop_conflicts, path_local);
statchar_buf[1] = 'C';
}
else if (n->prop_state == svn_wc_notify_state_merged)
@@ -277,6 +316,23 @@ notify(void *baton, const svn_wc_notify_
break;
case svn_wc_notify_resolved:
+ /* All conflicts on this path are resolved, so remove path from
+ each of the text-, prop- and tree-conflict lists. */
+ if (svn_hash_gets(nb->text_conflicts, path_local))
+ {
+ svn_hash_sets(nb->text_conflicts, path_local, NULL);
+ nb->text_conflicts_resolved++;
+ }
+ if (svn_hash_gets(nb->prop_conflicts, path_local))
+ {
+ svn_hash_sets(nb->prop_conflicts, path_local, NULL);
+ nb->prop_conflicts_resolved++;
+ }
+ if (svn_hash_gets(nb->tree_conflicts, path_local))
+ {
+ svn_hash_sets(nb->tree_conflicts, path_local, NULL);
+ nb->tree_conflicts_resolved++;
+ }
if ((err = svn_cmdline_printf(pool,
_("Resolved conflicted state of '%s'\n"),
path_local)))
@@ -313,7 +369,7 @@ notify(void *baton, const svn_wc_notify_
nb->received_some_change = TRUE;
if (n->content_state == svn_wc_notify_state_conflicted)
{
- nb->text_conflicts++;
+ store_path(nb, nb->text_conflicts, path_local);
statchar_buf[0] = 'C';
}
else if (n->kind == svn_node_file)
@@ -326,7 +382,7 @@ notify(void *baton, const svn_wc_notify_
if (n->prop_state == svn_wc_notify_state_conflicted)
{
- nb->prop_conflicts++;
+ store_path(nb, nb->prop_conflicts, path_local);
statchar_buf[1] = 'C';
}
else if (n->prop_state == svn_wc_notify_state_changed)
@@ -525,7 +581,7 @@ notify(void *baton, const svn_wc_notify_
{
if (n->content_state == svn_wc_notify_state_conflicted)
{
- nb->text_conflicts++;
+ store_path(nb, nb->text_conflicts, path_local);
statchar_buf[0] = 'C';
}
else if (n->kind == svn_node_file)
@@ -538,7 +594,7 @@ notify(void *baton, const svn_wc_notify_
if (n->prop_state == svn_wc_notify_state_conflicted)
{
- nb->prop_conflicts++;
+ store_path(nb, nb->prop_conflicts, path_local);
statchar_buf[1] = 'C';
}
else if (n->prop_state == svn_wc_notify_state_merged)
@@ -915,7 +971,7 @@ notify(void *baton, const svn_wc_notify_
break;
case svn_wc_notify_tree_conflict:
- nb->tree_conflicts++;
+ store_path(nb, nb->tree_conflicts, path_local);
if ((err = svn_cmdline_printf(pool, " C %s\n", path_local)))
goto print_error;
break;
@@ -1070,9 +1126,13 @@ svn_cl__get_notifier(svn_wc_notify_func2
nb->is_wc_to_repos_copy = FALSE;
nb->in_external = FALSE;
nb->had_print_error = FALSE;
- nb->text_conflicts = 0;
- nb->prop_conflicts = 0;
- nb->tree_conflicts = 0;
+ nb->stats_pool = pool;
+ nb->text_conflicts = apr_hash_make(pool);
+ nb->prop_conflicts = apr_hash_make(pool);
+ nb->tree_conflicts = apr_hash_make(pool);
+ nb->text_conflicts_resolved = 0;
+ nb->prop_conflicts_resolved = 0;
+ nb->tree_conflicts_resolved = 0;
nb->skipped_paths = 0;
SVN_ERR(svn_dirent_get_absolute(&nb->path_prefix, "", pool));
Modified: subversion/branches/fsfs-format7/subversion/svn/propedit-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/svn/propedit-cmd.c?rev=1462850&r1=1462849&r2=1462850&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/svn/propedit-cmd.c (original)
+++ subversion/branches/fsfs-format7/subversion/svn/propedit-cmd.c Sat Mar 30 20:02:27 2013
@@ -27,6 +27,7 @@
/*** Includes. ***/
+#include "svn_hash.h"
#include "svn_cmdline.h"
#include "svn_wc.h"
#include "svn_pools.h"
@@ -239,7 +240,7 @@ svn_cl__propedit(apr_getopt_t *os,
NULL, ctx, subpool, subpool));
/* Get the property value. */
- propval = apr_hash_get(props, abspath_or_url, APR_HASH_KEY_STRING);
+ propval = svn_hash_gets(props, abspath_or_url);
if (! propval)
propval = svn_string_create_empty(subpool);
Modified: subversion/branches/fsfs-format7/subversion/svn/propget-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/svn/propget-cmd.c?rev=1462850&r1=1462849&r2=1462850&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/svn/propget-cmd.c (original)
+++ subversion/branches/fsfs-format7/subversion/svn/propget-cmd.c Sat Mar 30 20:02:27 2013
@@ -27,6 +27,7 @@
/*** Includes. ***/
+#include "svn_hash.h"
#include "svn_cmdline.h"
#include "svn_pools.h"
#include "svn_client.h"
@@ -209,7 +210,7 @@ print_single_prop(svn_string_t *propval,
/* Print the property name and value just as "proplist -v" does */
apr_hash_t *hash = apr_hash_make(scratch_pool);
- apr_hash_set(hash, pname_utf8, APR_HASH_KEY_STRING, propval);
+ svn_hash_sets(hash, pname_utf8, propval);
SVN_ERR(svn_cmdline__print_prop_hash(out, hash, FALSE, scratch_pool));
}
else
Modified: subversion/branches/fsfs-format7/subversion/svn/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/svn/props.c?rev=1462850&r1=1462849&r2=1462850&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/svn/props.c (original)
+++ subversion/branches/fsfs-format7/subversion/svn/props.c Sat Mar 30 20:02:27 2013
@@ -30,6 +30,7 @@
#include <stdlib.h>
#include <apr_hash.h>
+#include "svn_hash.h"
#include "svn_cmdline.h"
#include "svn_string.h"
#include "svn_error.h"
Modified: subversion/branches/fsfs-format7/subversion/svn/status-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/svn/status-cmd.c?rev=1462850&r1=1462849&r2=1462850&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/svn/status-cmd.c (original)
+++ subversion/branches/fsfs-format7/subversion/svn/status-cmd.c Sat Mar 30 20:02:27 2013
@@ -27,6 +27,7 @@
/*** Includes. ***/
+#include "svn_hash.h"
#include "svn_string.h"
#include "svn_wc.h"
#include "svn_client.h"
@@ -241,13 +242,12 @@ print_status(void *baton,
scache->status = svn_client_status_dup(status, sb->cl_pool);
path_array =
- apr_hash_get(sb->cached_changelists, cl_key, APR_HASH_KEY_STRING);
+ svn_hash_gets(sb->cached_changelists, cl_key);
if (path_array == NULL)
{
path_array = apr_array_make(sb->cl_pool, 1,
sizeof(struct status_cache *));
- apr_hash_set(sb->cached_changelists, cl_key,
- APR_HASH_KEY_STRING, path_array);
+ svn_hash_sets(sb->cached_changelists, cl_key, path_array);
}
APR_ARRAY_PUSH(path_array, struct status_cache *) = scache;