From commits-return-49871-archive-asf-public=cust-asf.ponee.io@subversion.apache.org Tue Nov 13 08:49:22 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id E44801807BD for ; Tue, 13 Nov 2018 08:49:18 +0100 (CET) Received: (qmail 21741 invoked by uid 500); 13 Nov 2018 07:49:17 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 20247 invoked by uid 99); 13 Nov 2018 07:49:16 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Nov 2018 07:49:16 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id A11D43A26F7 for ; Tue, 13 Nov 2018 07:49:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1846488 [11/23] - in /subversion/branches/mod-dav-svn-expressions: ./ build/ build/ac-macros/ build/generator/ build/generator/swig/ build/generator/templates/ build/generator/util/ build/win32/ contrib/client-side/ contrib/client-side/svn... Date: Tue, 13 Nov 2018 07:49:08 -0000 To: commits@subversion.apache.org From: brane@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20181113074914.A11D43A26F7@svn01-us-west.apache.org> Modified: subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/README URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/README?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/README (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/README Tue Nov 13 07:49:04 2018 @@ -94,6 +94,10 @@ copies. .svn/wc.db /* SQLite database containing node metadata. */ pristine/ /* Sharded directory containing base files. */ tmp/ /* Local tmp area. */ + experimental/ /* Data for experimental features. */ + shelves/ /* Used by 1.10.x shelves implementation */ + entries /* Stub file. */ + format /* Stub file. */ `wc.db': A self-contained SQLite database containing all the metadata Subversion @@ -109,6 +113,17 @@ copies. Pristines are used for sending diffs back to the server, etc. +`experimental': + Experimental (unstable) features store their data here. + +`shelves': + Subversion 1.10's "svn shelve" command stores shelved changes here. + This directory is not used by any other minor release line. + +`entries', `format': + These stub files exist only to enable a pre-1.7 client to yield a clearer + error message. + How the client applies an update delta -------------------------------------- Modified: subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/conflicts.c URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/conflicts.c?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/conflicts.c (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/conflicts.c Tue Nov 13 07:49:04 2018 @@ -539,6 +539,7 @@ svn_wc__conflict_skel_add_tree_conflict( svn_wc_conflict_reason_t reason, svn_wc_conflict_action_t action, const char *move_src_op_root_abspath, + const char *move_dst_op_root_abspath, apr_pool_t *result_pool, apr_pool_t *scratch_pool) { @@ -555,18 +556,33 @@ svn_wc__conflict_skel_add_tree_conflict( tree_conflict = svn_skel__make_empty_list(result_pool); - if (reason == svn_wc_conflict_reason_moved_away - && move_src_op_root_abspath) + if (reason == svn_wc_conflict_reason_moved_away) { - const char *move_src_op_root_relpath; + if (move_dst_op_root_abspath) + { + const char *move_dst_op_root_relpath; - SVN_ERR(svn_wc__db_to_relpath(&move_src_op_root_relpath, - db, wri_abspath, - move_src_op_root_abspath, - result_pool, scratch_pool)); + SVN_ERR(svn_wc__db_to_relpath(&move_dst_op_root_relpath, + db, wri_abspath, + move_dst_op_root_abspath, + result_pool, scratch_pool)); - svn_skel__prepend_str(move_src_op_root_relpath, tree_conflict, - result_pool); + svn_skel__prepend_str(move_dst_op_root_relpath, tree_conflict, + result_pool); + } + + if (move_src_op_root_abspath) + { + const char *move_src_op_root_relpath; + + SVN_ERR(svn_wc__db_to_relpath(&move_src_op_root_relpath, + db, wri_abspath, + move_src_op_root_abspath, + result_pool, scratch_pool)); + + svn_skel__prepend_str(move_src_op_root_relpath, tree_conflict, + result_pool); + } } svn_skel__prepend_str(svn_token__to_word(action_map, action), @@ -932,6 +948,7 @@ svn_error_t * svn_wc__conflict_read_tree_conflict(svn_wc_conflict_reason_t *reason, svn_wc_conflict_action_t *action, const char **move_src_op_root_abspath, + const char **move_dst_op_root_abspath, svn_wc__db_t *db, const char *wri_abspath, const svn_skel_t *conflict_skel, @@ -981,10 +998,10 @@ svn_wc__conflict_read_tree_conflict(svn_ c = c->next; - if (move_src_op_root_abspath) + if (move_src_op_root_abspath || move_dst_op_root_abspath) { /* Only set for update and switch tree conflicts */ - if (c && is_moved_away) + if (c && is_moved_away && move_src_op_root_abspath) { const char *move_src_op_root_relpath = apr_pstrmemdup(scratch_pool, c->data, c->len); @@ -994,8 +1011,25 @@ svn_wc__conflict_read_tree_conflict(svn_ move_src_op_root_relpath, result_pool, scratch_pool)); } - else + else if (move_src_op_root_abspath) *move_src_op_root_abspath = NULL; + + if (c) + c = c->next; + + if (c && is_moved_away && move_dst_op_root_abspath) + { + const char *move_dst_op_root_relpath + = apr_pstrmemdup(scratch_pool, c->data, c->len); + + SVN_ERR(svn_wc__db_from_relpath(move_dst_op_root_abspath, + db, wri_abspath, + move_dst_op_root_relpath, + result_pool, scratch_pool)); + } + else if (move_dst_op_root_abspath) + *move_dst_op_root_abspath = NULL; + } return SVN_NO_ERROR; @@ -1801,7 +1835,7 @@ read_tree_conflict_desc(svn_wc_conflict_ svn_wc_conflict_action_t action; SVN_ERR(svn_wc__conflict_read_tree_conflict( - &reason, &action, NULL, + &reason, &action, NULL, NULL, db, local_abspath, conflict_skel, scratch_pool, scratch_pool)); if (reason == svn_wc_conflict_reason_missing) @@ -2676,7 +2710,7 @@ resolve_tree_conflict_on_node(svn_boolea SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action, &src_op_root_abspath, - db, local_abspath, + NULL, db, local_abspath, conflicts, scratch_pool, scratch_pool)); @@ -2748,6 +2782,7 @@ resolve_tree_conflict_on_node(svn_boolea SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action, &src_op_root_abspath, + NULL, db, local_abspath, new_conflicts, scratch_pool, @@ -3483,7 +3518,7 @@ svn_wc__conflict_tree_update_break_moved return SVN_NO_ERROR; SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action, - &src_op_root_abspath, + &src_op_root_abspath, NULL, wc_ctx->db, local_abspath, conflict_skel, scratch_pool, scratch_pool)); @@ -3569,7 +3604,7 @@ svn_wc__conflict_tree_update_raise_moved if (!tree_conflicted) return SVN_NO_ERROR; - SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action, NULL, + SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action, NULL, NULL, wc_ctx->db, local_abspath, conflict_skel, scratch_pool, scratch_pool)); @@ -3648,7 +3683,7 @@ svn_wc__conflict_tree_update_moved_away_ return SVN_NO_ERROR; SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action, - &src_op_root_abspath, + &src_op_root_abspath, NULL, wc_ctx->db, local_abspath, conflict_skel, scratch_pool, scratch_pool)); @@ -3734,8 +3769,8 @@ svn_wc__conflict_tree_update_incoming_mo return SVN_NO_ERROR; SVN_ERR(svn_wc__conflict_read_tree_conflict(&local_change, &incoming_change, - NULL, wc_ctx->db, local_abspath, - conflict_skel, + NULL, NULL, wc_ctx->db, + local_abspath, conflict_skel, scratch_pool, scratch_pool)); /* Make sure the expected conflict is recorded. */ @@ -3803,8 +3838,8 @@ svn_wc__conflict_tree_update_local_add(s return SVN_NO_ERROR; SVN_ERR(svn_wc__conflict_read_tree_conflict(&local_change, &incoming_change, - NULL, wc_ctx->db, local_abspath, - conflict_skel, + NULL, NULL, wc_ctx->db, + local_abspath, conflict_skel, scratch_pool, scratch_pool)); /* Make sure the expected conflict is recorded. */ @@ -3853,9 +3888,9 @@ svn_wc__guess_incoming_move_target_nodes apr_size_t longest_ancestor_len = 0; *possible_targets = apr_array_make(result_pool, 1, sizeof(const char *)); - SVN_ERR(svn_wc__find_repos_node_in_wc(&candidates, wc_ctx->db, victim_abspath, - moved_to_repos_relpath, - scratch_pool, scratch_pool)); + SVN_ERR(svn_wc__db_find_repos_node_in_wc(&candidates, wc_ctx->db, victim_abspath, + moved_to_repos_relpath, + scratch_pool, scratch_pool)); /* Find a "useful move target" node in our set of candidates. * Since there is no way to be certain, filter out nodes which seem Modified: subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/conflicts.h URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/conflicts.h?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/conflicts.h (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/conflicts.h Tue Nov 13 07:49:04 2018 @@ -219,6 +219,11 @@ svn_wc__conflict_skel_add_prop_conflict( MOVE_SRC_OP_ROOT_ABSPATH should be A for a conflict associated with (1), MOVE_SRC_OP_ROOT_ABSPATH should be A/B for a conflict associated with (2). + MOVE_DST_OP_ROOT_ABSPATH is the op-root of the move target (i.e. the + op-root of the corresponding copy). This needs to be stored because + moves in the NODE table do not always persist after an update, while + the conflict resolver may need information about the pre-update state + of the move. It is an error to add another tree conflict to a conflict skel that already contains a tree conflict. (It is not an error, at this level, @@ -233,6 +238,7 @@ svn_wc__conflict_skel_add_tree_conflict( svn_wc_conflict_reason_t local_change, svn_wc_conflict_action_t incoming_change, const char *move_src_op_root_abspath, + const char *move_dst_op_root_abspath, apr_pool_t *result_pool, apr_pool_t *scratch_pool); @@ -364,6 +370,7 @@ svn_error_t * svn_wc__conflict_read_tree_conflict(svn_wc_conflict_reason_t *local_change, svn_wc_conflict_action_t *incoming_change, const char **move_src_op_root_abspath, + const char **move_dst_op_root_abspath, svn_wc__db_t *db, const char *wri_abspath, const svn_skel_t *conflict_skel, Modified: subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/deprecated.c URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/deprecated.c?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/deprecated.c (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/deprecated.c Tue Nov 13 07:49:04 2018 @@ -1091,6 +1091,33 @@ svn_wc_add(const char *path, /*** From revert.c ***/ svn_error_t * +svn_wc_revert5(svn_wc_context_t *wc_ctx, + const char *local_abspath, + svn_depth_t depth, + svn_boolean_t use_commit_times, + const apr_array_header_t *changelist_filter, + svn_boolean_t clear_changelists, + svn_boolean_t metadata_only, + svn_cancel_func_t cancel_func, + void *cancel_baton, + svn_wc_notify_func2_t notify_func, + void *notify_baton, + apr_pool_t *scratch_pool) +{ + SVN_ERR(svn_wc_revert6(wc_ctx, local_abspath, + depth, + use_commit_times, + changelist_filter, + clear_changelists, + metadata_only, + TRUE /*added_keep_local*/, + cancel_func, cancel_baton, + notify_func, notify_baton, + scratch_pool)); + return SVN_NO_ERROR; +} + +svn_error_t * svn_wc_revert4(svn_wc_context_t *wc_ctx, const char *local_abspath, svn_depth_t depth, @@ -2069,8 +2096,7 @@ svn_wc_get_diff_editor6(const svn_delta_ result_pool, scratch_pool)); if (reverse_order) - diff_processor = svn_diff__tree_processor_reverse_create( - diff_processor, NULL, result_pool); + diff_processor = svn_diff__tree_processor_reverse_create(diff_processor, result_pool); if (! show_copies_as_adds) diff_processor = svn_diff__tree_processor_copy_as_changed_create( Modified: subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/diff_local.c URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/diff_local.c?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/diff_local.c (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/diff_local.c Tue Nov 13 07:49:04 2018 @@ -433,8 +433,7 @@ diff_status_callback(void *baton, /* Public Interface */ svn_error_t * -svn_wc__diff7(const char **root_relpath, - svn_boolean_t *root_is_dir, +svn_wc__diff7(svn_boolean_t anchor_at_given_paths, svn_wc_context_t *wc_ctx, const char *local_abspath, svn_depth_t depth, @@ -459,26 +458,30 @@ svn_wc__diff7(const char **root_relpath, eb.anchor_abspath = local_abspath; - if (root_relpath) + if (anchor_at_given_paths) { + /* Anchor the underlying diff processor at the parent of + LOCAL_ABSPATH (if possible), and adjust so the outgoing + DIFF_PROCESSOR is always anchored at LOCAL_ABSPATH. */ + /* ### Why anchor the underlying diff processor at the parent? */ svn_boolean_t is_wcroot; SVN_ERR(svn_wc__db_is_wcroot(&is_wcroot, wc_ctx->db, local_abspath, scratch_pool)); if (!is_wcroot) - eb.anchor_abspath = svn_dirent_dirname(local_abspath, scratch_pool); + { + const char *relpath; + + eb.anchor_abspath = svn_dirent_dirname(local_abspath, scratch_pool); + relpath = svn_dirent_basename(local_abspath, NULL); + diff_processor = svn_diff__tree_processor_filter_create( + diff_processor, relpath, scratch_pool); + } } else if (kind != svn_node_dir) eb.anchor_abspath = svn_dirent_dirname(local_abspath, scratch_pool); - if (root_relpath) - *root_relpath = apr_pstrdup(result_pool, - svn_dirent_skip_ancestor(eb.anchor_abspath, - local_abspath)); - if (root_is_dir) - *root_is_dir = (kind == svn_node_dir); - /* Apply changelist filtering to the output */ if (changelist_filter && changelist_filter->nelts) { @@ -572,7 +575,7 @@ svn_wc_diff6(svn_wc_context_t *wc_ctx, processor = svn_diff__tree_processor_copy_as_changed_create(processor, scratch_pool); - return svn_error_trace(svn_wc__diff7(NULL, NULL, + return svn_error_trace(svn_wc__diff7(FALSE, wc_ctx, local_abspath, depth, ignore_ancestry, Modified: subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/node.c URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/node.c?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/node.c (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/node.c Tue Nov 13 07:49:04 2018 @@ -1126,3 +1126,17 @@ svn_wc__node_was_moved_here(const char * return SVN_NO_ERROR; } + +svn_error_t * +svn_wc__find_working_nodes_with_basename(apr_array_header_t **abspaths, + const char *wri_abspath, + const char *basename, + svn_node_kind_t kind, + svn_wc_context_t *wc_ctx, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool) +{ + return svn_error_trace(svn_wc__db_find_working_nodes_with_basename( + abspaths, wc_ctx->db, wri_abspath, basename, kind, + result_pool, scratch_pool)); +} Modified: subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/props.c URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/props.c?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/props.c (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/props.c Tue Nov 13 07:49:04 2018 @@ -2236,7 +2236,9 @@ svn_wc_canonicalize_svn_prop(const svn_s if (duplicate_targets->nelts > 1) { more_str = apr_psprintf(/*scratch_*/pool, - _(" (%d more duplicate targets found)"), + Q_(" (%d more duplicate target found)", + " (%d more duplicate targets found)", + duplicate_targets->nelts - 1), duplicate_targets->nelts - 1); } return svn_error_createf( Modified: subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/questions.c URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/questions.c?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/questions.c (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/questions.c Tue Nov 13 07:49:04 2018 @@ -475,7 +475,7 @@ internal_conflicted_p(svn_boolean_t *tex svn_wc_conflict_action_t action; SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action, NULL, - db, local_abspath, + NULL, db, local_abspath, conflicts, scratch_pool, scratch_pool)); Modified: subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/revert.c URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/revert.c?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/revert.c (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/revert.c Tue Nov 13 07:49:04 2018 @@ -285,6 +285,7 @@ revert_restore(svn_boolean_t *run_wq, svn_boolean_t metadata_only, svn_boolean_t use_commit_times, svn_boolean_t revert_root, + svn_boolean_t added_keep_local, const struct svn_wc__db_info_t *info, svn_cancel_func_t cancel_func, void *cancel_baton, @@ -344,8 +345,9 @@ revert_restore(svn_boolean_t *run_wq, } else { - if (!copied_here) + if (added_keep_local && !copied_here) { + /* It is a plain add, and we want to keep the local file/dir. */ if (notify_func && notify_required) notify_func(notify_baton, svn_wc_create_notify(local_abspath, @@ -359,8 +361,17 @@ revert_restore(svn_boolean_t *run_wq, scratch_pool)); return SVN_NO_ERROR; } + else if (!copied_here) + { + /* It is a plain add, and we don't want to keep the local file/dir. */ + status = svn_wc__db_status_not_present; + kind = svn_node_none; + recorded_size = SVN_INVALID_FILESIZE; + recorded_time = 0; + } else { + /* It is a copy, so we don't want to keep the local file/dir. */ /* ### Initialise to values which prevent the code below from * ### trying to restore anything to disk. * ### 'status' should be status_unknown but that doesn't exist. */ @@ -429,6 +440,7 @@ revert_restore(svn_boolean_t *run_wq, SVN_ERR(revert_restore(run_wq, db, child_abspath, depth, metadata_only, use_commit_times, FALSE /* revert root */, + added_keep_local, apr_hash_this_val(hi), cancel_func, cancel_baton, notify_func, notify_baton, @@ -536,11 +548,7 @@ revert_wc_data(svn_boolean_t *run_wq, /* If we expect a versioned item to be present then check that any item on disk matches the versioned item, if it doesn't match then fix it or delete it. */ - if (on_disk != svn_node_none - && status != svn_wc__db_status_server_excluded - && status != svn_wc__db_status_deleted - && status != svn_wc__db_status_excluded - && status != svn_wc__db_status_not_present) + if (on_disk != svn_node_none) { if (on_disk == svn_node_dir && kind != svn_node_dir) { @@ -560,7 +568,11 @@ revert_wc_data(svn_boolean_t *run_wq, on_disk = svn_node_none; } } - else if (on_disk == svn_node_file) + else if (on_disk == svn_node_file + && status != svn_wc__db_status_server_excluded + && status != svn_wc__db_status_deleted + && status != svn_wc__db_status_excluded + && status != svn_wc__db_status_not_present) { svn_boolean_t modified; apr_hash_t *props; @@ -712,6 +724,7 @@ revert(svn_wc__db_t *db, svn_boolean_t use_commit_times, svn_boolean_t clear_changelists, svn_boolean_t metadata_only, + svn_boolean_t added_keep_local, svn_cancel_func_t cancel_func, void *cancel_baton, svn_wc_notify_func2_t notify_func, @@ -762,6 +775,7 @@ revert(svn_wc__db_t *db, err = svn_error_trace( revert_restore(&run_queue, db, local_abspath, depth, metadata_only, use_commit_times, TRUE /* revert root */, + added_keep_local, info, cancel_func, cancel_baton, notify_func, notify_baton, scratch_pool)); @@ -791,6 +805,7 @@ revert_changelist(svn_wc__db_t *db, apr_hash_t *changelist_hash, svn_boolean_t clear_changelists, svn_boolean_t metadata_only, + svn_boolean_t added_keep_local, svn_cancel_func_t cancel_func, void *cancel_baton, svn_wc_notify_func2_t notify_func, @@ -809,7 +824,7 @@ revert_changelist(svn_wc__db_t *db, scratch_pool)) SVN_ERR(revert(db, local_abspath, svn_depth_empty, use_commit_times, clear_changelists, - metadata_only, + metadata_only, added_keep_local, cancel_func, cancel_baton, notify_func, notify_baton, scratch_pool)); @@ -845,6 +860,7 @@ revert_changelist(svn_wc__db_t *db, SVN_ERR(revert_changelist(db, child_abspath, depth, use_commit_times, changelist_hash, clear_changelists, metadata_only, + added_keep_local, cancel_func, cancel_baton, notify_func, notify_baton, iterpool)); @@ -871,6 +887,7 @@ revert_partial(svn_wc__db_t *db, svn_boolean_t use_commit_times, svn_boolean_t clear_changelists, svn_boolean_t metadata_only, + svn_boolean_t added_keep_local, svn_cancel_func_t cancel_func, void *cancel_baton, svn_wc_notify_func2_t notify_func, @@ -892,6 +909,7 @@ revert_partial(svn_wc__db_t *db, children. */ SVN_ERR(revert(db, local_abspath, svn_depth_empty, use_commit_times, clear_changelists, metadata_only, + added_keep_local, cancel_func, cancel_baton, notify_func, notify_baton, iterpool)); @@ -926,7 +944,7 @@ revert_partial(svn_wc__db_t *db, /* Revert just this node (depth=empty). */ SVN_ERR(revert(db, child_abspath, svn_depth_empty, use_commit_times, clear_changelists, - metadata_only, + metadata_only, added_keep_local, cancel_func, cancel_baton, notify_func, notify_baton, iterpool)); @@ -939,13 +957,14 @@ revert_partial(svn_wc__db_t *db, svn_error_t * -svn_wc_revert5(svn_wc_context_t *wc_ctx, +svn_wc_revert6(svn_wc_context_t *wc_ctx, const char *local_abspath, svn_depth_t depth, svn_boolean_t use_commit_times, const apr_array_header_t *changelist_filter, svn_boolean_t clear_changelists, svn_boolean_t metadata_only, + svn_boolean_t added_keep_local, svn_cancel_func_t cancel_func, void *cancel_baton, svn_wc_notify_func2_t notify_func, @@ -963,6 +982,7 @@ svn_wc_revert5(svn_wc_context_t *wc_ctx, changelist_hash, clear_changelists, metadata_only, + added_keep_local, cancel_func, cancel_baton, notify_func, notify_baton, scratch_pool)); @@ -972,6 +992,7 @@ svn_wc_revert5(svn_wc_context_t *wc_ctx, return svn_error_trace(revert(wc_ctx->db, local_abspath, depth, use_commit_times, clear_changelists, metadata_only, + added_keep_local, cancel_func, cancel_baton, notify_func, notify_baton, scratch_pool)); @@ -986,6 +1007,7 @@ svn_wc_revert5(svn_wc_context_t *wc_ctx, return svn_error_trace(revert_partial(wc_ctx->db, local_abspath, depth, use_commit_times, clear_changelists, metadata_only, + added_keep_local, cancel_func, cancel_baton, notify_func, notify_baton, scratch_pool)); Modified: subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/tree_conflicts.c URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/tree_conflicts.c?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/tree_conflicts.c (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/tree_conflicts.c Tue Nov 13 07:49:04 2018 @@ -442,7 +442,7 @@ svn_wc__add_tree_conflict(svn_wc_context conflict->local_abspath, conflict->reason, conflict->action, - NULL, + NULL, NULL, scratch_pool, scratch_pool)); switch (conflict->operation) Modified: subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/update_editor.c URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/update_editor.c?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/update_editor.c (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/update_editor.c Tue Nov 13 07:49:04 2018 @@ -1235,9 +1235,11 @@ open_root(void *edit_baton, db->shadowed = TRUE; else if (have_work) { + const char *move_dst_op_root_abspath; const char *move_src_root_abspath; - SVN_ERR(svn_wc__db_base_moved_to(NULL, NULL, &move_src_root_abspath, + SVN_ERR(svn_wc__db_base_moved_to(NULL, &move_dst_op_root_abspath, + &move_src_root_abspath, NULL, eb->db, db->local_abspath, pool, pool)); @@ -1252,7 +1254,8 @@ open_root(void *edit_baton, tree_conflict, eb->db, move_src_root_abspath, svn_wc_conflict_reason_moved_away, svn_wc_conflict_action_edit, - move_src_root_abspath, pool, pool)); + move_src_root_abspath, + move_dst_op_root_abspath, pool, pool)); if (strcmp(db->local_abspath, move_src_root_abspath)) { @@ -1345,6 +1348,7 @@ check_tree_conflict(svn_skel_t **pconfli svn_wc_conflict_reason_t reason = SVN_WC_CONFLICT_REASON_NONE; svn_boolean_t modified = FALSE; const char *move_src_op_root_abspath = NULL; + const char *move_dst_op_root_abspath = NULL; *pconflict = NULL; @@ -1397,8 +1401,8 @@ check_tree_conflict(svn_skel_t **pconfli case svn_wc__db_status_deleted: { - SVN_ERR(svn_wc__db_base_moved_to(NULL, NULL, NULL, - &move_src_op_root_abspath, + SVN_ERR(svn_wc__db_base_moved_to(NULL, &move_dst_op_root_abspath, + NULL, &move_src_op_root_abspath, eb->db, local_abspath, scratch_pool, scratch_pool)); if (move_src_op_root_abspath) @@ -1530,6 +1534,7 @@ check_tree_conflict(svn_skel_t **pconfli reason, action, move_src_op_root_abspath, + move_dst_op_root_abspath, result_pool, scratch_pool)); return SVN_NO_ERROR; @@ -2007,11 +2012,13 @@ add_directory(const char *path, { svn_wc_conflict_reason_t reason; const char *move_src_op_root_abspath; + const char *move_dst_op_root_abspath; /* So this deletion wasn't just a deletion, it is actually a replacement. Let's install a better tree conflict. */ SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, NULL, &move_src_op_root_abspath, + &move_dst_op_root_abspath, eb->db, db->local_abspath, tree_conflict, @@ -2024,6 +2031,7 @@ add_directory(const char *path, eb->db, db->local_abspath, reason, svn_wc_conflict_action_replace, move_src_op_root_abspath, + move_dst_op_root_abspath, db->pool, scratch_pool)); /* And now stop checking for conflicts here and just perform @@ -2148,8 +2156,8 @@ add_directory(const char *path, tree_conflict, eb->db, db->local_abspath, svn_wc_conflict_reason_unversioned, - svn_wc_conflict_action_add, NULL, - db->pool, scratch_pool)); + svn_wc_conflict_action_add, + NULL, NULL, db->pool, scratch_pool)); db->edit_conflict = tree_conflict; } } @@ -2336,7 +2344,7 @@ open_directory(const char *path, db->edit_conflict = tree_conflict; /* Other modifications wouldn't be a tree conflict */ - SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, NULL, NULL, + SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, NULL, NULL, NULL, eb->db, db->local_abspath, tree_conflict, db->pool, db->pool)); @@ -3220,11 +3228,13 @@ add_file(const char *path, { svn_wc_conflict_reason_t reason; const char *move_src_op_root_abspath; + const char *move_dst_op_root_abspath; /* So this deletion wasn't just a deletion, it is actually a replacement. Let's install a better tree conflict. */ SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, NULL, &move_src_op_root_abspath, + &move_dst_op_root_abspath, eb->db, fb->local_abspath, tree_conflict, @@ -3237,6 +3247,7 @@ add_file(const char *path, eb->db, fb->local_abspath, reason, svn_wc_conflict_action_replace, move_src_op_root_abspath, + move_dst_op_root_abspath, fb->pool, scratch_pool)); /* And now stop checking for conflicts here and just perform @@ -3363,7 +3374,7 @@ add_file(const char *path, eb->db, fb->local_abspath, svn_wc_conflict_reason_unversioned, svn_wc_conflict_action_add, - NULL, + NULL, NULL, fb->pool, scratch_pool)); } } @@ -3528,7 +3539,7 @@ open_file(const char *path, fb->edit_conflict = tree_conflict; /* Other modifications wouldn't be a tree conflict */ - SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, NULL, NULL, + SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, NULL, NULL, NULL, eb->db, fb->local_abspath, tree_conflict, scratch_pool, scratch_pool)); @@ -3797,7 +3808,7 @@ change_file_prop(void *file_baton, eb->db, fb->local_abspath, svn_wc_conflict_reason_edited, svn_wc_conflict_action_replace, - NULL, + NULL, NULL, fb->pool, scratch_pool)); SVN_ERR(complete_conflict(fb->edit_conflict, fb->edit_baton, Modified: subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/upgrade.c URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/upgrade.c?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/upgrade.c (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/upgrade.c Tue Nov 13 07:49:04 2018 @@ -1237,7 +1237,7 @@ svn_wc__upgrade_conflict_skel_from_raw(s db, wri_abspath, tc->reason, tc->action, - NULL, + NULL, NULL, scratch_pool, scratch_pool)); Modified: subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wc-queries.sql URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wc-queries.sql?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wc-queries.sql (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wc-queries.sql Tue Nov 13 07:49:04 2018 @@ -117,6 +117,17 @@ WHERE wc_id = ?1 AND local_relpath = ?2 ORDER BY op_depth DESC LIMIT 1 +-- STMT_SELECT_PRESENT_HIGHEST_WORKING_NODES_BY_BASENAME_AND_KIND +SELECT presence, local_relpath +FROM nodes n +WHERE wc_id = ?1 AND local_relpath = RELPATH_JOIN(parent_relpath, ?2) + AND kind = ?3 + AND presence in (MAP_NORMAL, MAP_INCOMPLETE) + AND op_depth = (SELECT MAX(op_depth) + FROM NODES w + WHERE w.wc_id = ?1 + AND w.local_relpath = n.local_relpath) + -- STMT_SELECT_ACTUAL_NODE SELECT changelist, properties, conflict_data FROM actual_node Modified: subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wc.h URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wc.h?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wc.h (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wc.h Tue Nov 13 07:49:04 2018 @@ -159,6 +159,7 @@ extern "C" { * * == 1.8.x shipped with format 31 * == 1.9.x shipped with format 31 + * == 1.10.x shipped with format 31 * * Please document any further format changes here. */ @@ -288,6 +289,7 @@ struct svn_wc_traversal_info_t #define SVN_WC__ADM_TMP "tmp" #define SVN_WC__ADM_PRISTINE "pristine" #define SVN_WC__ADM_NONEXISTENT_PATH "nonexistent-path" +#define SVN_WC__ADM_EXPERIMENTAL "experimental" /* The basename of the ".prej" file, if a directory ever has property conflicts. This .prej file will appear *within* the conflicted Modified: subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wc_db.c URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wc_db.c?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wc_db.c (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wc_db.c Tue Nov 13 07:49:04 2018 @@ -6839,7 +6839,7 @@ revert_maybe_raise_moved_away(svn_wc__db } SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action, - NULL, + NULL, NULL, db, wcroot->abspath, conflict, scratch_pool, @@ -16525,8 +16525,8 @@ db_process_commit_queue(svn_wc__db_t *db iterpool), iterpool, iterpool)); - lock_remove_txn(queue->wcroot, cqi->local_relpath, work_item, - iterpool); + SVN_ERR(lock_remove_txn(queue->wcroot, cqi->local_relpath, + work_item, iterpool)); } if (cqi->remove_changelist) SVN_ERR(svn_wc__db_op_set_changelist(db, @@ -16578,12 +16578,12 @@ svn_wc__db_process_commit_queue(svn_wc__ } svn_error_t * -svn_wc__find_repos_node_in_wc(apr_array_header_t **local_abspath_list, - svn_wc__db_t *db, - const char *wri_abspath, - const char *repos_relpath, - apr_pool_t *result_pool, - apr_pool_t *scratch_pool) +svn_wc__db_find_repos_node_in_wc(apr_array_header_t **local_abspath_list, + svn_wc__db_t *db, + const char *wri_abspath, + const char *repos_relpath, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool) { svn_wc__db_wcroot_t *wcroot; const char *wri_relpath; @@ -16620,3 +16620,46 @@ svn_wc__find_repos_node_in_wc(apr_array_ return svn_error_trace(svn_sqlite__reset(stmt)); } +svn_error_t * +svn_wc__db_find_working_nodes_with_basename(apr_array_header_t **local_abspaths, + svn_wc__db_t *db, + const char *wri_abspath, + const char *basename, + svn_node_kind_t kind, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool) +{ + svn_wc__db_wcroot_t *wcroot; + const char *wri_relpath; + svn_sqlite__stmt_t *stmt; + svn_boolean_t have_row; + + SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath)); + + SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &wri_relpath, db, + wri_abspath, scratch_pool, + scratch_pool)); + VERIFY_USABLE_WCROOT(wcroot); + + SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb, + STMT_SELECT_PRESENT_HIGHEST_WORKING_NODES_BY_BASENAME_AND_KIND)); + SVN_ERR(svn_sqlite__bindf(stmt, "ist", wcroot->wc_id, basename, + kind_map, kind)); + SVN_ERR(svn_sqlite__step(&have_row, stmt)); + + *local_abspaths = apr_array_make(result_pool, 1, sizeof(const char *)); + + while (have_row) + { + const char *local_relpath; + const char *local_abspath; + + local_relpath = svn_sqlite__column_text(stmt, 1, NULL); + local_abspath = svn_dirent_join(wcroot->abspath, local_relpath, + result_pool); + APR_ARRAY_PUSH(*local_abspaths, const char *) = local_abspath; + SVN_ERR(svn_sqlite__step(&have_row, stmt)); + } + + return svn_error_trace(svn_sqlite__reset(stmt)); +} Modified: subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wc_db.h URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wc_db.h?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wc_db.h (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wc_db.h Tue Nov 13 07:49:04 2018 @@ -3496,12 +3496,30 @@ svn_wc__required_lock_for_resolve(const * which has been replaced. */ svn_error_t * -svn_wc__find_repos_node_in_wc(apr_array_header_t **local_abspath_list, - svn_wc__db_t *db, - const char *wri_abspath, - const char *repos_relpath, - apr_pool_t *result_pool, - apr_pool_t *scratch_pool); +svn_wc__db_find_repos_node_in_wc(apr_array_header_t **local_abspath_list, + svn_wc__db_t *db, + const char *wri_abspath, + const char *repos_relpath, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool); + +/* Return an array of const char * elements, which represent local absolute + * paths for nodes, within the working copy indicated by WRI_ABSPATH, which + * have a basename matching BASENAME and have node kind KIND. + * If no such nodes exist, return an empty array. + * + * This function returns only paths to nodes which are present in the highest + * layer of the WC. In other words, paths to deleted and/or excluded nodes are + * never returned. + */ +svn_error_t * +svn_wc__db_find_working_nodes_with_basename(apr_array_header_t **local_abspaths, + svn_wc__db_t *db, + const char *wri_abspath, + const char *basename, + svn_node_kind_t kind, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool); /* @} */ typedef svn_error_t * (*svn_wc__db_verify_cb_t)(void *baton, Modified: subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wc_db_update_move.c URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wc_db_update_move.c?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wc_db_update_move.c (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wc_db_update_move.c Tue Nov 13 07:49:04 2018 @@ -411,6 +411,11 @@ create_tree_conflict(svn_skel_t **confli ? svn_dirent_join(wcroot->abspath, move_src_op_root_relpath, scratch_pool) : NULL; + const char *move_dst_op_root_abspath + = dst_op_root_relpath + ? svn_dirent_join(wcroot->abspath, + dst_op_root_relpath, scratch_pool) + : NULL; const char *old_repos_relpath_part = old_repos_relpath && old_version ? svn_relpath_skip_ancestor(old_version->path_in_repos, @@ -468,7 +473,7 @@ create_tree_conflict(svn_skel_t **confli SVN_ERR(svn_wc__conflict_read_tree_conflict(&existing_reason, &existing_action, - &existing_abspath, + &existing_abspath, NULL, db, wcroot->abspath, conflict, scratch_pool, @@ -500,6 +505,7 @@ create_tree_conflict(svn_skel_t **confli reason, action, move_src_op_root_abspath, + move_dst_op_root_abspath, result_pool, scratch_pool)); @@ -4099,7 +4105,7 @@ fetch_conflict_details(int *src_op_depth SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, action, - &move_src_op_root_abspath, + &move_src_op_root_abspath, NULL, db, local_abspath, conflict_skel, result_pool, scratch_pool)); Modified: subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wc_db_wcroot.c URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wc_db_wcroot.c?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wc_db_wcroot.c (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wc_db_wcroot.c Tue Nov 13 07:49:04 2018 @@ -528,6 +528,7 @@ svn_wc__db_wcroot_parse_local_abspath(sv const char *adm_relpath; /* Non-NULL if WCROOT is found through a symlink: */ const char *symlink_wcroot_abspath = NULL; + apr_pool_t *iterpool; /* ### we need more logic for finding the database (if it is located ### outside of the wcroot) and then managing all of that within DB. @@ -613,16 +614,20 @@ svn_wc__db_wcroot_parse_local_abspath(sv database in the right place. If we find it... great! If not, then peel off some components, and try again. */ + iterpool = svn_pool_create(scratch_pool); adm_relpath = svn_wc_get_adm_dir(scratch_pool); while (TRUE) { svn_error_t *err; svn_node_kind_t adm_subdir_kind; - const char *adm_subdir = svn_dirent_join(local_abspath, adm_relpath, - scratch_pool); + const char *adm_subdir; - SVN_ERR(svn_io_check_path(adm_subdir, &adm_subdir_kind, scratch_pool)); + svn_pool_clear(iterpool); + + adm_subdir = svn_dirent_join(local_abspath, adm_relpath, iterpool); + + SVN_ERR(svn_io_check_path(adm_subdir, &adm_subdir_kind, iterpool)); if (adm_subdir_kind == svn_node_dir) { @@ -673,7 +678,7 @@ svn_wc__db_wcroot_parse_local_abspath(sv if (!moved_upwards || always_check) { SVN_ERR(get_old_version(&wc_format, local_abspath, - scratch_pool)); + iterpool)); if (wc_format != 0) break; } @@ -697,7 +702,7 @@ svn_wc__db_wcroot_parse_local_abspath(sv SVN_ERR(svn_io_check_resolved_path(local_abspath, &resolved_kind, - scratch_pool)); + iterpool)); if (resolved_kind == svn_node_dir) { /* Is this directory recorded in our hash? */ @@ -973,6 +978,7 @@ try_symlink_as_dir: } while (strcmp(scan_abspath, local_abspath) != 0); + svn_pool_destroy(iterpool); return SVN_NO_ERROR; } Modified: subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wcroot_anchor.c URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wcroot_anchor.c?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wcroot_anchor.c (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/libsvn_wc/wcroot_anchor.c Tue Nov 13 07:49:04 2018 @@ -183,6 +183,29 @@ svn_wc__get_wcroot(const char **wcroot_a svn_error_t * +svn_wc__get_shelves_dir(char **dir, + svn_wc_context_t *wc_ctx, + const char *local_abspath, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool) +{ + const char *wcroot_abspath; + + SVN_ERR(svn_wc__get_wcroot(&wcroot_abspath, wc_ctx, local_abspath, + scratch_pool, scratch_pool)); + *dir = svn_dirent_join(wcroot_abspath, + SVN_WC_ADM_DIR_NAME "/" SVN_WC__ADM_EXPERIMENTAL "/" + "shelves/v2", + result_pool); + + /* Ensure the directory exists. (Other versions of svn don't create it.) */ + SVN_ERR(svn_io_make_dir_recursively(*dir, scratch_pool)); + + return SVN_NO_ERROR; +} + + +svn_error_t * svn_wc_get_actual_target2(const char **anchor, const char **target, svn_wc_context_t *wc_ctx, Modified: subversion/branches/mod-dav-svn-expressions/subversion/mod_authz_svn/mod_authz_svn.c URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/mod_authz_svn/mod_authz_svn.c?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/mod_authz_svn/mod_authz_svn.c (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/mod_authz_svn/mod_authz_svn.c Tue Nov 13 07:49:04 2018 @@ -401,10 +401,12 @@ static svn_authz_t * get_access_conf(request_rec *r, authz_svn_config_rec *conf, apr_pool_t *scratch_pool) { + const char *cache_key = NULL; const char *access_file; const char *groups_file; const char *repos_path; const char *repos_url = NULL; + void *user_data = NULL; svn_authz_t *access_conf = NULL; svn_error_t *svn_err = SVN_NO_ERROR; dav_error *dav_err; @@ -464,19 +466,31 @@ get_access_conf(request_rec *r, authz_sv "Path to groups file is %s", groups_file); } - svn_err = svn_repos_authz_read3(&access_conf, - access_file, groups_file, - TRUE, NULL, - r->connection->pool, scratch_pool); - - if (svn_err) + cache_key = apr_pstrcat(scratch_pool, "mod_authz_svn:", + access_file, groups_file, SVN_VA_NULL); + apr_pool_userdata_get(&user_data, cache_key, r->connection->pool); + access_conf = user_data; + if (access_conf == NULL) { - log_svn_error(APLOG_MARK, r, - "Failed to load the mod_authz_svn config:", - svn_err, scratch_pool); - access_conf = NULL; - } + svn_err = svn_repos_authz_read3(&access_conf, access_file, + groups_file, TRUE, NULL, + r->connection->pool, + scratch_pool); + if (svn_err) + { + log_svn_error(APLOG_MARK, r, + "Failed to load the mod_authz_svn config:", + svn_err, scratch_pool); + access_conf = NULL; + } + else + { + /* Cache the open repos for the next request on this connection */ + apr_pool_userdata_set(access_conf, cache_key, + NULL, r->connection->pool); + } + } return access_conf; } @@ -898,7 +912,7 @@ access_checker(request_rec *r) { /* Set the note to force authn regardless of what access_checker_ex hook requires */ - apr_table_setn(r->notes, FORCE_AUTHN_NOTE, (const char*)1); + apr_table_setn(r->notes, FORCE_AUTHN_NOTE, "1"); /* provide the proper return so the access_checker hook doesn't * prevent the code from continuing on to the other auth hooks */ @@ -964,7 +978,7 @@ access_checker(request_rec *r) * ap_some_authn_rquired() without triggering an infinite * loop since the call will trigger this function to be * called again. */ - apr_table_setn(r->notes, IN_SOME_AUTHN_NOTE, (const char*)1); + apr_table_setn(r->notes, IN_SOME_AUTHN_NOTE, "1"); authn_required = ap_some_authn_required(r); apr_table_unset(r->notes, IN_SOME_AUTHN_NOTE); if (authn_required) @@ -1007,7 +1021,7 @@ check_user_id(request_rec *r) status = req_check_access(r, conf, &repos_path, &dest_repos_path); if (status == OK) { - apr_table_setn(r->notes, "authz_svn-anon-ok", (const char*)1); + apr_table_setn(r->notes, "authz_svn-anon-ok", "1"); log_access_verdict(APLOG_MARK, r, 1, FALSE, repos_path, dest_repos_path); return OK; } Modified: subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/dav_svn.h URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/dav_svn.h?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/dav_svn.h (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/dav_svn.h Tue Nov 13 07:49:04 2018 @@ -359,10 +359,6 @@ svn_boolean_t dav_svn__get_list_parentpa master server version (if provided via SVNMasterVersion). */ svn_boolean_t dav_svn__check_httpv2_support(request_rec *r); -/* For the repository referred to by this request, should ephemeral - txnprop support be advertised? */ -svn_boolean_t dav_svn__check_ephemeral_txnprops_support(request_rec *r); - /* SPECIAL URI @@ -705,6 +701,7 @@ static const dav_report_elem dav_svn__re { SVN_XML_NAMESPACE, "get-deleted-rev-report" }, { SVN_XML_NAMESPACE, SVN_DAV__MERGEINFO_REPORT }, { SVN_XML_NAMESPACE, SVN_DAV__INHERITED_PROPS_REPORT }, + { SVN_XML_NAMESPACE, "list-report" }, { NULL, NULL }, }; @@ -757,6 +754,11 @@ dav_svn__get_inherited_props_report(cons const apr_xml_doc *doc, dav_svn__output *output); +dav_error * +dav_svn__list_report(const dav_resource *resource, + const apr_xml_doc *doc, + dav_svn__output *output); + /*** posts/ ***/ /* The various POST handlers, defined in posts/, and used by repos.c. */ @@ -1114,6 +1116,19 @@ dav_svn__get_youngest_rev(svn_revnum_t * dav_svn_repos *repos, apr_pool_t *scratch_pool); +/* Return the liveprop-encoded form of AUTHOR, allocated in RESULT_POOL. + * If IS_SVN_CLIENT is set, assume that the data will be sent to a SVN + * client. This mainly sanitizes AUTHOR strings with control chars in + * them without converting them to escape sequences etc. + * + * Use SCRATCH_POOL for temporary allocations. + */ +const char * +dav_svn__fuzzy_escape_author(const char *author, + svn_boolean_t is_svn_client, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool); + /*** mirror.c ***/ /* Perform the fixup hook for the R request. */ Modified: subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/liveprops.c URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/liveprops.c?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/liveprops.c (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/liveprops.c Tue Nov 13 07:49:04 2018 @@ -423,43 +423,10 @@ insert_prop_internal(const dav_resource if (last_author == NULL) return DAV_PROP_INSERT_NOTDEF; - if (svn_xml_is_xml_safe(last_author->data, last_author->len) - || !resource->info->repos->is_svn_client) - value = apr_xml_quote_string(scratch_pool, last_author->data, 1); - else - { - /* We are talking to a Subversion client, which will (like any proper - xml parser) error out if we produce control characters in XML. - - However Subversion clients process both the generic - as the custom element for svn:author. - - Let's skip outputting the invalid characters here to make the XML - valid, so clients can see the custom element. - - Subversion Clients will then either use a slightly invalid - author (unlikely) or more likely use the second result, which - will be transferred with full escaping capabilities. - - We have tests in place to assert proper behavior over the RA layer. - */ - apr_size_t i; - svn_stringbuf_t *buf; - - buf = svn_stringbuf_create_from_string(last_author, scratch_pool); - - for (i = 0; i < buf->len; i++) - { - char c = buf->data[i]; - - if (svn_ctype_iscntrl(c)) - { - svn_stringbuf_remove(buf, i--, 1); - } - } - - value = apr_xml_quote_string(scratch_pool, buf->data, 1); - } + /* We need to sanitize the LAST_AUTHOR. */ + value = dav_svn__fuzzy_escape_author(last_author->data, + resource->info->repos->is_svn_client, + scratch_pool, scratch_pool); break; } Modified: subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/mod_dav_svn.c URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/mod_dav_svn.c?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/mod_dav_svn.c (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/mod_dav_svn.c Tue Nov 13 07:49:04 2018 @@ -246,6 +246,9 @@ merge_server_config(apr_pool_t *p, void newconf->compression_level = child->compression_level; } + newconf->use_utf8 = INHERIT_VALUE(parent, child, use_utf8); + svn_utf_initialize2(newconf->use_utf8, p); + return newconf; } @@ -306,8 +309,8 @@ merge_dir_config(apr_pool_t *p, void *ba if (parent->fs_path) ap_log_error(APLOG_MARK, APLOG_WARNING, 0, NULL, - "mod_dav_svn: nested Location '%s' hinders access to '%s' " - "in SVNPath Location '%s'", + "mod_dav_svn: Location '%s' hinders access to '%s' " + "in parent SVNPath Location '%s'", child->root_dir, svn_urlpath__skip_ancestor(parent->root_dir, child->root_dir), parent->root_dir); @@ -1069,21 +1072,6 @@ dav_svn__check_httpv2_support(request_re } -svn_boolean_t -dav_svn__check_ephemeral_txnprops_support(request_rec *r) -{ - svn_version_t *version = dav_svn__get_master_version(r); - - /* We know this server supports ephemeral txnprops. But if we're - proxying requests to a master server, we need to see if it - supports them, too. */ - if (version && (! svn_version__at_least(version, 1, 8, 0))) - return FALSE; - - return TRUE; -} - - /* FALSE if path authorization should be skipped. * TRUE if either the bypass or the apache subrequest methods should be used. */ @@ -1422,7 +1410,7 @@ static int dav_svn__translate_name(reque /* Leave a note to ourselves so that we know not to decline in the * map_to_storage hook. */ - apr_table_setn(r->notes, NO_MAP_TO_STORAGE_NOTE, (const char*)1); + apr_table_setn(r->notes, NO_MAP_TO_STORAGE_NOTE, "1"); return OK; } Modified: subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/reports/file-revs.c URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/reports/file-revs.c?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/reports/file-revs.c (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/reports/file-revs.c Tue Nov 13 07:49:04 2018 @@ -214,7 +214,7 @@ file_rev_handler(void *baton, frb->compression_level, pool); *window_handler = delta_window_handler; *window_baton = frb; - /* Start the txdelta element wich will be terminated by the window + /* Start the txdelta element which will be terminated by the window handler together with the file-rev element. */ SVN_ERR(dav_svn__brigade_puts(frb->bb, frb->output, "")); } Modified: subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/reports/replay.c URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/reports/replay.c?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/reports/replay.c (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/reports/replay.c Tue Nov 13 07:49:04 2018 @@ -437,7 +437,7 @@ dav_svn__replay_report(const dav_resourc URL, and BASE_DIR is embedded in the request body. The old-school (and incorrect, see issue #4287 -- - http://subversion.tigris.org/issues/show_bug.cgi?id=4287) way was + https://issues.apache.org/jira/browse/SVN-4287) way was to REPORT on the public URL of the BASE_DIR and embed the REV in the report body. */ Modified: subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/repos.c URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/repos.c?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/repos.c (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/repos.c Tue Nov 13 07:49:04 2018 @@ -2861,6 +2861,13 @@ open_stream(const dav_resource *resource "Resource body changes may only be made to " "working resources (at this time)."); } + if (!resource->info->root.root) + { + return dav_svn__new_error(resource->pool, HTTP_METHOD_NOT_ALLOWED, + 0, 0, + "Resource body changes may only be made to " + "checked-out resources (at this time)."); + } } /* ### TODO: Can we support range writes someday? */ Modified: subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/util.c URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/util.c?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/util.c (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/util.c Tue Nov 13 07:49:04 2018 @@ -37,6 +37,7 @@ #include "svn_fs.h" #include "svn_dav.h" #include "svn_base64.h" +#include "svn_ctype.h" #include "dav_svn.h" #include "private/svn_fspath.h" @@ -954,3 +955,48 @@ dav_svn__get_youngest_rev(svn_revnum_t * *youngest_p = repos->youngest_rev; return SVN_NO_ERROR; } + +const char * +dav_svn__fuzzy_escape_author(const char *author, + svn_boolean_t is_svn_client, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool) +{ + apr_size_t len = strlen(author); + if (is_svn_client && !svn_xml_is_xml_safe(author, len)) + { + /* We are talking to a Subversion client, which will (like any proper + xml parser) error out if we produce control characters in XML. + + However Subversion clients process both the generic + as the custom element for svn:author. + + Let's skip outputting the invalid characters here to make the XML + valid, so clients can see the custom element. + + Subversion Clients will then either use a slightly invalid + author (unlikely) or more likely use the second result, which + will be transferred with full escaping capabilities. + + We have tests in place to assert proper behavior over the RA layer. + */ + apr_size_t i; + svn_stringbuf_t *buf; + + buf = svn_stringbuf_ncreate(author, len, scratch_pool); + + for (i = 0; i < buf->len; i++) + { + char c = buf->data[i]; + + if (svn_ctype_iscntrl(c)) + { + svn_stringbuf_remove(buf, i--, 1); + } + } + + author = buf->data; + } + + return apr_xml_quote_string(result_pool, author, 1); +} Modified: subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/version.c URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/version.c?rev=1846488&r1=1846487&r2=1846488&view=diff ============================================================================== --- subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/version.c (original) +++ subversion/branches/mod-dav-svn-expressions/subversion/mod_dav_svn/version.c Tue Nov 13 07:49:04 2018 @@ -152,9 +152,7 @@ get_vsn_options(apr_pool_t *p, apr_text_ 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_REVERSE_FILE_REVS); - apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_SVNDIFF1); - apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_SVNDIFF2); - apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_PUT_RESULT_CHECKSUM); + apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_LIST); /* 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. @@ -178,11 +176,29 @@ get_option(const dav_resource *resource, const apr_xml_elem *elem, apr_text_header *option) { + int i; request_rec *r = resource->info->r; const char *repos_root_uri = dav_svn__build_uri(resource->info->repos, DAV_SVN__BUILD_URI_PUBLIC, SVN_IGNORED_REVNUM, "", FALSE /* add_href */, resource->pool); + svn_version_t *master_version = dav_svn__get_master_version(r); + + /* These capabilities are used during commit and when configured as + a WebDAV slave (SVNMasterURI is set) their availablity should + depend on the master version (SVNMasterVersion is set) if it is + older than our own version. Also, although SVNDIFF1 is available + before 1.10 none of those earlier servers advertised it so for + consistency we don't advertise it for masters older than 1.10. */ + struct capability_versions_t { + const char *capability_name; + svn_version_t min_version; + } capabilities[] = { + { SVN_DAV_NS_DAV_SVN_EPHEMERAL_TXNPROPS, { 1, 8, 0, ""} }, + { SVN_DAV_NS_DAV_SVN_SVNDIFF1, { 1, 10, 0, ""} }, + { SVN_DAV_NS_DAV_SVN_SVNDIFF2, { 1, 10, 0, ""} }, + { SVN_DAV_NS_DAV_SVN_PUT_RESULT_CHECKSUM, { 1, 10, 0, ""} }, + }; /* ### DAV:version-history-collection-set */ if (elem->ns != APR_XML_NS_DAV_ID @@ -208,14 +224,6 @@ get_option(const dav_resource *resource, apr_text_append(resource->pool, option, ""); - /* If we're allowed (by configuration) to do so, advertise support - for ephemeral transaction properties. */ - if (dav_svn__check_ephemeral_txnprops_support(r)) - { - apr_table_addn(r->headers_out, "DAV", - SVN_DAV_NS_DAV_SVN_EPHEMERAL_TXNPROPS); - } - if (resource->info->repos->fs) { svn_error_t *serr; @@ -276,8 +284,6 @@ get_option(const dav_resource *resource, DeltaV-free! If we're configured to advise this support, do so. */ if (resource->info->repos->v2_protocol) { - int i; - svn_version_t *master_version = dav_svn__get_master_version(r); dav_svn__bulk_upd_conf bulk_upd_conf = dav_svn__get_bulk_updates_flag(r); /* The list of Subversion's custom POSTs and which versions of @@ -348,6 +354,22 @@ get_option(const dav_resource *resource, } } + /* Report commit capabilites. */ + for (i = 0; i < sizeof(capabilities)/sizeof(capabilities[0]); ++i) + { + /* If a master version is declared filter out unsupported + capabilities. */ + if (master_version + && (!svn_version__at_least(master_version, + capabilities[i].min_version.major, + capabilities[i].min_version.minor, + capabilities[i].min_version.patch))) + continue; + + apr_table_addn(r->headers_out, "DAV", + apr_pstrdup(r->pool, capabilities[i].capability_name)); + } + return NULL; } @@ -1154,6 +1176,10 @@ deliver_report(request_rec *r, { return dav_svn__get_inherited_props_report(resource, doc, output); } + else if (strcmp(doc->root->name, "list-report") == 0) + { + return dav_svn__list_report(resource, doc, output); + } /* NOTE: if you add a report, don't forget to add it to the * dav_svn__reports_list[] array. */